Rev 2478: Add RemoteBranch repr in http://sourcefrog.net/bzr/run-hooks

Martin Pool mbp at sourcefrog.net
Thu May 3 09:00:01 BST 2007


At http://sourcefrog.net/bzr/run-hooks

------------------------------------------------------------
revno: 2478
revision-id: mbp at sourcefrog.net-20070503080000-joirold1vv0dndgs
parent: pqm at pqm.ubuntu.com-20070503064943-wh3ls1tw3q2awye0
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: run-hooks
timestamp: Thu 2007-05-03 18:00:00 +1000
message:
  Add RemoteBranch repr
modified:
  bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
  bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py	2007-04-26 09:07:38 +0000
+++ b/bzrlib/remote.py	2007-05-03 08:00:00 +0000
@@ -764,6 +764,11 @@
         self._lock_count = 0
         self._leave_lock = False
 
+    def __str__(self):
+        return "%s(%s)" % (self.__class__.__name__, self.base)
+
+    __repr__ = __str__
+
     def _ensure_real(self):
         """Ensure that there is a _real_branch set.
 

=== modified file 'bzrlib/tests/test_remote.py'
--- a/bzrlib/tests/test_remote.py	2007-04-30 02:04:06 +0000
+++ b/bzrlib/tests/test_remote.py	2007-05-03 08:00:00 +0000
@@ -98,6 +98,10 @@
         d = fmt.open(self.transport)
         self.assertIsInstance(d, BzrDir)
 
+    def test_remote_branch_repr(self):
+        b = BzrDir.open_from_transport(self.transport).open_branch()
+        self.assertStartsWith(str(b), 'RemoteBranch(')
+
 
 class FakeProtocol(object):
     """Lookalike SmartClientRequestProtocolOne allowing body reading tests."""




More information about the bazaar-commits mailing list