comparison tests/test-revisions.t @ 38882:6f7c9527030b

scmutil: make shortest() respect disambiguation revset The previous patch would let you use a shorter prefix if the prefix is unique within a configured revset. However, that's not very useful if there's no simple way of knowing what that shorter prefix is. This patch adapts the shortest() template function to use the shorter prefixes for nodes in the configured revset. This is currently extremely slow, because it calculates the revset for each call to shortest(). To make this faster, the next patch will start caching the revset instance. Ideally we'd cache a prefix tree instance instead. Differential Revision: https://phab.mercurial-scm.org/D4038
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 13 Apr 2018 23:23:47 -0700
parents 503f936489dd
children 4c4825db29e1
comparison
equal deleted inserted replaced
38881:503f936489dd 38882:6f7c9527030b
21 0:b 21 0:b
22 $ cat <<EOF >> .hg/hgrc 22 $ cat <<EOF >> .hg/hgrc
23 > [experimental] 23 > [experimental]
24 > revisions.disambiguatewithin=:3 24 > revisions.disambiguatewithin=:3
25 > EOF 25 > EOF
26 $ hg l
27 4:7ba5d
28 3:7b
29 2:72
30 1:9
31 0:b
26 9 was unambiguous and still is 32 9 was unambiguous and still is
27 $ hg l -r 9 33 $ hg l -r 9
28 1:9 34 1:9
29 7 was ambiguous and still is 35 7 was ambiguous and still is
30 $ hg l -r 7 36 $ hg l -r 7
31 abort: 00changelog.i@7: ambiguous identifier! 37 abort: 00changelog.i@7: ambiguous identifier!
32 [255] 38 [255]
33 7b is no longer ambiguous 39 7b is no longer ambiguous
34 $ hg l -r 7b 40 $ hg l -r 7b
35 3:7ba57 41 3:7b
36 42
37 $ cd .. 43 $ cd ..