Rev 6244: (jelmer) Fix WorkingTree.pull(stop_revision='null:', in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

Patch Queue Manager pqm at pqm.ubuntu.com
Tue Nov 8 13:46:27 UTC 2011


At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 6244 [merge]
revision-id: pqm at pqm.ubuntu.com-20111108134627-frw63i8mjehg2lic
parent: pqm at pqm.ubuntu.com-20111107184325-e5u0eqepo588s0uh
parent: jelmer at samba.org-20111108124900-ove5ivq86bql77yt
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2011-11-08 13:46:27 +0000
message:
  (jelmer) Fix WorkingTree.pull(stop_revision='null:',
   overwrite=True). (Jelmer Vernooij)
modified:
  bzrlib/tests/per_workingtree/test_pull.py test_pull.py-20060222044334-43594dd8e143b708
  bzrlib/tests/per_workingtree/test_workingtree.py test_workingtree.py-20060203003124-817757d3e31444fb
  bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
  doc/en/release-notes/bzr-2.5.txt bzr2.5.txt-20110708125756-587p0hpw7oke4h05-1
=== modified file 'bzrlib/tests/per_workingtree/test_pull.py'
--- a/bzrlib/tests/per_workingtree/test_pull.py	2011-09-26 15:21:01 +0000
+++ b/bzrlib/tests/per_workingtree/test_pull.py	2011-11-08 12:49:00 +0000
@@ -17,6 +17,7 @@
 
 
 from bzrlib import tests
+from bzrlib.revision import NULL_REVISION
 from bzrlib.tests import per_workingtree
 
 
@@ -30,6 +31,12 @@
         tree_b = self.make_branch_and_tree('to')
         return tree, tree_b
 
+    def test_pull_null(self):
+        tree_a, tree_b = self.get_pullable_trees()
+        root_id = tree_a.get_root_id()
+        tree_a.pull(tree_b.branch, stop_revision=NULL_REVISION, overwrite=True)
+        self.assertEquals(root_id, tree_a.get_root_id())
+
     def test_pull(self):
         tree_a, tree_b = self.get_pullable_trees()
         tree_b.pull(tree_a.branch)

=== modified file 'bzrlib/tests/per_workingtree/test_workingtree.py'
--- a/bzrlib/tests/per_workingtree/test_workingtree.py	2011-09-27 11:35:00 +0000
+++ b/bzrlib/tests/per_workingtree/test_workingtree.py	2011-11-08 12:49:00 +0000
@@ -22,7 +22,6 @@
 
 from bzrlib import (
     branch,
-    branchbuilder,
     bzrdir,
     config,
     errors,

=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py	2011-10-13 16:30:39 +0000
+++ b/bzrlib/workingtree.py	2011-11-08 12:49:00 +0000
@@ -1004,14 +1004,17 @@
                                 show_base=show_base)
                     basis_root_id = basis_tree.get_root_id()
                     new_root_id = new_basis_tree.get_root_id()
-                    if basis_root_id != new_root_id:
+                    if new_root_id is not None and basis_root_id != new_root_id:
                         self.set_root_id(new_root_id)
                 finally:
                     basis_tree.unlock()
                 # TODO - dedup parents list with things merged by pull ?
                 # reuse the revisiontree we merged against to set the new
                 # tree data.
-                parent_trees = [(self.branch.last_revision(), new_basis_tree)]
+                parent_trees = []
+                if self.branch.last_revision() != _mod_revision.NULL_REVISION:
+                    parent_trees.append(
+                        (self.branch.last_revision(), new_basis_tree))
                 # we have to pull the merge trees out again, because
                 # merge_inner has set the ids. - this corner is not yet
                 # layered well enough to prevent double handling.

=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt	2011-11-07 15:08:19 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt	2011-11-08 12:49:00 +0000
@@ -196,6 +196,9 @@
 Bug Fixes
 *********
 
+* ``WorkingTree.pull`` can now pull ``NULL_REVISION``.
+  (Jelmer Vernooij, #887556)
+
 * ``bzr shelve`` can now be used in emacs shells as the input handling is
   turned into a line-based one when ``INSIDE_EMACS`` is set (which is the
   case for all recent emacs versions). (Vincent Ladeuil, #856261)




More information about the bazaar-commits mailing list