# HG changeset patch # User Pierre-Yves David # Date 2024-10-24 23:23:24 # Node ID 75123bc60b667af58eb6fdce58a714d792b97961 # Parent c53b6498ed1a837d7525799147701ece4e215c52 outgoing: move sorting in the display function This make the core code simpler. diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -1454,6 +1454,9 @@ def _outgoing_recurse(ui, repo, dests, o def display_outgoing_revs(ui, repo, o, opts): + # make sure this is ordered by revision number + cl = repo.changelog + o.sort(key=cl.rev) if opts.get(b'graph'): revdag = logcmdutil.graphrevs(repo, o, opts) ui.pager(b'outgoing') @@ -1524,11 +1527,7 @@ def _outgoing(ui, repo, dests, opts, sub except: # re-raises other.close() raise - # make sure this is ordered by revision number - outgoing_revs = list(out) - cl = repo.changelog - outgoing_revs.sort(key=cl.rev) - return outgoing_revs, others + return list(out), others def verify(repo, level=None):