[darcs-devel] merging with working set

David Roundy droundy at abridgegame.org
Tue Feb 8 04:41:49 PST 2005


On Tue, Feb 08, 2005 at 04:32:48AM +0100, Johan Rydberg wrote:
> I have a little problem.  Darcs doesn't seem to handle patch merges
> with changes already in the working set.  To clearify, take this
> example:
...[nice thorough summary]...
> I've just started to use darcs after being used to CVS for several
> years, and this behavior is unfamiliar to me.  CVS is capable of
> resolving situations like this without reporting a conflict.  Or is it
> that darcs identifies a conflict between the freshly pulled patch and
> the "pending" patch -- and thinks that pending is ordered before
> "bar", and therefor reports a conflict?

It's a question of how you define a conflict.  I would say that in your
case darcs was right, there were two conflicting changes.  Admittedly, they
were identical, but darcs doesn't know whether the "correct" answer is to
have two bars or four bars when the merge is complete.  That would depend
on what programming language you're using, for example.

As an example where darcs' behavior would be "correct" and cvs would be
"wrong", take an example from a code which I've used in the past, which
sadly was written in fortran.  There was an array of "input commands", and
a separate integer indicating how many elements that array contains.  If
two people each add a single command, they will both make the change

-       numcommands = 501
+       numcommands = 502

but of course the correct "merged" result will be

-       numcommands = 501
+       numcommands = 503

Darcs, of course, has no way of knowing this.  And obviously there's no way
a revision control will be able to always flag a conflict when you have
changes that when merged will break the code.  But I don't think that
darcs' conflict behavior in this case (or in your bar\nbar case) is really
wrong.

There are definitely problems with the way darcs handles conflicts, but I
don't think this is one of them.
-- 
David Roundy
http://www.darcs.net




More information about the darcs-devel mailing list