Rev 6028: Add a __repr__ to _LazyListJoin to make it easier to debug. in http://bazaar.launchpad.net/~jameinel/bzr/2.4-add-LazyListRepr
John Arbash Meinel
john at arbash-meinel.com
Thu Aug 18 13:28:11 UTC 2011
At http://bazaar.launchpad.net/~jameinel/bzr/2.4-add-LazyListRepr
------------------------------------------------------------
revno: 6028
revision-id: john at arbash-meinel.com-20110818132718-b4rrujubsaa3evuz
parent: pqm at pqm.ubuntu.com-20110809201657-03q8kptf7tn1c9mw
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.4-add-LazyListRepr
timestamp: Thu 2011-08-18 15:27:18 +0200
message:
Add a __repr__ to _LazyListJoin to make it easier to debug.
-------------- next part --------------
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py 2011-06-30 11:14:06 +0000
+++ b/bzrlib/repository.py 2011-08-18 13:27:18 +0000
@@ -1901,3 +1901,7 @@
for list_part in self.list_parts:
full_list.extend(list_part)
return iter(full_list)
+
+ def __repr__(self):
+ return "%s.%s(%s)" % (self.__module__, self.__class__.__name__,
+ self.list_parts)
=== modified file 'bzrlib/tests/test_repository.py'
--- a/bzrlib/tests/test_repository.py 2011-05-26 08:05:45 +0000
+++ b/bzrlib/tests/test_repository.py 2011-08-18 13:27:18 +0000
@@ -1660,3 +1660,11 @@
def test_IDS_format_same_no(self):
# When the formats are the same, pack is not called.
self.run_fetch('2a', '2a', False)
+
+
+class Test_LazyListJoin(tests.TestCase):
+
+ def test__repr__(self):
+ lazy = repository._LazyListJoin(['a'], ['b'])
+ self.assertEqual("bzrlib.repository._LazyListJoin((['a'], ['b']))",
+ repr(lazy))
More information about the bazaar-commits
mailing list