# HG changeset patch # User Peter Arrenbrecht # Date 1304685913 -7200 # Node ID c5db85676c38893831b5cf025be8007943c3ca60 # Parent 30273f0c776bd106d47adadcd56fef517b4f2f72 summary: run discovery only once for in/out against same repo Reuses the result of findcommonincoming if default and default-push are the same. diff -r 30273f0c776b -r c5db85676c38 mercurial/commands.py --- a/mercurial/commands.py Fri May 06 14:44:18 2011 +0200 +++ b/mercurial/commands.py Fri May 06 14:45:13 2011 +0200 @@ -4016,17 +4016,21 @@ revs, checkout = hg.addbranchrevs(repo, other, branches, opts.get('rev')) ui.debug('comparing with %s\n' % util.hidepassword(source)) repo.ui.pushbuffer() - common, incoming, rheads = discovery.findcommonincoming(repo, other) + commoninc = discovery.findcommonincoming(repo, other) + _common, incoming, _rheads = commoninc repo.ui.popbuffer() if incoming: t.append(_('1 or more incoming')) dest, branches = hg.parseurl(ui.expandpath('default-push', 'default')) revs, checkout = hg.addbranchrevs(repo, repo, branches, None) - other = hg.repository(hg.remoteui(repo, {}), dest) - ui.debug('comparing with %s\n' % util.hidepassword(dest)) + if source != dest: + other = hg.repository(hg.remoteui(repo, {}), dest) + commoninc = None + ui.debug('comparing with %s\n' % util.hidepassword(dest)) repo.ui.pushbuffer() - common, outheads = discovery.findcommonoutgoing(repo, other) + common, outheads = discovery.findcommonoutgoing(repo, other, + commoninc=commoninc) repo.ui.popbuffer() o = repo.changelog.findmissing(common=common, heads=outheads) if o: