[darcs-users] Dealing with File Addition Conflicts

Stephen J. Turnbull stephen at xemacs.org
Mon Jun 23 21:43:31 UTC 2008


Curt Sampson writes:

 > Let's say I do this:
 > 
 >     mkdir repo1; cd repo1; darcs init; cd ..
 >     darcs get repo1 repo2
 >     cd repo1; echo "one" > file; darcs add file; darcs record -a -m 'one'; cd ..
 >     cd repo2; echo "two" > file; darcs add file; darcs record -a -m 'two'
 >     darcs pull -a

 > Where do I find a copy of the file containing "one", and/or information
 > about what change conflicted there, so I can decide whether to keep my
 > version of "file," use the pulled version of "file," or do some merge of
 > the two?

You don't.  This is a serious bug in Darcs with the backward-
compatible repo formats (--old-inventory-format and --hashed).  (It's
new to me, and I don't know if it's an old but unknown bug or a
regression.)  This doesn't happen with the darcs-2-format repo.
(Change "darcs init" to "darcs init --darcs-2" in your script.)  This
gives

chibi:repo2 steve$ cat file
v v v v v v v
one
*************
two
^ ^ ^ ^ ^ ^ ^
chibi:repo2 steve$ 

which has to be the world's suckiest merge3 output, but hey, at least
you can console yourself by commuting some patches. :-)

Strictly speaking, there is actually full information in the merge
patch in _darcs/patches (which turns out to be a transformation of the
patch in repo1, but retains the same name, urk).  But this isn't very
useful to humans.

 > And this is very strange to my mind: if I do a "darcs revert -a" at this
 > point, "file" vanishes entirely, though "darcs changes" claims that I
 > have both patch "one" and "two". So it seems that repo1 has a patch
 > "one" that adds "file", but repo2 has a patch "one" that removes "file."
 > What's up with this?

Patch theory isn't.  Rather it's a bunch of wishful thinking that has
never been carefully verified to correspond to the reality of
patching, and the net result is that David et al are flying by the
seats of their pants, just like everyone else.

Linus may be an ass, but I'd rather have his ass flying my repos than
anyone else's.


More information about the darcs-users mailing list