changeset 24702:2b0449255800

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.
author Michael O'Connor <moconnor@janestreet.com>
date Mon, 13 Apr 2015 09:54:36 -0400
parents 03ee576784e6
children 868cec6409c4
files mercurial/discovery.py
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/discovery.py	Fri Apr 10 18:54:33 2015 -0700
+++ b/mercurial/discovery.py	Mon Apr 13 09:54:36 2015 -0400
@@ -272,9 +272,13 @@
     # 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)