D440: exchange: don't attempt phase exchange if phase-heads was in bundle

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Aug 23 12:00:50 EDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG13dc7f29531e: exchange: don't attempt phase exchange if phase-heads was in bundle (authored by martinvonz).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D440?vs=1054&id=1204

REVISION DETAIL
  https://phab.mercurial-scm.org/D440

AFFECTED FILES
  mercurial/bundle2.py
  mercurial/exchange.py

CHANGE DETAILS

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1401,6 +1401,10 @@
     if pullop.fetch:
         pullop.cgresult = bundle2.combinechangegroupresults(op)
 
+    # If the bundle had a phase-heads part, then phase exchange is already done
+    if op.records['phase-heads']:
+        pullop.stepsdone.add('phases')
+
     # processing phases change
     for namespace, value in op.records['listkeys']:
         if namespace == 'phases':
diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -1815,6 +1815,7 @@
     """apply phases from bundle part to repo"""
     headsbyphase = _readphaseheads(inpart)
     phases.updatephases(op.repo.unfiltered(), op.gettransaction(), headsbyphase)
+    op.records.add('phase-heads', {})
 
 @parthandler('reply:pushkey', ('return', 'in-reply-to'))
 def handlepushkeyreply(op, inpart):



To: martinvonz, #hg-reviewers, quark, durin42
Cc: quark, mercurial-devel


More information about the Mercurial-devel mailing list