# HG changeset patch # User Benoit Boissinot # Date 2006-10-25 16:22:04 # Node ID 630e0b2161921d30a5936790774d071a02d6845d # Parent aa8f086cb14161667f230e7565464456f9c0799d fix graph traversal in commands.bundle (it wasn't O(n)) diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -839,6 +839,7 @@ def bundle(ui, repo, fname, dest=None, * 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 @@ def bundle(ui, repo, fname, dest=None, * 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')