# HG changeset patch # User Pierre-Yves David # Date 2017-05-29 03:23:30 # Node ID fc9296c15112af247e4985cdc45fbbf7d8eed175 # Parent 7a7c4f3afb98cddc5f46edd65c141bb3a4aeebf7 checkheads: simplify the code around obsolescence post-processing The 'discardedheads' return become unused and the relationship between newheads and newhs can be clarified. Our next goal here is to be able to extract the _postprocessobsolete call outside of the loop. We keep returning the 'discardedheads' because we'll start using it again soon in this series. diff --git a/mercurial/discovery.py b/mercurial/discovery.py --- a/mercurial/discovery.py +++ b/mercurial/discovery.py @@ -347,13 +347,10 @@ def checkheads(pushop): oldhs = set(remoteheads) oldhs.update(unsyncedheads) dhs = None # delta heads, the new heads on branch - if not repo.obsstore: - discardedheads = set() - newhs = set(newheads) - else: - newhs, discardedheads = _postprocessobsolete(pushop, - allfuturecommon, - newheads) + if repo.obsstore: + result = _postprocessobsolete(pushop, allfuturecommon, newheads) + newheads = sorted(result[0]) + newhs = set(newheads) newhs.update(unsyncedheads) if unsyncedheads: if None in unsyncedheads: