[MERGE] Make 'missing' try the pushloc too

Matthew D. Fuller fullermd at over-yonder.net
Fri Apr 6 17:11:26 BST 2007


As it stands now, 'missing' will use the explicitly specified
location, or fall back to the parent if one isn't given, or fail.  It
should try the pushloc too, if neither of those get anywhere.
Attached.


-- 
Matthew Fuller     (MF4839)   |  fullermd at over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.
-------------- next part --------------
# Bazaar revision bundle v0.9
#
# message:
#   If 'missing' isn't given an explicit location to compare against, and
#   we don't have a 'parent' set, try the 'push' location too.  Don't set
#   'parent' to it, though, as we do an explicitly-specified location.
#   
# committer: Matthew Fuller <fullermd at over-yonder.net>
# date: Fri 2007-04-06 11:07:01.528000116 -0500

=== modified file bzrlib/builtins.py
--- bzrlib/builtins.py
+++ bzrlib/builtins.py
@@ -2838,12 +2838,17 @@
         local_branch = Branch.open_containing(u".")[0]
         parent = local_branch.get_parent()
         if other_branch is None:
+            hasother = False
             other_branch = parent
             if other_branch is None:
+                other_branch = local_branch.get_push_location()
+            if other_branch is None:
                 raise errors.BzrCommandError("No peer location known or specified.")
-            display_url = urlutils.unescape_for_display(parent,
+            display_url = urlutils.unescape_for_display(other_branch,
                                                         self.outf.encoding)
             print "Using last location: " + display_url
+        else:
+            hasother = True
 
         remote_branch = Branch.open(other_branch)
         if remote_branch.base == local_branch.base:
@@ -2886,7 +2891,7 @@
                 remote_branch.unlock()
         finally:
             local_branch.unlock()
-        if not status_code and parent is None and other_branch is not None:
+        if not status_code and parent is None and hasother is True:
             local_branch.lock_write()
             try:
                 # handle race conditions - a parent might be set while we run.

=== modified directory  // last-changed:fullermd at over-yonder.net-20070406160701
... -v0uovgi44ob5jeg7
# revision id: fullermd at over-yonder.net-20070406160701-v0uovgi44ob5jeg7
# sha1: 9e82539ca14819fb0430b7bda29aedfab7a4c73f
# inventory sha1: 7354971df11c2052177deaa7292ca77ed864256a
# parent ids:
#   pqm at pqm.ubuntu.com-20070405073143-8fa894c829ab5e50
# base id: pqm at pqm.ubuntu.com-20070405073143-8fa894c829ab5e50
# properties:
#   branch-nick: missing-location



More information about the bazaar mailing list