[PATCH 2 of 3] graphmod: avoid sorting when already sorted

Martijn Pieters mj at zopatista.com
Wed May 18 06:12:35 EDT 2016


On 18 May 2016 at 10:50, Martijn Pieters <mj at zopatista.com> wrote:
> # HG changeset patch
> # User Martijn Pieters <mjpieters at fb.com>
> # Date 1463470009 -3600
> #      Tue May 17 08:26:49 2016 +0100
> # Node ID 237abedf015f922c48ababf72218c83accb80229
> # Parent  769ba6f6a3d16beb7be8340f72a04e5f6200da9e
> graphmod: avoid sorting when already sorted
>
> This is somewhat redundant now, but allows us to add a toposort that should not
> be re-sorted either.
>
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -2147,7 +2147,9 @@
>      if opts.get('rev'):
>          # User-specified revs might be unsorted, but don't sort before
>          # _makelogrevset because it might depend on the order of revs
> -        revs.sort(reverse=True)
> +        if revs.sortorder != ('-rev',):
> +            repo.ui.status('Sorting!\n')

Oops, left in a debug turd. Will resend the whole series (there's a
linting error in another patch of this series too).

> +            revs.sort(reverse=True)
>      if expr:
>          # Revset matchers often operate faster on revisions in changelog
>          # order, because most filters deal with the changelog.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel



-- 
Martijn Pieters


More information about the Mercurial-devel mailing list