Rev 2645: Fix bug #127115 by checking for self.other_rev_id being None in Merger.set_pending() in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Sat Jul 21 17:36:05 BST 2007


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 2645
revision-id: pqm at pqm.ubuntu.com-20070721163603-p17kh2wgzkhbef1d
parent: pqm at pqm.ubuntu.com-20070720233740-hjfxo6dx2ytwkros
parent: larstiq at larstiq.dyndns.org-20070721153237-rh7v5kz6rh3r2mza
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Sat 2007-07-21 17:36:03 +0100
message:
  Fix bug #127115 by checking for self.other_rev_id being None in Merger.set_pending()
modified:
  bzrlib/merge.py                merge.py-20050513021216-953b65a438527106
  bzrlib/tests/test_merge.py     testmerge.py-20050905070950-c1b5aa49ff911024
    ------------------------------------------------------------
    revno: 2644.1.2
    merged: larstiq at larstiq.dyndns.org-20070721153237-rh7v5kz6rh3r2mza
    parent: larstiq at larstiq.dyndns.org-20070721141117-ogghgpjyh02h8fri
    committer: Wouter van Heyst <larstiq at larstiq.dyndns.org>
    branch nick: bug-127115
    timestamp: Sat 2007-07-21 17:32:37 +0200
    message:
      As Aaron explained #127115 is more general, failing whenever other's basis is an ancestor of this' basis.
    ------------------------------------------------------------
    revno: 2644.1.1
    merged: larstiq at larstiq.dyndns.org-20070721141117-ogghgpjyh02h8fri
    parent: pqm at pqm.ubuntu.com-20070720233740-hjfxo6dx2ytwkros
    committer: Wouter van Heyst <larstiq at larstiq.dyndns.org>
    branch nick: bug-127115
    timestamp: Sat 2007-07-21 16:11:17 +0200
    message:
      Fix bug #127115 by checking for self.other_rev_id being None in Merger.set_pending()
=== modified file 'bzrlib/merge.py'
--- a/bzrlib/merge.py	2007-07-20 12:56:33 +0000
+++ b/bzrlib/merge.py	2007-07-21 14:11:17 +0000
@@ -164,7 +164,7 @@
         self.interesting_files = file_list
 
     def set_pending(self):
-        if not self.base_is_ancestor or not self.base_is_other_ancestor:
+        if not self.base_is_ancestor or not self.base_is_other_ancestor or self.other_rev_id is None:
             return
         self._add_parent()
 

=== modified file 'bzrlib/tests/test_merge.py'
--- a/bzrlib/tests/test_merge.py	2007-07-11 22:16:29 +0000
+++ b/bzrlib/tests/test_merge.py	2007-07-21 15:32:37 +0000
@@ -270,3 +270,15 @@
             tree_b.merge_from_branch(tree_a.branch)
         except AttributeError:
             self.fail('tried to join a path when name was None')
+
+    def test_merge_uncommitted_otherbasis_ancestor_of_thisbasis(self):
+        tree_a = self.make_branch_and_tree('a')
+        self.build_tree(['a/file_1', 'a/file_2'])
+        tree_a.add(['file_1'])
+        tree_a.commit('commit 1')
+        tree_a.add(['file_2'])
+        tree_a.commit('commit 2')
+        tree_b = tree_a.bzrdir.sprout('b').open_workingtree()
+        tree_b.rename_one('file_1', 'renamed')
+        _merge_helper(['b', None], ['b', -1], this_dir='a')
+        self.assertEqual(tree_a.get_parent_ids(), [tree_b.last_revision()])




More information about the bazaar-commits mailing list