Rev 5104: Fix a bug in how save() was working. 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:14:22 GMT 2010
At http://bzr.arbash-meinel.com/branches/bzr/lp/2.2.0b2-contained-pack
------------------------------------------------------------
revno: 5104
revision-id: john at arbash-meinel.com-20100308221417-j2kqfo8igf0mxkyo
parent: john at arbash-meinel.com-20100308221247-wvwnr61jkyimloir
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.2.0b2-contained-pack
timestamp: Mon 2010-03-08 16:14:17 -0600
message:
Fix a bug in how save() was working.
It was setting the wrong basis for last-read memos.
-------------- next part --------------
=== modified file 'bzrlib/pack_collection.py'
--- a/bzrlib/pack_collection.py 2010-03-08 22:12:47 +0000
+++ b/bzrlib/pack_collection.py 2010-03-08 22:14:17 +0000
@@ -342,9 +342,7 @@
(on_disk, active, d_removed, d_added, m_removed,
m_added) = self._diff_from_disk()
self.index_policy.write_index(active)
- # XXX: There is a bug here, test it. self._memos does not (yet)
- # match active
- self._last_read_memos = set(self._memos.iteritems())
+ self._last_read_memos = set(active)
# TODO: We probably need to either return this info, or trigger
# callbacks, etc so that higher level code can do something
# The pack_collection code did this via a helper
=== modified file 'bzrlib/tests/test_pack_collection.py'
--- a/bzrlib/tests/test_pack_collection.py 2010-03-08 22:12:47 +0000
+++ b/bzrlib/tests/test_pack_collection.py 2010-03-08 22:14:17 +0000
@@ -288,6 +288,8 @@
self.assertEqual([('removed', 'name1', 'content1'),
('added', 'name3', 'content3'),
], policy.log)
+ self.assertEqual([self._m2, self._m3],
+ sorted(self.tracker._last_read_memos))
def test__diff_from_disk_no_changes(self):
self.tracker.add_memo(*self._m1)
More information about the bazaar-commits
mailing list