file ids at the same path can be confusing when diff/merging

Bug #382340 reported by Bradley Baetz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Wishlist
Unassigned

Bug Description

Using bzr_loom v1.3, on Fedora 10 x86_64:

If an upper thread creates a new directory with a file, then a lower thread creates the same directory with a different, |bzr up-thread| will resolve the conflict by renaming the original directory. When the conflict is resolved, |bzr diff -r thread: dir/upper-file| will show *two* diffs, the first adding the file and the second removing it, even though the file still exists. This means that applying the diff will create and then delete the file, which is broken

To reproduce:

mkdir loom_test
cd loom_test
bzr init
# Need a checkin in the main branch else you hit bug 253476
echo bug > file
bzr add file
bzr ci -m 'First file'
# End bug workaround
bzr nick start
bzr loomify
bzr create-thread test1
mkdir dir
echo test > dir/topfile
bzr add dir
bzr ci -m 'add file to upper thread'
bzr down-thread
mkdir dir
echo test > dir/bottomfile
bzr add dir
bzr ci -m 'add file to bottom thread'
bzr up-thread
# Resolve conflicts
mv dir.moved/bottomfile dir
rmdir dir.moved
bzr add dir
bzr resolve dir
bzr ci -m 'Merge from down-thread'
cat dir/bottomfile
bzr diff -r thread: dir/bottomfile

Actual diff:
=== added file 'dir/bottomfile'
--- dir/bottomfile 1970-01-01 00:00:00 +0000
+++ dir/bottomfile 2009-06-01 08:48:50 +0000
@@ -0,0 +1,1 @@
+test

=== removed file 'dir/bottomfile'
--- dir/bottomfile 2009-06-01 08:48:51 +0000
+++ dir/bottomfile 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
-test

expected diff - just the first bit.

[bbaetz@plum src]$ bzr --version
Bazaar (bzr) 1.13.1
  Python interpreter: /usr/bin/python 2.5.2
  Python standard library: /usr/lib64/python2.5
  bzrlib: /usr/lib64/python2.5/site-packages/bzrlib
  Bazaar configuration: /home/bbaetz/.bazaar
  Bazaar log file: /home/bbaetz/.bzr.log

Copyright 2005, 2006, 2007, 2008, 2009 Canonical Ltd.
http://bazaar-vcs.org/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

Revision history for this message
Bradley Baetz (bbaetz) wrote :

Actually, the expected result is no output, since the top thread hasn't changed that file.

Revision history for this message
Bradley Baetz (bbaetz) wrote :

down-thread/commit/up-thread creates conflicts, too, presumably due to the mis-diff.

Revision history for this message
Robert Collins (lifeless) wrote :

The root cause here is bzr's fileid abstraction. I agree that its frustrating; you can avoid it by doing a merge -r thread:x..thread:y to cherrypick the new dir and file that you want down to the lower thread.

summary: - diff -r thread: mishandles resolved directory creation conflicts
+ file ids at the same path can be confusing when diff/merging
affects: bzr-loom → bzr
Changed in bzr:
importance: Undecided → Wishlist
status: New → Confirmed
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
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.