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

login
register
mail settings
Submitter phabricator
Date Aug. 23, 2017, 4 p.m.
Message ID <8d2560c08d9c5d44fd74389c06aaf519@localhost.localdomain>
Download mbox | patch
Permalink /patch/23254/
State Not Applicable
Headers show

Comments

phabricator - Aug. 23, 2017, 4 p.m.
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




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

Patch

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):