Patchwork [15,of,16] push: turn common heads into an attribute

login
register
mail settings
Submitter Pierre-Yves David
Date April 17, 2013, 3:58 p.m.
Message ID <86031a108f85c2922afa.1366214330@crater1.logilab.fr>
Download mbox | patch
Permalink /patch/1398/
State Deferred, archived
Headers show

Comments

Pierre-Yves David - April 17, 2013, 3:58 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# Date 1366211630 -7200
#      Wed Apr 17 17:13:50 2013 +0200
# Node ID 86031a108f85c2922afac8d173ea3c27d2f62bd6
# Parent  ffde5609443882bd9249e613d861fae2e817f0d6
push: turn common heads into an attribute

It is likely to be useful to other methods.

Patch

diff --git a/mercurial/exchangeutil.py b/mercurial/exchangeutil.py
--- a/mercurial/exchangeutil.py
+++ b/mercurial/exchangeutil.py
@@ -23,10 +23,11 @@  class pushoperation(object):
         self.revs = revs
         self.newbranch = newbranch
 
         self._outgoing = None    # discovery.outgoing object
         self._remoteheads = None # know remote head before the push
+        self._commonheads = None # common head after push
 
         self._ret = None # push operation return
 
     def perform(self):
         '''Push outgoing changesets (limited by revs) from the current
@@ -64,11 +65,11 @@  class pushoperation(object):
                     scmutil.nochangesfound(unfi.ui, unfi,
                                            self._outgoing.excluded)
                 else:
                     self._ret = self._pushbundle()
 
-                heads = self._findcommonheads()
+                self._commonheads = cheads = self._findcommonheads()
 
                 # even when we don't push, exchanging phase data is useful
                 remotephases = remote.listkeys('phases')
                 if (repo.ui.configbool('ui', '_usedassubrepo', False)
                     and remotephases    # server supports phases