# HG changeset patch # User Pierre-Yves David # Date 2017-05-29 03:21:38 # Node ID 7a7c4f3afb98cddc5f46edd65c141bb3a4aeebf7 # Parent bd966b9f327488d706dcaaeb8c4ed61cbc0845f7 checkheads: drop now unused filtering of 'unsyncedheads' Now that unsynced heads are no longer in the function inputs or returns, we can simplify the code a bit. diff --git a/mercurial/discovery.py b/mercurial/discovery.py --- a/mercurial/discovery.py +++ b/mercurial/discovery.py @@ -355,16 +355,15 @@ def checkheads(pushop): allfuturecommon, newheads) newhs.update(unsyncedheads) - unsynced = sorted(h for h in unsyncedheads if h not in discardedheads) - if unsynced: - if None in unsynced: + if unsyncedheads: + if None in unsyncedheads: # old remote, no heads data heads = None - elif len(unsynced) <= 4 or repo.ui.verbose: - heads = ' '.join(short(h) for h in unsynced) + elif len(unsyncedheads) <= 4 or repo.ui.verbose: + heads = ' '.join(short(h) for h in unsyncedheads) else: - heads = (' '.join(short(h) for h in unsynced[:4]) + - ' ' + _("and %s others") % (len(unsynced) - 4)) + heads = (' '.join(short(h) for h in unsyncedheads[:4]) + + ' ' + _("and %s others") % (len(unsyncedheads) - 4)) if heads is None: repo.ui.status(_("remote has heads that are " "not known locally\n"))