"bzr remerge" should not remerge resolved conflicts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Low
|
Unassigned |
Bug Description
Suppose I do a merge that reports conflicts in several files. I fix some of the files and "bzr resolve" them. I then do "bzr remerge", in an attempt to make the conflicts in remaining files more tractable.
I would expect that remerge would leave alone any files that have been "bzr resolve"ed, but instead it remerges them, and brings them back into "conflicted" state.
Workarounds:
- specify the files to be remerged, using "bzr remerge filename[s]"
- if you've already re-conflicted some files by running "bzr remerge" with no filenames, the manually resolved version of each such file will be in filename.THIS.
To reproduce:
First, run the following pure shell script to set things up:
# ===== BEGIN =====
# Initial setup
bzr init a
cat >a/f1 <<EOF
a
b
c
EOF
cat >a/f2 <<EOF
1
2
3
EOF
bzr add a
bzr commit a '-mAdd files'
bzr branch a b
# Create conflicts in f1 and f2
echo >>a/f1 new in a
echo >>a/f2 new in a
bzr commit a '-mmods in a'
echo >>b/f1 new in b
echo >>b/f2 new in b
bzr commit b '-mmods in b'
# Merge a into b
cd b
bzr merge
# Resolve conflict in f1
mv f1.BASE f1
echo >>f1 "new (resolved)"
bzr resolve f1
# ===== END =====
Now run the following commands (from here on is NOT a runnable shell script):
#
# Verify the state before tripping the bug. Note that, as expected, no
# conflict is reported on f1.
#
$ bzr stat
modified:
f1
f2
unknown:
f2.BASE
f2.OTHER
f2.THIS
conflicts:
Text conflict in f2
pending merge tips: (use -v to see all merge revisions)
Eric Siegerman 2009-08-05 mods in a
#
# Trip the bug. This should not report a conflict on f1, since it should not
# attempt to remerge f1 in the first place.
#
$ bzr remerge --show-base
Text conflict in f1
Text conflict in f2
2 conflicts encountered.
#
# Sure enough, the conflict markers are back (but note that
# the TREE version contains my manual resolution of the
# conflict.
#
$ cat f1
a
b
c
<<<<<<< TREE
new (resolved)
||||||| BASE-REVISION
=======
new in a
>>>>>>> MERGE-SOURCE
$
tags: | added: conflicts merge remerge |
Changed in bzr: | |
status: | New → Confirmed |
importance: | Undecided → Low |
tags: | added: check-for-breezy |
I'm pretty sure that "bzr remerge" is intended as "please re-try the merge from scratch". What you might be looking for is:
bzr remerge `bzr conflicts --text`
Though perhaps:
bzr remerge --only-conflicts
Or something along those lines would be a better way of invoking it?