Rev 4932: (mbp) Give RepositoryPackCollection a repr in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Jan 5 00:49:14 GMT 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4932 [merge]
revision-id: pqm at pqm.ubuntu.com-20100105004911-i582o8sqfqt7t7bn
parent: pqm at pqm.ubuntu.com-20100104191452-z3u6d1ce9dhyna6d
parent: mbp at sourcefrog.net-20100104065646-nyy2b7lq6lvbtkf5
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2010-01-05 00:49:11 +0000
message:
  (mbp) Give RepositoryPackCollection a repr
modified:
  bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
  bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py	2009-12-15 20:32:34 +0000
+++ b/bzrlib/repofmt/pack_repo.py	2010-01-04 06:56:46 +0000
@@ -1423,6 +1423,9 @@
         # resumed packs
         self._resumed_packs = []
 
+    def __repr__(self):
+        return '%s(%r)' % (self.__class__.__name__, self.repo)
+
     def add_pack_to_memory(self, pack):
         """Make a Pack object available to the repository to satisfy queries.
 

=== modified file 'bzrlib/tests/test_repository.py'
--- a/bzrlib/tests/test_repository.py	2009-12-03 20:05:29 +0000
+++ b/bzrlib/tests/test_repository.py	2010-01-04 06:56:46 +0000
@@ -1168,6 +1168,11 @@
         # check some arbitrary big numbers
         self.assertEqual(25, packs._max_pack_count(112894))
 
+    def test_repr(self):
+        packs = self.get_packs()
+        self.assertContainsRe(repr(packs),
+            'RepositoryPackCollection(.*Repository(.*))')
+
     def test_pack_distribution_zero(self):
         packs = self.get_packs()
         self.assertEqual([0], packs.pack_distribution(0))




More information about the bazaar-commits mailing list