[PATCH 1 of 3 V4] revset: record if a set is in topographical order

Martijn Pieters mj at zopatista.com
Tue Jun 14 12:06:44 EDT 2016


On 14 June 2016 at 16:37, Yuya Nishihara <yuya at tcha.org> wrote:
>> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
>> --- a/mercurial/cmdutil.py
>> +++ b/mercurial/cmdutil.py
>> @@ -2147,7 +2147,7 @@
>>      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
>> -        if not revs.isdescending():
>> +        if not (revs.isdescending() or revs.istopo()):
>>              revs.sort(reverse=True)
>>      if expr:
>>          # Revset matchers often operate faster on revisions in changelog
>
> You'll need to stop sorting in "if expr" after my patches are landed. I'm
> fixing the issue of unstable ordering.

Not sure I follow you here; this line prevents hg log -G from sorting
an already sorted revset; you don't want to resort a topographical
sort!

At some point this should probably default to using sort(revs, 'topo')
instead of the descending revision sort.

-- 
Martijn Pieters


More information about the Mercurial-devel mailing list