Hi!
=?ISO-8859-1?Q?st=E9phane_ducasse?= ducasse@iam.unibe.ch wrote:
goran
I read the darcs manual in diagonal and got lost.
You did? I found the "Getting started" pretty easy:
http://www.darcs.net/manual/node4.html
Do you know if there is a place where I can find a scenario like:
cd toto cvs import toto ducasse 1 cd ../ mv toto totoOld cvs co toto ... cvs update cvs commit
:)
Well I think you find this info in the above link but essentially a rough equivalent of the above (if I grokked what you wanted to do) would be:
1.mkdir toto 2.cd toto 3.darcs init 4.cp ../orig/* . 5.darcs record -l 6.cd .. 7.mv toto totoOld 8.darcs get totoOld toto 9.cd toto 10...(edit a file in toto)... 11.darcs whatsnew -s 12.cd ../totoOld 13...(edit a file in totoOld)... 14.darcs record 15.cd ../toto 16.darcs pull ../totoOld 17.darcs record 18.darcs push ../totoOld
Lines described:
3: Turns the directory "toto" into a darcs repository. It only creates a dir called "_darcs" on the top level - the rest is untouched and is your "working copy". 4: We "import" another file tree into this repo. But nothing is recorded yet. 5: Record a patch, "-l" means "look for adds". This will create a single patch creating the whole file tree. 7: Move the repo to another place in the filesystem, no problem. 8: Create a "checkout" of the old repo. This creates a new repo with all patches in the old repo. 11: Show in summary "-s" mode what local changes there are. 14. Record a new patch in the old repo. It will interactively ask you stuff to do it. 16. This is the equivalent of "cvs update" - we pull patches from another repo. The interesting part is that you can pull from ANY repo. 17. Record a change in the new repo. 18. This is the equivalent of "cvs commit" - we push patches from this repo to another repo. It is the reverse of pull.
One thing you notice in the above is that work is being done in a "two step" way:
- First you make all your edits in the file tree. Darcs detects adds/removes and edits, no need to use darcs commands! - Next you record your edits in one or several "patches". You don't need to record all edits in one patch (just like with CVS). The patches will be physically stored inside the top directory _darcs - Finally you push your patches to another repo. This means that you can actually record several patches locally and then later push them to a shared repo, or only push selected ones! You can also regret patches and revert them etc before pushing.
Well, enough typing... Read the manual! :)
regards, Göran