# HG changeset patch # User Pierre-Yves David # Date 2017-05-29 08:56:00 # Node ID 993f58db20452aca491c9b531c642073716a7769 # Parent 70a020daf0b905ec1650c3407256f44363fe9484 headssummary: directly feed the function with the 'pushop' object Our goal is to be able to perform the post processing directly into the '_headssummary' function. However before this patch the '_headsummary' function only had access to repo, remote, outgoing while the '_postprocessobsolete' function takes a 'pushop' object. Experience shows that having the 'pushop' object helps extensions so we update '_headssummary' to take a pushop object as argument. diff --git a/mercurial/discovery.py b/mercurial/discovery.py --- a/mercurial/discovery.py +++ b/mercurial/discovery.py @@ -182,7 +182,7 @@ def findcommonoutgoing(repo, other, only return og -def _headssummary(repo, remote, outgoing): +def _headssummary(pushop): """compute a summary of branch and heads status before and after push return {'branch': ([remoteheads], [newheads], [unsyncedheads])} mapping @@ -193,6 +193,9 @@ def _headssummary(repo, remote, outgoing - newheads: the new remote heads (known locally) with outgoing pushed - unsyncedheads: the list of remote heads unknown locally. """ + repo = pushop.repo.unfiltered() + remote = pushop.remote + outgoing = pushop.outgoing cl = repo.changelog headssum = {} # A. Create set of branches involved in the push. @@ -311,7 +314,7 @@ def checkheads(pushop): return if remote.capable('branchmap'): - headssum = _headssummary(repo, remote, outgoing) + headssum = _headssummary(pushop) else: headssum = _oldheadssummary(repo, remoteheads, outgoing, inc) newbranches = [branch for branch, heads in headssum.iteritems()