Rev 127: Use standard graph functions. in file:///home/jelmer/bzr-rebase/trunk/
Jelmer Vernooij
jelmer at samba.org
Fri Feb 13 03:56:24 GMT 2009
At file:///home/jelmer/bzr-rebase/trunk/
------------------------------------------------------------
revno: 127
revision-id: jelmer at samba.org-20090213035623-o3q3plyq4fk5fs0z
parent: jelmer at samba.org-20090213034408-m7yetq1i3hbr1hmm
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Fri 2009-02-13 04:56:23 +0100
message:
Use standard graph functions.
modified:
rebase.py rebase.py-20070626221123-ellanmf93nw8z9r1-1
=== modified file 'rebase.py'
--- a/rebase.py 2009-02-13 03:44:08 +0000
+++ b/rebase.py 2009-02-13 03:56:23 +0000
@@ -290,21 +290,13 @@
:param replace_map: Dictionary with revisions to (optionally) rewrite
:param merge_fn: Function for replaying a revision
"""
- todo = list(rebase_todo(repository, replace_map))
- dependencies = {}
-
# Figure out the dependencies
- graph = {}
- for revid in todo:
- graph[revid] = replace_map[revid][1]
-
- total = len(todo)
- i = 0
+ graph = repository.get_graph()
+ todo = list(graph.iter_topo_order(replace_map.keys()))
pb = ui.ui_factory.nested_progress_bar()
try:
- for revid in topo_sort(graph):
- pb.update('rebase revisions', i, total)
- i += 1
+ for i, revid in enumerate(todo):
+ pb.update('rebase revisions', i, len(todo))
(newrevid, newparents) = replace_map[revid]
assert isinstance(newparents, tuple), "Expected tuple for %r" % newparents
if repository.has_revision(newrevid):
More information about the bazaar-commits
mailing list