Mercurial > public > mercurial-scm > hg
diff mercurial/commands.py @ 3318:a225055b3b59
bundle --base: use the right set for the base
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Mon, 09 Oct 2006 15:44:20 +0200 |
parents | d89e98840b08 |
children | 80654c248793 |
line wrap: on
line diff
--- a/mercurial/commands.py Sat Oct 07 15:16:47 2006 -0400 +++ b/mercurial/commands.py Mon Oct 09 15:44:20 2006 +0200 @@ -789,16 +789,25 @@ if dest: raise util.Abort(_("--base is incompatible with specifiying " "a destination")) + base = [repo.lookup(rev) for rev in base] + # create the right base + # XXX: nodesbetween / changegroup* should be "fixed" instead o = [] + has_set = sets.Set(base) for n in base: - o.extend(repo.changelog.children(repo.lookup(n))) - # add common ancestor + has_set.update(repo.changelog.reachable(n)) if revs: - all = o + revs + visit = list(revs) else: - all = o + repo.changelog.heads() - ancestor = reduce(lambda a, b: repo.changelog.ancestor(a, b), all) - o.append(ancestor) + visit = repo.changelog.heads() + while visit: + n = visit.pop(0) + parents = [p for p in repo.changelog.parents(n) + if p != nullid and p not in has_set] + if len(parents) == 0: + o.insert(0, n) + else: + visit.extend(parents) else: setremoteconfig(ui, opts) dest = ui.expandpath(dest or 'default-push', dest or 'default')