Patchwork [3,of,4] push: introduce a discovery step for obsmarker

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 6, 2014, 12:07 a.m.
Message ID <f4a03fda065a5d97a766.1407283665@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5280/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 6, 2014, 12:07 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1404581540 -7200
#      Sat Jul 05 19:32:20 2014 +0200
# Node ID f4a03fda065a5d97a7660af7de85bd63534c47cf
# Parent  be0fe1a58d79caaa4bf7c45296565e6816724c06
push: introduce a discovery step for obsmarker

The discovery steps is still not doing anything smart. But this will allow
extension to wrap it.

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -80,11 +80,11 @@  class pushoperation(object):
         # phases changes that must be pushed along side the changesets
         self.outdatedphases = None
         # phases changes that must be pushed if changeset push fails
         self.fallbackoutdatedphases = None
         # outgoing obsmarkers
-        self.outobsmarkers = repo.obsstore
+        self.outobsmarkers = set()
 
     @util.propertycache
     def futureheads(self):
         """future remote heads if the changeset push succeeds"""
         return self.outgoing.missingheads
@@ -276,10 +276,14 @@  def _pushdiscoveryphase(pushop):
         fdroots = [f.node() for f in fdroots]
         future = list(unfi.set(revset, fdroots, pushop.futureheads))
     pushop.outdatedphases = future
     pushop.fallbackoutdatedphases = fallback
 
+@pushdiscovery('obsmarker')
+def _pushdiscoveryobsmarkers(pushop):
+    pushop.outobsmarkers = pushop.repo.obsstore
+
 def _pushcheckoutgoing(pushop):
     outgoing = pushop.outgoing
     unfi = pushop.repo.unfiltered()
     if not outgoing.missing:
         # nothing to push