Patchwork [6,of,7,(push,is,done;,12,more,to,go,for,pull)] push: move `commonheads` into the push object

login
register
mail settings
Submitter Pierre-Yves David
Date Feb. 11, 2014, 9:32 p.m.
Message ID <1f749657b1e39fdb9b3c.1392154376@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/3587/
State Accepted
Commit ef880ced6d07f0ec9009efef7fb403ed1263de8d
Headers show

Comments

Pierre-Yves David - Feb. 11, 2014, 9:32 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# Date 1391152603 28800
#      Thu Jan 30 23:16:43 2014 -0800
# Node ID 1f749657b1e39fdb9b3c5a6fa91ce80eccbb1e11
# Parent  b1f6e0ea25feccb4b2ce5c3c72b58b91a5d85928
push: move `commonheads` into the push object

The phase synchronisation start by computing the new set of common head between
local and remote and then do the phase synchronisation on this set. This new
common set logic will eventually be used by the obsolescence markers exchange.
So we are going to split the long phase synchronisation in two.

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -46,10 +46,12 @@  class pushoperation(object):
         self.outgoing = None
         # all remote heads before the push
         self.remoteheads = None
         # testable as a boolean indicating if any nodes are missing locally.
         self.incoming = None
+        # set of all heads common after changeset bundle push
+        self.commonheads = None
 
 def push(repo, remote, force=False, revs=None, newbranch=False):
     '''Push outgoing changesets (limited by revs) from a local
     repository to remote. Return an integer:
       - None means nothing to push
@@ -236,10 +238,11 @@  def _pushsyncphase(pushop):
         # * commonheads parents on missing
         revset = unfi.set('%ln and parents(roots(%ln))',
                          pushop.outgoing.commonheads,
                          pushop.outgoing.missing)
         cheads.extend(c.node() for c in revset)
+    pushop.commonheads = cheads
     # even when we don't push, exchanging phase data is useful
     remotephases = pushop.remote.listkeys('phases')
     if (pushop.ui.configbool('ui', '_usedassubrepo', False)
         and remotephases    # server supports phases
         and pushop.ret is None # nothing was pushed