Rev 3524: Injecting a 'dummy' revision fixes both problems, not sure if it is 100% correct in http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/lazy_revno
John Arbash Meinel
john at arbash-meinel.com
Thu Aug 7 19:34:26 BST 2008
At http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/lazy_revno
------------------------------------------------------------
revno: 3524
revision-id: john at arbash-meinel.com-20080807183418-z59a9gjc2ivs6hyi
parent: john at arbash-meinel.com-20080807182834-ky8vkhkhhpifu7ue
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: lazy_revno
timestamp: Thu 2008-08-07 13:34:18 -0500
message:
Injecting a 'dummy' revision fixes both problems, not sure if it is 100% correct
-------------- next part --------------
=== modified file 'bzrlib/graph.py'
--- a/bzrlib/graph.py 2008-08-07 17:49:56 +0000
+++ b/bzrlib/graph.py 2008-08-07 18:34:18 +0000
@@ -2004,6 +2004,7 @@
# TODO: We might also want to _prune_tails (from bzrlib.merge),
# to remove more nodes that don't effect our numbering, and whose
# numbers we cannot trust.
+ dummy = 'THIS_IS_A_DUMMY_REVISION'
def cull_parent_map():
culled_parent_map = {}
for revision_id, parent_ids in interesting_parent_map.iteritems():
@@ -2018,11 +2019,15 @@
# The left-hand ancestor is not interesting, so we just
# pretend this is a ghost, it shouldn't effect
# numbering (maybe)
- culled_parent_map[revision_id] = ()
+ culled_parent_map[dummy] = ()
+ culled_parent_ids = [dummy]
+ culled_parent_ids.extend(
+ [p for p in parent_ids
+ if p in interesting_parent_map])
else:
- culled_parent_ids = tuple([p for p in parent_ids
- if p in interesting_parent_map])
- culled_parent_map[revision_id] = culled_parent_ids
+ culled_parent_ids = [p for p in parent_ids
+ if p in interesting_parent_map]
+ culled_parent_map[revision_id] = tuple(culled_parent_ids)
return culled_parent_map
return cull_parent_map()
More information about the bazaar-commits
mailing list