[darcs-users] Conflicting patches

Tommy Pettersson ptp at lysator.liu.se
Thu Feb 24 12:07:45 UTC 2005


On Wed, Feb 23, 2005 at 12:08:27AM +0100, Lele Gaifax wrote:
> Inspecting, I found the following:
> 
> 1) the actual content of the file isn't changed, it contains my own   
>    translation
[...]

This is how darcs marks the conflict in your code for you.
It's the same thing the command 'darcs resolve' would produce,
and darcs did this automatically for you when you pulled the
conflicting patch.  The conflict markings are simply inserted
into working and 'darcs revert' will "undo" them (this does,
of course, not remove the conflict itself).

> 4) cloning the repo I got no conflicts, but in the copy
> 
>   a) the file is still missing
[...]

'Get' doesn't automatically mark the conflict as 'pull' does.
You can run 'darcs resolve' to get the conflict marked in the
same way as in the first repo, and 'darcs revert' to remove
it again.


Clear?  I guess not...

The problem is that in your case the result look nothing like
conflict markings.  If two lines conflict, you would get

  v v v v v v
  Hello world!
  - - - - - -
  Hi, World!
  ^ ^ ^ ^ ^ ^

which is pretty clear.

But when two 'addfile's conflict it is not that easy.  I don't
know exactly how conflict marking happens, but in this case
it looks like just one of the two candidates for the file is
created with its contents but not any other markings.


> What are the right steps to go there?

A conflict is resolved by recording something that covers all
of the conflicting patches with new stuff.  In this case a new
addfile patch will override the two conflicting ones, and that
is why the file is "removed", or rather "not added", so you
can add it again and record a patch that resolves the conflict.

Just make sure the file has the right contents and record it.

To retrieve the two versions of the file (since they are not
both made available with 'darcs resolve'), you can unpull one
or the other of the conflicting patches in a temporary repo.


-- 
Tommy Pettersson <ptp at lysator.liu.se>




More information about the darcs-users mailing list