[MERGE] Show info on standalone branches without working tree

Olaf Conradi olaf at conradi.org
Thu May 11 10:50:02 BST 2006


Hi

This fixes https://launchpad.net/products/bzr/+bug/44155

The previously mentioned fix for format upgrade in the test case,
https://lists.ubuntu.com/archives/bazaar-ng/2006q2/011714.html
(not shown in this patch, is in branch).

Please merge again from:
http://deschacht.student.utwente.nl/bzr/bazaar-vcs/bzr.olaf.info/

Cheers
 -Olaf

-------------- next part --------------
=== modified file 'NEWS'
--- NEWS	
+++ NEWS	
@@ -1,3 +1,9 @@
+bzr development version
+
+  IMPROVEMENTS:
+
+    * Add info on standalone branches without a working tree.  (Olaf Conradi)
+
 bzr 0.8  2006-05-08
 
   NOTES WHEN UPGRADING:

=== modified file 'bzrlib/info.py'
--- bzrlib/info.py	
+++ bzrlib/info.py	
@@ -85,12 +85,15 @@
             # standalone
             print '  branch root: %s' % working_path
     elif branch:
-        # branch is part of shared repository
-        assert repository.is_shared()
         branch_path = branch.bzrdir.root_transport.base
-        print '  shared repository: %s' % repository_path
-        print '  repository branch: %s' % (
-            _repo_relpath(repository_path, branch_path))
+        if repository.is_shared():
+            # branch is part of shared repository
+            print '  shared repository: %s' % repository_path
+            print '  repository branch: %s' % (
+                _repo_relpath(repository_path, branch_path))
+        else:
+            # standalone branch
+            print '  branch root: %s' % branch_path
     else:
         # shared repository
         assert repository.is_shared()

=== modified file 'bzrlib/tests/blackbox/test_info.py'
--- bzrlib/tests/blackbox/test_info.py	
+++ bzrlib/tests/blackbox/test_info.py	
@@ -457,6 +457,31 @@
 """ % (tree5.bzrdir.root_transport.base,
        branch1.bzrdir.root_transport.base,
        datestring_first, datestring_last,
+       ), out)
+        self.assertEqual('', err)
+
+    def test_info_standalone_no_tree(self):
+        # create standalone branch without a working tree
+        branch = self.make_branch('branch')
+        repo = branch.repository
+        out, err = self.runbzr('info branch')
+        self.assertEqualDiff(
+"""Location:
+  branch root: %s
+
+Format:
+       control: Meta directory format 1
+        branch: Branch format 5
+    repository: %s
+
+Branch history:
+         0 revisions
+
+Revision store:
+         0 revisions
+         0 KiB
+""" % (branch.bzrdir.root_transport.base,
+       repo._format.get_format_description(),
        ), out)
         self.assertEqual('', err)
 



More information about the bazaar mailing list