[RFC][MERGE] Show parent location in bzr info

Olaf Conradi olaf at conradi.org
Wed Mar 15 15:04:35 GMT 2006


Hello,

First time hacking on bzr, so please review :)

Patch with NEWS entry is mergable from:

http://deschacht.student.utwente.nl/bzr/branches/bzr.olaf/
revision 1587

Cheers
 -Olaf

Relevent change in info.py is:

=== modified file 'a/bzrlib/info.py'
--- a/bzrlib/info.py
+++ b/bzrlib/info.py
@@ -166,3 +166,9 @@
 #     print '  %8d inventories' % c
 #     print '  %8d kB' % (t/1024)

+    loc = b.get_parent()
+    if loc is not None:
+        print
+        print 'parent location:'
+        print '  %s' % loc
+

Test case is:

=== modified file 'a/bzrlib/tests/blackbox/test_info.py'
--- a/bzrlib/tests/blackbox/test_info.py
+++ b/bzrlib/tests/blackbox/test_info.py
@@ -238,3 +238,35 @@
        ),
             out)
         self.assertEqual('', err)
+
+    def test_info_parent(self):
+        b = self.make_branch('.')
+        url = 'http://bazaar-vcs.org/bzr/bzr.dev/'
+        b.set_parent(url)
+        out,err = self.runbzr('info')
+        self.assertEqualDiff(
+"""branch format: Bazaar-NG branch, format 6
+
+in the working tree:
+         0 unchanged
+         0 modified
+         0 added
+         0 removed
+         0 renamed
+         0 unknown
+         0 ignored
+         0 versioned subdirectories
+
+branch history:
+         0 revisions
+         0 committers
+
+revision store:
+         0 revisions
+         0 kB
+
+parent location:
+  http://bazaar-vcs.org/bzr/bzr.dev/
+""", out)
+        self.assertEqual('', err)
+

Thats it.

Comments welcome,
 -Olaf




More information about the bazaar mailing list