# HG changeset patch # User Benoit Boissinot # Date 1161793324 -7200 # Node ID 630e0b2161921d30a5936790774d071a02d6845d # Parent aa8f086cb14161667f230e7565464456f9c0799d fix graph traversal in commands.bundle (it wasn't O(n)) diff -r aa8f086cb141 -r 630e0b216192 mercurial/commands.py --- a/mercurial/commands.py Wed Oct 25 17:20:39 2006 +0200 +++ b/mercurial/commands.py Wed Oct 25 18:22:04 2006 +0200 @@ -839,6 +839,7 @@ visit = list(revs) else: visit = repo.changelog.heads() + seen = sets.Set(visit) while visit: n = visit.pop(0) parents = [p for p in repo.changelog.parents(n) @@ -846,7 +847,10 @@ if len(parents) == 0: o.insert(0, n) else: - visit.extend(parents) + for p in parents: + if p not in seen: + seen.add(p) + visit.append(p) else: setremoteconfig(ui, opts) dest = ui.expandpath(dest or 'default-push', dest or 'default')