[Pkg-bazaar-commits] ./bzr/unstable r671: - Don't create an empty destination directory when

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:20:39 UTC 2009


------------------------------------------------------------
revno: 671
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Sat 2005-06-11 11:36:09 +1000
message:
  - Don't create an empty destination directory when 
    branch fails to open the source.
    Fix from aaron.
modified:
  bzrlib/commands.py
-------------- next part --------------
=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py	2005-06-10 02:21:14 +0000
+++ b/bzrlib/commands.py	2005-06-11 01:36:09 +0000
@@ -526,7 +526,16 @@
     def run(self, from_location, to_location=None):
         import errno
         from bzrlib.merge import merge
-        
+        from branch import find_branch, DivergedBranches
+        try:
+            br_from = find_branch(from_location)
+        except OSError, e:
+            if e.errno == errno.ENOENT:
+                raise BzrCommandError('Source location "%s" does not exist.' %
+                                      to_location)
+            else:
+                raise
+
         if to_location is None:
             to_location = os.path.basename(from_location)
             # FIXME: If there's a trailing slash, keep removing them
@@ -544,15 +553,6 @@
             else:
                 raise
         br_to = Branch(to_location, init=True)
-        from branch import find_branch, DivergedBranches
-        try:
-            br_from = find_branch(from_location)
-        except OSError, e:
-            if e.errno == errno.ENOENT:
-                raise BzrCommandError('Source location "%s" does not exist.' %
-                                      to_location)
-            else:
-                raise
 
         from_location = pull_loc(br_from)
         br_to.update_revisions(br_from)



More information about the Pkg-bazaar-commits mailing list