diff mercurial/exchange.py @ 34819:eb6375651974

phase: gather remote phase information in a summary object We keep useful phase information around. The data will be reused with detecting push-race in later changesets.
author Boris Feld <boris.feld@octobus.net>
date Wed, 11 Oct 2017 18:39:04 +0200
parents 6709b5661d1b
children aa5e7b4a3a01
line wrap: on
line diff
--- a/mercurial/exchange.py	Wed Oct 11 18:39:34 2017 +0200
+++ b/mercurial/exchange.py	Wed Oct 11 18:39:04 2017 +0200
@@ -340,6 +340,8 @@
         self.pushbranchmap = None
         # testable as a boolean indicating if any nodes are missing locally.
         self.incoming = None
+        # summary of the remote phase situation
+        self.remotephases = None
         # phases changes that must be pushed along side the changesets
         self.outdatedphases = None
         # phases changes that must be pushed if changeset push fails
@@ -527,7 +529,6 @@
     outgoing = pushop.outgoing
     unfi = pushop.repo.unfiltered()
     remotephases = pushop.remote.listkeys('phases')
-    publishing = remotephases.get('publishing', False)
     if (pushop.ui.configbool('ui', '_usedassubrepo')
         and remotephases    # server supports phases
         and not pushop.outgoing.missing # no changesets to be pushed
@@ -544,12 +545,14 @@
         pushop.outdatedphases = []
         pushop.fallbackoutdatedphases = []
         return
-    ana = phases.analyzeremotephases(pushop.repo,
-                                     pushop.fallbackheads,
-                                     remotephases)
-    pheads, droots = ana
+
+    pushop.remotephases = phases.remotephasessummary(pushop.repo,
+                                                     pushop.fallbackheads,
+                                                     remotephases)
+    droots = pushop.remotephases.draftroots
+
     extracond = ''
-    if not publishing:
+    if not pushop.remotephases.publishing:
         extracond = ' and public()'
     revset = 'heads((%%ln::%%ln) %s)' % extracond
     # Get the list of all revs draft on remote by public here.