[Pkg-bazaar-commits] ./bzr-builddeb/trunk r336: Merge patch to use existing helper for opening tree and/or branch.

Jelmer Vernooij jelmer at samba.org
Wed Apr 15 15:24:40 UTC 2009


------------------------------------------------------------
revno: 336
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Wed 2009-04-15 17:24:40 +0200
message:
  Merge patch to use existing helper for opening tree and/or branch.
modified:
  cmds.py
    ------------------------------------------------------------
    revno: 334.1.1
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Wed 2009-04-15 13:50:06 +0200
    message:
      Use existing helper function for opening tree or branch.
    modified:
      cmds.py
-------------- next part --------------
=== modified file 'cmds.py'
--- a/cmds.py	2009-03-04 13:05:56 +0000
+++ b/cmds.py	2009-04-15 11:50:06 +0000
@@ -34,6 +34,7 @@
     urlutils,
     )
 from bzrlib.branch import Branch
+from bzrlib.bzrdir import BzrDir
 from bzrlib.commands import Command
 from bzrlib.errors import (BzrCommandError,
                            NoWorkingTree,
@@ -208,12 +209,7 @@
         is_local = urlparse.urlsplit(location)[0] in ('', 'file')
         if is_local:
             os.chdir(location)
-        try:
-            tree, _ = WorkingTree.open_containing(location)
-            branch = tree.branch
-        except NoWorkingTree:
-            tree = None
-            branch, _ = Branch.open_containing(location)
+        tree, branch, relpath = BzrDir.open_containing_tree_or_branch(location)
         return tree, branch, is_local
 
     def _get_build_tree(self, revision, tree, branch):



More information about the Pkg-bazaar-commits mailing list