Rev 5103: Make sure that we have initialized ourself before we return any content. in http://bzr.arbash-meinel.com/branches/bzr/lp/2.2.0b2-contained-pack
John Arbash Meinel
john at arbash-meinel.com
Mon Mar 8 22:12:52 GMT 2010
At http://bzr.arbash-meinel.com/branches/bzr/lp/2.2.0b2-contained-pack
------------------------------------------------------------
revno: 5103
revision-id: john at arbash-meinel.com-20100308221247-wvwnr61jkyimloir
parent: john at arbash-meinel.com-20100308220957-ula2lqzc7dtqkur8
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.2.0b2-contained-pack
timestamp: Mon 2010-03-08 16:12:47 -0600
message:
Make sure that we have initialized ourself before we return any content.
-------------- next part --------------
=== modified file 'bzrlib/pack_collection.py'
--- a/bzrlib/pack_collection.py 2010-03-08 22:09:57 +0000
+++ b/bzrlib/pack_collection.py 2010-03-08 22:12:47 +0000
@@ -332,6 +332,7 @@
def memos(self):
"""Return a list of (name, value) memo pairs."""
+ self._ensure_loaded()
return self._memos.items()
def save(self):
=== modified file 'bzrlib/tests/test_pack_collection.py'
--- a/bzrlib/tests/test_pack_collection.py 2010-03-08 22:09:57 +0000
+++ b/bzrlib/tests/test_pack_collection.py 2010-03-08 22:12:47 +0000
@@ -299,6 +299,12 @@
m_removed=[],
m_added=[])
+ def test_initial_memos(self):
+ self.tracker.add_memo(*self._m1)
+ self.tracker.save()
+ tracker2 = self.make_tracker()
+ self.assertEqual([self._m1], sorted(tracker2.memos()))
+
def test__diff_from_empty_disk(self):
self.tracker.add_memo(*self._m1)
self.assertDiffFromDisk(on_disk=[],
More information about the bazaar-commits
mailing list