Debian Codegraph @

tests/test-revisions.t

raw
1 $ hg init repo
2 $ cd repo
3
4 $ echo 0 > a
5 $ hg ci -qAm 0
6 $ for i in 5 8 14 43 167; do
7 > hg up -q 0
8 > echo $i > a
9 > hg ci -qm $i
10 > done
11 $ cat <<EOF >> .hg/hgrc
12 > [alias]
13 > l = log -T '{rev}:{shortest(node,1)}\n'
14 > EOF
15
16 $ hg l
17 5:00f
18 4:7ba5d
19 3:7ba57
20 2:72
21 1:9
22 0:b
23 $ cat <<EOF >> .hg/hgrc
24 > [experimental]
25 > revisions.disambiguatewithin=not 4
26 > EOF
27 $ hg l
28 5:00
29 4:7ba5d
30 3:7b
31 2:72
32 1:9
33 0:b
34 9 was unambiguous and still is
35 $ hg l -r 9
36 1:9
37 7 was ambiguous and still is
38 $ hg l -r 7
39 abort: ambiguous revision identifier: 7
40 [10]
41 7b is no longer ambiguous
42 $ hg l -r 7b
43 3:7b
44
45 $ cd ..