diff hgext/evolve.py @ 1078:5717d023da63

obsexc: use the common discovery We drop the hand made discovery and rely on the general one introduced some time ago.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 27 Aug 2014 17:09:36 +0200
parents cdfc19f25478
children e8f49b32e95b
line wrap: on
line diff
--- a/hgext/evolve.py	Wed Aug 27 12:29:40 2014 +0200
+++ b/hgext/evolve.py	Wed Aug 27 17:09:36 2014 +0200
@@ -2232,6 +2232,7 @@
         and pushop.repo.obsstore
         and 'obsolete' in pushop.remote.listkeys('namespaces')):
         repo = pushop.repo
+        obsexcmsg(repo.ui, "computing relevant nodes\n")
         revs = list(repo.revs('::%ln', pushop.futureheads))
         unfi = repo.unfiltered()
         cl = unfi.changelog
@@ -2239,7 +2240,14 @@
             # do not trust core yet
             # return orig(pushop)
             nodes = [cl.node(r) for r in revs]
-            pushop.outobsmarkers = repo.obsstore.relevantmarkers(nodes)
+            if nodes:
+                obsexcmsg(repo.ui, "computing markers relevant to %i nodes\n"
+                                   % len(nodes))
+                pushop.outobsmarkers = repo.obsstore.relevantmarkers(nodes)
+            else:
+                obsexcmsg(repo.ui, "markers already in sync\n")
+                pushop.outobsmarkers = []
+                pushop.outobsmarkers = repo.obsstore.relevantmarkers(nodes)
             return
 
         common = []
@@ -2250,7 +2258,13 @@
 
         revs = list(unfi.revs('%ld - (::%ln)', revs, common))
         nodes = [cl.node(r) for r in revs]
-        pushop.outobsmarkers = repo.obsstore.relevantmarkers(nodes)
+        if nodes:
+            obsexcmsg(repo.ui, "computing markers relevant to %i nodes\n"
+                               % len(nodes))
+            pushop.outobsmarkers = repo.obsstore.relevantmarkers(nodes)
+        else:
+            obsexcmsg(repo.ui, "markers already in sync\n")
+            pushop.outobsmarkers = []
 
 @eh.wrapfunction(wireproto, 'capabilities')
 def discocapabilities(orig, repo, proto):
@@ -2449,7 +2463,7 @@
     cl = unfi.changelog
     if (obsolete._enabled and repo.obsstore and
         'obsolete' in remote.listkeys('namespaces')):
-        markers = _obsmarkersdiscovery(pushop)
+        markers = pushop.outobsmarkers
         if not markers:
             obsexcmsg(repo.ui, "no marker to push\n")
         elif remote.capable('_evoext_b2x_obsmarkers_0'):