Rev 55: now we're back to the failures I was expecting. in http://bzr.arbash-meinel.com/plugins/history_db
John Arbash Meinel
john at arbash-meinel.com
Wed Apr 7 19:40:20 BST 2010
At http://bzr.arbash-meinel.com/plugins/history_db
------------------------------------------------------------
revno: 55
revision-id: john at arbash-meinel.com-20100407184004-t3x5mjd1j1qxp4x2
parent: john at arbash-meinel.com-20100407165123-4xtc83jnxid0q9yn
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: history_db
timestamp: Wed 2010-04-07 13:40:04 -0500
message:
now we're back to the failures I was expecting.
We need to page in more information to get these tests to pass.
-------------- next part --------------
=== modified file 'history_db.py'
--- a/history_db.py 2010-04-07 16:51:23 +0000
+++ b/history_db.py 2010-04-07 18:40:04 +0000
@@ -684,7 +684,6 @@
def _find_interesting_ancestry(self):
self._find_needed_mainline()
self._get_initial_search_tips()
- self._step_mainline()
while self._search_tips:
# We don't know whether these search tips are known interesting, or
# known uninteresting
=== modified file 'test_importer.py'
--- a/test_importer.py 2010-04-07 16:51:23 +0000
+++ b/test_importer.py 2010-04-07 18:40:04 +0000
@@ -430,3 +430,33 @@
inc_importer._compute_merge_sort()
self.assertEqual([(self.B_id, (2,), False, 0),
], inc_importer._scheduled_stack)
+
+ def test__incremental_merge_sort_handles_multi_roots(self):
+ # Graph:
+ # A B
+ # |/
+ # C
+ # |
+ # D E
+ # |/
+ # F
+ # Since D is already imported, the incremental importer will only see
+ # E. However, we have to load everything, so that we can get the
+ # numbering for a 0-based rev correct.
+ ancestry = {'A': (), 'B': (), 'C': ('A', 'B'), 'D': ('C',), 'E': (),
+ 'F': ('D', 'E')}
+ b = MockBranch(ancestry, 'D')
+ importer = history_db.Importer(':memory:', b, incremental=False)
+ importer.do_import()
+ importer._update_ancestry('F')
+ self.grab_interesting_ids(importer._rev_id_to_db_id)
+ inc_importer = history_db._IncrementalImporter(importer, self.F_id)
+ inc_importer._find_interesting_ancestry()
+ self.assertEqual(self.C_id, inc_importer._imported_mainline_id)
+ self.assertEqual(set([self.E_id, self.F_id]),
+ inc_importer._interesting_ancestor_ids)
+ inc_importer._update_info_from_dotted_revno()
+ inc_importer._compute_merge_sort()
+ self.assertEqual([(self.E_id, (0, 2, 1), True, 1),
+ (self.F_id, (4,), False, 0),
+ ], inc_importer._scheduled_stack)
More information about the bazaar-commits
mailing list