[PATCH 1 of 5 V2] revsets: record sort order keys

Martijn Pieters mj at zopatista.com
Sun May 29 12:57:34 EDT 2016


On 26 May 2016 at 06:00, Yuya Nishihara <yuya at tcha.org> wrote:
> This patch seems to try hard to preserve raw sort key strings, but they
> aren't exactly the same as what sort() would do. That made me feel keeping
> raw sort keys wouldn't be nice.

They produce sorted output that still honours the (informative) sort
key. I could add a clarification to the docstring here that
`reversed(sort(set, keys))` produces slightly different output from
`sort(set, reversedkeys)` where the input order is reversed for any
entry where the sort keys are equal. If someone cares about the sort
order beyond the sort keys they need to re-sort explicitly.

> Perhaps adding istopo() or something would be simpler.

You'd still have to track that across multiple predicates; I tried
that as a first step but it wasn't any simpler really.

-- 
Martijn Pieters


More information about the Mercurial-devel mailing list