Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 14213:30273f0c776b
discovery: resurrect findoutgoing as findcommonoutgoing for extension hooks
discovery.findoutgoing used to be a useful hook for extensions like
hgsubversion. This patch reintroduces this version of findcommonincoming
which is meant to be used when computing outgoing changesets.
author | Peter Arrenbrecht <peter.arrenbrecht@gmail.com> |
---|---|
date | Fri, 06 May 2011 14:44:18 +0200 |
parents | 8f11fd321014 |
children | c5db85676c38 |
line wrap: on
line diff
--- a/mercurial/commands.py Fri May 06 16:00:48 2011 +0300 +++ b/mercurial/commands.py Fri May 06 14:44:18 2011 +0200 @@ -702,16 +702,18 @@ raise util.Abort(_("--base is incompatible with specifying " "a destination")) common = [repo.lookup(rev) for rev in base] + heads = revs and map(repo.lookup, revs) or revs else: dest = ui.expandpath(dest or 'default-push', dest or 'default') dest, branches = hg.parseurl(dest, opts.get('branch')) other = hg.repository(hg.remoteui(repo, opts), dest) revs, checkout = hg.addbranchrevs(repo, other, branches, revs) - inc = discovery.findcommonincoming(repo, other, force=opts.get('force')) - common, _anyinc, _heads = inc - - nodes = revs and map(repo.lookup, revs) or revs - cg = repo.getbundle('bundle', common=common, heads=nodes) + heads = revs and map(repo.lookup, revs) or revs + common, outheads = discovery.findcommonoutgoing(repo, other, + onlyheads=heads, + force=opts.get('force')) + + cg = repo.getbundle('bundle', common=common, heads=heads) if not cg: ui.status(_("no changes found\n")) return 1 @@ -4024,9 +4026,9 @@ other = hg.repository(hg.remoteui(repo, {}), dest) ui.debug('comparing with %s\n' % util.hidepassword(dest)) repo.ui.pushbuffer() - common, _anyinc, _heads = discovery.findcommonincoming(repo, other) + common, outheads = discovery.findcommonoutgoing(repo, other) repo.ui.popbuffer() - o = repo.changelog.findmissing(common=common) + o = repo.changelog.findmissing(common=common, heads=outheads) if o: t.append(_('%d outgoing') % len(o)) if 'bookmarks' in other.listkeys('namespaces'):