Merge branch 'tr/test-commit-only-on-orphan' into maint
[gitweb.git] / contrib / remote-helpers / git-remote-bzr
index ad42317ca095c960f5a8d87aee768d9690ef6eaa..10300c63d1a71aecd0f8d2273d276f36773e6b1e 100755 (executable)
@@ -31,6 +31,7 @@ import bzrlib.transport
 import bzrlib.errors
 import bzrlib.ui
 import bzrlib.urlutils
+import bzrlib.branch
 
 import sys
 import os
@@ -788,7 +789,7 @@ def get_remote_branch(origin, remote_branch, name):
     return branch
 
 def find_branches(repo, wanted):
-    transport = repo.user_transport
+    transport = repo.bzrdir.root_transport
 
     for fn in transport.iter_files_recursive():
         if not fn.endswith('.bzr/branch-format'):
@@ -837,6 +838,8 @@ def get_repo(url, alias):
                 bdir.destroy_repository()
             except bzrlib.errors.NotBranchError:
                 pass
+            except bzrlib.errors.NoRepositoryPresent:
+                pass
 
     try:
         repo = origin.open_repository()
@@ -922,7 +925,8 @@ def main(args):
     if not os.path.exists(dirname):
         os.makedirs(dirname)
 
-    bzrlib.ui.ui_factory.be_quiet(True)
+    if hasattr(bzrlib.ui.ui_factory, 'be_quiet'):
+        bzrlib.ui.ui_factory.be_quiet(True)
 
     repo = get_repo(url, alias)