Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revset.py @ 45686:17a12f53dd72
revset: add a `node` key for sorting
Sorting by node give an arbitrary, but stable order which is useful for
sampling.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 08 Oct 2020 16:14:06 +0200 |
parents | 9b9071fabcd3 |
children | b90d7e7f39db |
comparison
equal
deleted
inserted
replaced
45685:57b5452a55d5 | 45686:17a12f53dd72 |
---|---|
2291 b'branch': lambda c: c.branch(), | 2291 b'branch': lambda c: c.branch(), |
2292 b'desc': lambda c: c.description(), | 2292 b'desc': lambda c: c.description(), |
2293 b'user': lambda c: c.user(), | 2293 b'user': lambda c: c.user(), |
2294 b'author': lambda c: c.user(), | 2294 b'author': lambda c: c.user(), |
2295 b'date': lambda c: c.date()[0], | 2295 b'date': lambda c: c.date()[0], |
2296 b'node': lambda c: c.node(), | |
2296 } | 2297 } |
2297 | 2298 |
2298 | 2299 |
2299 def _getsortargs(x): | 2300 def _getsortargs(x): |
2300 """Parse sort options into (set, [(key, reverse)], opts)""" | 2301 """Parse sort options into (set, [(key, reverse)], opts)""" |
2354 - ``branch`` for the branch name, | 2355 - ``branch`` for the branch name, |
2355 - ``desc`` for the commit message (description), | 2356 - ``desc`` for the commit message (description), |
2356 - ``user`` for user name (``author`` can be used as an alias), | 2357 - ``user`` for user name (``author`` can be used as an alias), |
2357 - ``date`` for the commit date | 2358 - ``date`` for the commit date |
2358 - ``topo`` for a reverse topographical sort | 2359 - ``topo`` for a reverse topographical sort |
2360 - ``node`` the nodeid of the revision | |
2359 | 2361 |
2360 The ``topo`` sort order cannot be combined with other sort keys. This sort | 2362 The ``topo`` sort order cannot be combined with other sort keys. This sort |
2361 takes one optional argument, ``topo.firstbranch``, which takes a revset that | 2363 takes one optional argument, ``topo.firstbranch``, which takes a revset that |
2362 specifies what topographical branches to prioritize in the sort. | 2364 specifies what topographical branches to prioritize in the sort. |
2363 | 2365 |