Rev 3483: Fix bug #238149, RemoteBranch.pull needs to return the _real_branch's pull result. in http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/pull_traceback_238149

John Arbash Meinel john at arbash-meinel.com
Sat Jun 7 23:16:03 BST 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/pull_traceback_238149

------------------------------------------------------------
revno: 3483
revision-id: john at arbash-meinel.com-20080607221525-jfarlas0hrdt3r9m
parent: pqm at pqm.ubuntu.com-20080606135624-1ambbf8pct52xfh8
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: pull_traceback_238149
timestamp: Sat 2008-06-07 17:15:25 -0500
message:
  Fix bug #238149, RemoteBranch.pull needs to return the _real_branch's pull result.
  
  The test won't actually test the fix until bug #238227 is closed.
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2008-06-06 12:02:48 +0000
+++ b/NEWS	2008-06-07 22:15:25 +0000
@@ -19,6 +19,10 @@
       end of line, causing a knit snapshot in a 'knits' repository will no longer
       cause KnitCorrupt. (Robert Collins)
 
+    * ``RemoteBranch.pull`` needs to return the ``self._real_branch``'s
+      pull result. It was instead just returning None, which breaks ``bzr
+      pull``. (John Arbash Meinel, #238149)
+
     * Sanitize branch nick before using it as an attachment filename in
       ``bzr send``. (Luk???? Lalinsk??, #210218)
 

=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py	2008-06-04 17:42:15 +0000
+++ b/bzrlib/branch.py	2008-06-07 22:15:25 +0000
@@ -2140,8 +2140,11 @@
     :ivar old_revid: Tip revision id before pull.
     :ivar new_revid: Tip revision id after pull.
     :ivar source_branch: Source (local) branch object.
-    :ivar master_branch: Master branch of the target, or None.
+    :ivar master_branch: Master branch of the target, or the target if no
+        Master
+    :ivar local_branch: target branch if there is a Master, else None
     :ivar target_branch: Target/destination branch object.
+    :ivar tag_conflicts: A list of tag conflicts, see BasicTags.merge_to
     """
 
     def __int__(self):

=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py	2008-06-04 07:29:35 +0000
+++ b/bzrlib/remote.py	2008-06-07 22:15:25 +0000
@@ -1516,7 +1516,7 @@
         # fixed.  It should get a _override_hook_target branch,
         # as push does.  -- mbp 20070405
         self._ensure_real()
-        self._real_branch.pull(
+        return self._real_branch.pull(
             source, overwrite=overwrite, stop_revision=stop_revision,
             **kwargs)
 

=== modified file 'bzrlib/tag.py'
--- a/bzrlib/tag.py	2007-09-18 18:55:00 +0000
+++ b/bzrlib/tag.py	2008-06-07 22:15:25 +0000
@@ -196,7 +196,8 @@
         :param overwrite: Overwrite conflicting tags in the target branch
 
         :returns: A list of tags that conflicted, each of which is 
-            (tagname, source_target, dest_target).
+            (tagname, source_target, dest_target), or None if no copying was
+            done.
         """
         if self.branch == to_tags.branch:
             return

=== modified file 'bzrlib/tests/branch_implementations/test_pull.py'
--- a/bzrlib/tests/branch_implementations/test_pull.py	2008-03-10 13:37:31 +0000
+++ b/bzrlib/tests/branch_implementations/test_pull.py	2008-06-07 22:15:25 +0000
@@ -81,6 +81,24 @@
         self.assertRaises(errors.BoundBranchConnectionFailure,
                 checkout.branch.pull, other.branch)
 
+    def test_pull_returns_result(self):
+        import pdb; pdb.set_trace()
+        parent = self.make_branch_and_tree('parent')
+        parent.commit('1st post', rev_id='P1')
+        mine = parent.bzrdir.sprout('mine').open_workingtree()
+        mine.commit('my change', rev_id='M1')
+        result = parent.branch.pull(mine.branch)
+        self.assertIsNot(None, result)
+        self.assertIs(mine.branch, result.source_branch)
+        self.assertIs(parent.branch, result.target_branch)
+        self.assertIs(parent.branch, result.master_branch)
+        self.assertIs(None, result.local_branch)
+        self.assertEqual(1, result.old_revno)
+        self.assertEqual('P1', result.old_revid)
+        self.assertEqual(2, result.new_revno)
+        self.assertEqual('M1', result.new_revid)
+        self.assertEqual(None, result.tag_conflicts)
+
     def test_pull_overwrite(self):
         tree_a = self.make_branch_and_tree('tree_a')
         tree_a.commit('message 1')



More information about the bazaar-commits mailing list