[PATCH 1 of 4 V3] graphmod: avoid sorting when already sorted

Augie Fackler raf at durin42.com
Thu Jun 9 23:46:20 EDT 2016


On Wed, Jun 08, 2016 at 05:20:38PM +0100, Martijn Pieters wrote:
> # HG changeset patch
> # User Martijn Pieters <mjpieters at fb.com>
> # Date 1465399123 -3600
> #      Wed Jun 08 16:18:43 2016 +0100
> # Node ID 102da097e704b3640f05b175800b02554b709bc2
> # Parent  baab9ea4426ca658d191119bfa8715eb40a39d82
> graphmod: avoid sorting when already sorted

This one is queued, thanks

>
> 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,8 @@
>      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 not revs.isdescending():
> +            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


More information about the Mercurial-devel mailing list