Rev 5654: (vila) Merge 2.2 into 2.3 (Vincent Ladeuil) in file:///home/pqm/archives/thelove/bzr/2.3/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Tue Jul 5 15:12:57 UTC 2011
At file:///home/pqm/archives/thelove/bzr/2.3/
------------------------------------------------------------
revno: 5654 [merge]
revision-id: pqm at pqm.ubuntu.com-20110705151251-60kw6nvqe5mkqmli
parent: pqm at pqm.ubuntu.com-20110616190826-cle8ddundgi92954
parent: v.ladeuil+lp at free.fr-20110705140457-9agcbfskn9b077bs
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.3
timestamp: Tue 2011-07-05 15:12:51 +0000
message:
(vila) Merge 2.2 into 2.3 (Vincent Ladeuil)
modified:
bzrlib/merge.py merge.py-20050513021216-953b65a438527106
bzrlib/tests/test_conflicts.py test_conflicts.py-20051006031059-e2dad9bbeaa5891f
doc/en/release-notes/bzr-2.2.txt bzr2.2.txt-20101008081016-21wd86gpfhllpue3-39
=== modified file 'bzrlib/merge.py'
--- a/bzrlib/merge.py 2010-11-18 08:22:54 +0000
+++ b/bzrlib/merge.py 2011-07-05 11:54:54 +0000
@@ -1619,8 +1619,14 @@
if other_parent is None or other_name is None:
other_path = '<deleted>'
else:
- parent_path = fp.get_path(
- self.tt.trans_id_file_id(other_parent))
+ if other_parent == self.other_tree.get_root_id():
+ # The tree transform doesn't know about the other root,
+ # so we special case here to avoid a NoFinalPath
+ # exception
+ parent_path = ''
+ else:
+ parent_path = fp.get_path(
+ self.tt.trans_id_file_id(other_parent))
other_path = osutils.pathjoin(parent_path, other_name)
c = _mod_conflicts.Conflict.factory(
'path conflict', path=this_path,
=== modified file 'bzrlib/tests/test_conflicts.py'
--- a/bzrlib/tests/test_conflicts.py 2011-05-13 11:34:44 +0000
+++ b/bzrlib/tests/test_conflicts.py 2011-07-05 14:04:57 +0000
@@ -1051,6 +1051,72 @@
""")
+class TestNoFinalPath(script.TestCaseWithTransportAndScript):
+
+ def test_bug_805809(self):
+ self.run_script("""
+$ bzr init trunk
+Created a standalone tree (format: 2a)
+$ cd trunk
+$ echo trunk >file
+$ bzr add
+adding file
+$ bzr commit -m 'create file on trunk'
+2>Committing to: .../trunk/
+2>added file
+2>Committed revision 1.
+# Create a debian branch based on trunk
+$ cd ..
+$ bzr branch trunk -r 1 debian
+2>Branched 1 revision(s).
+$ cd debian
+$ mkdir dir
+$ bzr add
+adding dir
+$ bzr mv file dir
+file => dir/file
+$ bzr commit -m 'rename file to dir/file for debian'
+2>Committing to: .../debian/
+2>added dir
+2>renamed file => dir/file
+2>Committed revision 2.
+# Create an experimental branch with a new root-id
+$ cd ..
+$ bzr init experimental
+Created a standalone tree (format: 2a)
+$ cd experimental
+# merge debian even without a common ancestor
+$ bzr merge ../debian -r0..2
+2>+N dir/
+2>+N dir/file
+2>All changes applied successfully.
+$ bzr commit -m 'merging debian into experimental'
+2>Committing to: .../experimental/
+2>deleted
+2>modified dir
+2>Committed revision 1.
+# Create an ubuntu branch with yet another root-id
+$ cd ..
+$ bzr init ubuntu
+Created a standalone tree (format: 2a)
+$ cd ubuntu
+# Also merge debian
+$ bzr merge ../debian -r0..2
+2>+N dir/
+2>+N dir/file
+2>All changes applied successfully.
+$ bzr commit -m 'merging debian'
+2>Committing to: .../ubuntu/
+2>deleted
+2>modified dir
+2>Committed revision 1.
+# Now try to merge experimental
+$ bzr merge ../experimental
+2>Path conflict: dir / dir
+2>1 conflicts encountered.
+""")
+
+
class TestResolveActionOption(tests.TestCase):
def setUp(self):
=== modified file 'doc/en/release-notes/bzr-2.2.txt'
--- a/doc/en/release-notes/bzr-2.2.txt 2011-03-10 11:05:08 +0000
+++ b/doc/en/release-notes/bzr-2.2.txt 2011-07-05 11:54:54 +0000
@@ -24,6 +24,9 @@
doubly-stacked branch.
(James Westby, Martin Pool, #715000)
+* Don't crash while merging and encountering obscure path conflicts
+ involving different root-ids. (Vincent Ladeuil, #805809)
+
Improvements
************
More information about the bazaar-commits
mailing list