[darcs-devel] [issue487] conflict that can only be resolved using amend-record

Philip Derrin bugs at darcs.net
Wed Jun 20 21:25:38 PDT 2007


New submission from Philip Derrin <narge-darcs at derrin.id.au>:

This bug was seen in a project with around 700 patches. I'm not sure what caused it, 
and couldn't reproduce it in a new repository.

In File.lhs, line 69 is empty. Patch A, in the repostitory, adds another empty line at 
line 70. Patch B, being pulled from a branch that doesn't have patch A, adds a block of 
code at line 70, including a new empty line at the end.

The output of darcs whatsnew after pulling patch B is something like:

hunk ./File.lhs 70
+v v v v v v v
+
+*************
+> f :: A -> M ()
+> f a = error "Blah"
+
+^ ^ ^ ^ ^ ^ ^

I then resolve the conflict by keeping the new code, and record patch C:

hunk ./File.lhs 69
+
+> f :: A -> M ()
+> f a = error "Blah"

However, the conflict still exists. Running resolve adds a second copy of the new code 
to the file. This was a rather confusing situation.

I eventually discovered a workaround, by unpulling patch C and removing both empty 
lines, then recording patch D:

hunk ./File.lhs 69
-
+> f :: A -> M ()
+> f a = error "Blah"

At this point, there was no more conflict. After replacing the empty lines and using 
amend-record, patch D became:

hunk ./File.lhs 70
+> f :: A -> M ()
+> f a = error "Blah"
+

Which still resolves the conflict, and has the desired effect on the file.

----------
messages: 1742
nosy: EricKow, beschmi, droundy, narge, tommy
priority: bug
status: unread
title: conflict that can only be resolved using amend-record

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue487>
__________________________________


More information about the darcs-devel mailing list