simple question for cvs

simple question for cvs

by Konstantin Etkine -
Number of replies: 8
I hope this forum is correct forum for my question.

I have a version of moodle that was downloaded as package from download.moodle.org. I now want to obtain identical version but this time from cvs. I need to know cvs command to do so.

In package, version.php say

$version = 2007101514;
$release = '1.9.1+ (Build: 20080625)';

and manifest.txt say

Manifest for MOODLE_19_WEEKLY 20080625

Is possible from such information to construct cvs command for anonimus checkout?

Thank you



Average of ratings: -
In reply to Konstantin Etkine

Re: simple question for cvs

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Konstantin,

I think that, once you know the Build date, (Build: 20080625 in your example), all you need to do is:

cvs -z3 -d:pserver:anonymous@eu.cvs.moodle.org:/cvsroot/moodle co -P -r MOODLE_19_STABLE -D "06/25/08 10:30:00" moodle

And you'll get exactly the files for that build. Some notes:

-r is the branch you want to get (MOODLE_19_STABLE in your request).

-D is the exact date/time you are interested on, in format "month:day:year hour:minute: second". Note that I've used your date (from the Build info above) and have used "10:30:00" as time , because it's some minutes after Moodle builds become tagged daily by a robot script. So using that time should guarantee you to get the correct files.

Note that the "-r and -D" pair not only works in cvs checkout commands but in cvs update, cvs diff and so on.

Hope this helps, ciao smile
Average of ratings: Useful (2)
In reply to Eloy Lafuente (stronk7)

Re: simple question for cvs

by Konstantin Etkine -
Thank you Eloy,
But how did you dtermine the time to be 10:30:00? How do you know?

Is there a way that does not require "inside knowledge" of time? For example, a cvs command that can use the file versions in the manifest?

Second question:

"CVS for Administrators" say to update your local copy to the current version in you type

(1) cvs update -dP

But to update your local copy to a new version you type

(2) cvs update -dP -r MOODLE_19_STABLE

Now my simple question: If my local copy is 1.9.1 and I want 1.9.2, do I use (1) or (2)?

Sorry for such primitive question, but unfortunately documentation never explain if 1.9.2 is "new version" or "same version" relative to 1.9.1.
In reply to Konstantin Etkine

Re: simple question for cvs

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
> But how did you dtermine the time to be 10:30:00? How do you know?

As commented above, I know 10:30 is a good time because I know that, some minutes before that, is when one script running in one of the moodle.org servers uses to update the "(Build: xxxxx)" info in version.php files. Not because 10:30 is something worlwide accepted nor anything else, but because it the time we execute that script in our servers. Just use that time because it's the "good one" for Moodle cvs. Simply that.

> Is there a way that does not require "inside knowledge" of time? For example, a cvs command that can use the file versions in the manifest?

Well, in the manifest, there is a complete list of files and versions. I think you can read that file and then, request all those files individually. But I think it'll be really slow. Something like:

cvs update -r version file

executed for each line in the manifest should do the work. But you'll get 99.99% the same files with the strategy commented in my previous post.

> Now my simple question: If my local copy is 1.9.1 and I want 1.9.2, do I use (1) or (2)?

Once you execute something like:

cvs update -dPr MOODLE_19_STABLE

your local copy of the cvs server will continue operating in the MOODLE_19_STABLE branch. You don't need to specify the "-r MOODLE_19_STABLE" for each cvs command at all.

You only need to specify the -r tag if you want to change to another branch so, for example, if you want to start working with Moodle 1.7 you'll execute:

cvs update -dPr MOODLE_17_STABLE

and, once again, all the following cvs commands in that directory will operate in the MOODLE_17_STABLE branch by default.

Finally, note that each MOODLE_XX_STABLE branch "contains" all the Moodle XX versions, so, if you want to switch from Moodle 1.9.1 to Moodle 1.9.3 you don't need to change any branch, both are contained in the MOODLE_19_STABLE branch. And one simple cvs update -dP will update you to the latest code available in the branch (that right now is 1.9.2+ and will be 1.9.3 in some days... and 1.9.4 later... and...).

> Sorry for such primitive question, but unfortunately documentation never explain if 1.9.2 is "new version" or "same version" relative to 1.9.1.

Is new version, but same (MOODLE_19_STABLE) branch.

NP at all! I remember my first days with CVS, branches, revisions and so on and those were difficult days! tongueout

Ciao smile

P.S.: Finally note that all this complexity is about to get some past weekly builds. There you need the dates (with the 10:30 trick) because there is nothing else in the cvs server identifying those weeklies. But if you want releases (not weeklies) you can use the MOODLE_XYZ tags (1.9.2 = "cvs update -dPr MOODLE_192"). But IMO you shouldn't be using releases but weeklies that include fixes for a bunch of bugs present in releases. So perhaps it's better if you forget this last paragraph after all. wink
Average of ratings: Useful (1)
In reply to Eloy Lafuente (stronk7)

Re: simple question for cvs

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Just an idea. Why not to tag every weekly release? E.g. MOODLE_193_7 could be the seventh weekly build of 1.9.3 version. Or any other scheme that would allow to checkout any weekly release from the past.
In reply to David Mudrák

Re: simple question for cvs

by Marc Grober -
See the tracker item below and review the forum cites contained therein.....
http://tracker.moodle.org/browse/MDLSITE-430
In reply to Marc Grober

Re: simple question for cvs

by Konstantin Etkine -
Hmm... I read tracker but I am confused, I am confused. Hmm...

Well it seem obvious to me that your idea is good and sensible one.
In reply to David Mudrák

Re: simple question for cvs

by Konstantin Etkine -
David Mudrak suggestion seem very sensible! But maybe tags too costly, and Moodle try to save money smile
In reply to Eloy Lafuente (stronk7)

Re: simple question for cvs

by Konstantin Etkine -
Eloy, once again I thank you. I follow your suggestion and result was close, but not exact. I am still puzzled by differences, though I can easily fix all such.

Package like can of Spam: Ingredients uncertain.

To give you background on why I need to do such: I am helping client who originally download moodle package and now want to update, but client has unfortunately made many customizations. I advise that best approach is to retrofit package into cvs. To do such, I first determine version of package (from manifest, plus "inside" knowledge of 10:30), then checkout version from cvs using your command. Then I clone CVS directories from checkout version onto package version. Now package "under cvs" smile and I can update normally using cvs, easily resolving conflicts.

Am I first person in history of moodle to attempt such? It seem to be a common problem shared by all who foolishly make changes to download package and then wish to update. For example, even today we have such discussion http://moodle.org/mod/forum/discuss.php?d=108333 "How do I apply updates without losing my customized code?"