Patchwork [4,of,9] push: add a ``pushop.stepsdone`` attribute

login
register
mail settings
Submitter Pierre-Yves David
Date July 7, 2014, 11:02 a.m.
Message ID <269b990354a93fd1837c.1404730922@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5119/
State Accepted
Commit 8612c4ab7f5432473de354f5455b59ae576e4949
Headers show

Comments

Pierre-Yves David - July 7, 2014, 11:02 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1404298134 -7200
#      Wed Jul 02 12:48:54 2014 +0200
# Node ID 269b990354a93fd1837caebfd3708af646596024
# Parent  43db2776ef385be3ade68d49044adc2a39477510
push: add a ``pushop.stepsdone`` attribute

This attribute will record what steps were performed during the bundle2 pushi.
This will control whenever the old way push must be performed or skipped. This
will ultimately be used by changegroup, phases, obsmarkers, bookmarks and any
other kind of data ones may want to exchange even when bundle2 support is
missing.

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -59,10 +59,13 @@  class pushoperation(object):
         self.revs = revs
         # allow push of new branch
         self.newbranch = newbranch
         # did a local lock get acquired?
         self.locallocked = None
+        # step already performed
+        # (used to check what steps have been already performed through bundle2)
+        self.stepsdone = set()
         # Integer version of the push result
         # - None means nothing to push
         # - 0 means HTTP error
         # - 1 means we pushed and remote head count is unchanged *or*
         #   we have outgoing changesets but refused to push