[darcs-users] what filenames should be suggested in this conflict?

zooko at zooko.com zooko at zooko.com
Fri Aug 5 12:56:57 UTC 2005


In an IRC discussion, Nathaniel Smith of the Monotone project asked other
revision control system developers a quiz question:

Quote from NJS (edited for clarity):

   """
   This is a revision graph, to be read top-to-bottom.  Each letter
   indicates the name of some file in each revision -- so it as named
   "a" at first, then two people independently renamed it to either "b"
   or "c", it stayed that way for a while, someone else renamed it again
   to "d", etc.:

      a
     / \
     b  c
     |  |\
     |  | \
      \/   \
       c    d
   
   Question: when merging "c" and "d", what do you expect to have happen?
   """


I tried it in darcs, a full transcript of which is pasted at the end of this
letter.  Darcs did exactly what I wanted -- it raised the merge of the two
heads to the user as a merge conflict -- except for one thing: it suggested to
the user that the names to consider where "a" and "c".  It seems obvious to me
that the names to consider are "c" and "d", or else perhaps "a", "c", and "d".

Is this a bug in darcs?

In the following transcript "1" is the top level of NJS's diagram, "2l" and
"2r" are the second level, left and right branches respectively, "3l" and "3r"
are the bottom-most nodes in NJS's diagram -- the two "heads" -- and "4l" and
"4r" two attempts to merge 3l and 3r -- first by getting 3l and then pulling
3r, and second by getting 3r and then pulling 3l.  These two attempts yielded
identical results, as expected.

Regards,

Zooko


$ mkdir 1
$ cd 1
$ touch a
$ darcs init
$ darcs add a
$ darcs record --author=1 --all
What is the patch name? new file a
Do you want to add a long comment? [yn] n
Finished recording patch 'new file a'
$ cd ..
$ darcs get 1 2l
Copying patch 1 of 1... done!
Finished getting.
$ darcs get 1 2r
Copying patch 1 of 1... done!
Finished getting.
$ cd 2l
$ darcs mv a b
$ darcs record --author=2l --all
What is the patch name? rename a to b
Do you want to add a long comment? [yn] n
Finished recording patch 'rename a to b'
$ cd ../2r
$ darcs mv a c
$ darcs record --author=2r --all -m'rename a to c'
Finished recording patch 'rename a to c'
$ cd ..
$ darcs get 2r 3r
Copying patch 2 of 2... done!
Finished getting.
$ cd 3r
$ darcs mv c d
$ darcs record --author=3r --all -m'rename c to d'
Finished recording patch 'rename c to d'
$ cd ..
$ darcs get 2r 3l
Copying patch 2 of 2... done!
Finished getting.
$ cd 3l
$ darcs pull ../2l

Thu Aug  4 23:43:19 ADT 2005  2l
  * rename a to b
Shall I pull this patch? (1/1) [ynWvpxqadjk], or ? for help: y
We have conflicts in the following files:
./a ./b
Finished pulling and applying.
$ ls 
_darcs b
$ darcs mv b c
$ darcs record --author=3l --all -m'resolve merge conflict in favor of name c'
Finished recording patch 'resolve merge conflict in favor of name c'
$ cd ..
$ darcs get 3l 4l
Copying patch 4 of 4... done!
Finished getting.
$ cd 4l
$ darcs pull ../3r

Thu Aug  4 23:44:07 ADT 2005  3r
  * rename c to d
Shall I pull this patch? (1/1) [ynWvpxqadjk], or ? for help: y
We have conflicts in the following files:
./a ./c
Finished pulling and applying.
$ ls
_darcs c
$ cd ..
$ darcs get 3r 4r
Copying patch 3 of 3... done!
Finished getting.
$ cd 4r
$ darcs pull ../3l

Thu Aug  4 23:43:19 ADT 2005  2l
  * rename a to b
Shall I pull this patch? (1/2) [ynWvpxqadjk], or ? for help: y

Thu Aug  4 23:44:54 ADT 2005  3l
  * resolve merge conflict in favor of name c
Shall I pull this patch? (2/2) [ynWvpxqadjk], or ? for help: y
We have conflicts in the following files:
./a ./c
Finished pulling and applying.
$ ls
_darcs c




More information about the darcs-users mailing list