exchange: extract computation of pulled markers boundary in a function
authorPierre-Yves David <pierre-yves.david@fb.com>
Fri, 28 Feb 2014 13:44:37 -0800
changeset 825 7671717afef8
parent 824 fed090e07621
child 826 bee5e1105e6c
exchange: extract computation of pulled markers boundary in a function I expect massive experimentation on this specific aspect. so we better isolate it.
hgext/evolve.py
--- a/hgext/evolve.py	Fri Feb 28 13:38:19 2014 -0800
+++ b/hgext/evolve.py	Fri Feb 28 13:44:37 2014 -0800
@@ -2184,6 +2184,14 @@
         lock.release()
     return wireproto.pushres(0)
 
+def _buildpullobsmerkersboundaries(pullop):
+    """small funtion returning the argument for pull markers call
+    may to contains 'heads' and 'common'. skip the key for None.
+
+    Its a separed functio to play around with strategy for that."""
+    return {'heads': pullop.pulledsubset}
+
+
 @eh.wrapfunction(exchange, '_pullobsolete')
 def _pullobsolete(orig, pullop):
     if not obsolete._enabled:
@@ -2193,7 +2201,8 @@
     tr = None
     ui = pullop.repo.ui
     ui.status("OBSEXC: pull obsolescence markers\n")
-    obsdata = pullop.remote.evoext_pullobsmarkers_0(heads=pullop.pulledsubset)
+    boundaries = _buildpullobsmerkersboundaries(pullop)
+    obsdata = pullop.remote.evoext_pullobsmarkers_0(**boundaries)
     obsdata = obsdata.read()
     if len(obsdata) > 5:
         ui.status("OBSEXC: merging obsolescence markers (%i bytes)\n"