# HG changeset patch # User Michael O'Connor # Date 2015-04-13 13:54:36 # Node ID 2b044925580057148784a819cafa010297127bf5 # Parent 03ee576784e68d9396b6e97a3d150815c414eb0d discovery: don't compute allfuturecommon when it won't be used In repos with many changesets, the computation of allfuturecommon can take a significant amount of time. Since it's only used if there's an obsstore, don't compute it otherwise. diff --git a/mercurial/discovery.py b/mercurial/discovery.py --- a/mercurial/discovery.py +++ b/mercurial/discovery.py @@ -272,9 +272,13 @@ def checkheads(repo, remote, outgoing, r # If there are more heads after the push than before, a suitable # error message, depending on unsynced status, is displayed. error = None - allmissing = set(outgoing.missing) - allfuturecommon = set(c.node() for c in repo.set('%ld', outgoing.common)) - allfuturecommon.update(allmissing) + # If there is no obsstore, allfuturecommon won't be used, so no + # need to compute it. + if repo.obsstore: + allmissing = set(outgoing.missing) + cctx = repo.set('%ld', outgoing.common) + allfuturecommon = set(c.node() for c in cctx) + allfuturecommon.update(allmissing) for branch, heads in sorted(headssum.iteritems()): remoteheads, newheads, unsyncedheads = heads candidate_newhs = set(newheads)