--- 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')