[darcs-users] Confused by conflict

Albert Reiner areiner at tph.tuwien.ac.at
Thu Apr 28 18:46:31 UTC 2005


Hi,

I am absolutely confused by conflict handling in Darcs (version
1.0.2).

I have some repo, OLD; and then I started a new line of development,
NEW.  To this end I simply did a

    darcs get OLD NEW

Most of the time I worked in NEW, and in case there were patches I
wanted to go to both repos I just pushed those from NEW to OLD.  I
guess this was safe as `darcs push` refuses to do anything with
conflicting patches.

Today, however, I made some change in OLD, and I pulled that patch
into NEW; there were tons of unrecorded changes in NEW; and I got a
conflict in one of the files in NEW as one of the changes was adjacent
to some lines that had changed in the working copy of NEW but neither
in the NEW pristine nor in OLD.  In this case, I can get the correct
version of the file in the working directory just by removing all the
conflict markers.

The way I wrongly understood things to work, I should then simply
remove those conflict markers in the working tree, be able to see that
as a change in `darcs whatsnew`, and record that.  All of this without
recording any other changes at the same time, nor loosing any of the
non-recorded changes.

But when I tried to do so, neither `whatsnew` nor `record` showed any
changes related to those lines, and I could not record anything.  I
believe I now understand that part, see below.

In the meantime I have probably made things worse by `get`ting a new
repository, FOO, from NEW, pulling the offending patch from OLD into
FOO, trying to resolve just that one conflict in FOO by removing the
conflict markers and adding those lines that had been added in NEW but
no in OLD right next to the patch, and pulling that into NEW.  I have
also tried to unpull that patch from FOO, but now I get "Couldn't
commute patch past pending" even though _darcs/patches/pending
contains just the two lines "{" and "}".

Also, I can now run `darcs repair` as often as I want, either in NEW
or in FOO: I always get a message about a pristine tree being fixed
(shouldn't that go away after one application?), but diff finds no
differences between the files under _darcs (this is the pristine, I
suppose) and those in current-old.

My guess (inspired by the Wiki description of the "commute past
pending" error message) is that at least part of my confusion comes
from not properly distinguishing between working and pristine trees.
I think the following might have happened:

- pulling that patch caused it to be applied both to the pristine and
  the working tree;

- this in turn caused a conflict in working (where one hunk was
  adjacent to modified lines) but not in the pristine;

- therefore, removing the conflict markers did not cause any
  additional unrecorded changes to show up in `whatsnew`, and I could
  not record anything.

Is this correct?  But even if it is, that still does not explain why
`darcs repair` keeps fixing some pristine, especially as it does not
seem to make any changes.  Any explanation for that?  And, most
importantly, how can I resolve these problems?  Any help would be much
appreciated.

Albert.




More information about the darcs-users mailing list