bzr merge fails with changed/removed file, hard to recover

Bug #2866 reported by Martin Pitt
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Unassigned

Bug Description

Situation: some SuSE guy autotoolized pmount a while ago, which involved quite a lot of file renames, moves, and deletions. The autotoolized version which branched off an earlier pmount version is at http://people.ubuntu.com/~pitti/bzr/pmount-autotools/ .

I tried to merge this branch against pmount main; a snapshot of the version I merged to is at http://people.ubuntu.com/~pitti/bzr/pmount.atmerge/:

$ bzr merge ../pmount-autotools/
bzr: WARNING: Diff3 conflict encountered in /home/martin/src/pmount-head/./CHANGES
bzr: ERROR: Contents mismatch deleting /home/martin/src/pmount-head/./Makefile
  at /usr/lib/python2.4/site-packages/bzrlib/changeset.py line 1033, in wrong_old_contents()

the CHANGES warning is fine, I have to resolve a conflict; but the ERROR spoils the merge in two different ways: first, it is not helpful in the first place, and second it leaves the tree in an inconsistent state:

$ bzr status
removed:
  pmount-hal.1
  pmount-hal.c
  pmount.allow
  pumount.1
  pumount.c
modified:
  CHANGES
unknown:
  CHANGES.BASE
  CHANGES.OTHER
  CHANGES.THIS
  bzr-tree-change
conflicts:
  CHANGES

That means that quite a bunch of the source files have been removed, but they weren't created in the new location (etc/pmount.allow, or src/pmount.c) (these files have been moved in the autotools branch). The bzr-tree-change directory clutters up the working tree, and bzr revert fails:

p$ bzr revert
bzr: ERROR: bzr-tree-change contains files from a previous failed merge operation.
  at /usr/lib/python2.4/site-packages/bzrlib/changeset.py line 1094, in apply_changeset()

After manually removing the directory, bzr revert works better: it adds back the removed files and just leaves the CHANGES conflict laying around (which is still a bug, but sucks much less, and should be in a separate report).

I was able to work around this bug by manually removing Makefile before merging, BTW.

John A Meinel (jameinel)
Changed in bzr:
status: New → Fixed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.