annotate tests/test-tags @ 9583:0491be4448bf

bisect: limit considered set to descendants of first good rev
author Matt Mackall <mpm@selenic.com>
date Mon, 12 Oct 2009 14:59:28 -0500
parents 9ff178e7b627
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
544
3d4d5f2aba9a Remove bashisms and use /bin/sh instead of /bin/bash.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 345
diff changeset
1 #!/bin/sh
345
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
2
9151
f528d1a93491 tags: implement persistent tag caching (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9144
diff changeset
3 cacheexists() {
f528d1a93491 tags: implement persistent tag caching (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9144
diff changeset
4 [ -f .hg/tags.cache ] && echo "tag cache exists" || echo "no tag cache"
f528d1a93491 tags: implement persistent tag caching (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9144
diff changeset
5 }
f528d1a93491 tags: implement persistent tag caching (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9144
diff changeset
6
9152
4017291c4c48 tags: support 'instant' tag retrieval (issue548)
Greg Ward <greg-hg@gerg.ca>
parents: 9151
diff changeset
7 # XXX need to test that the tag cache works when we strip an old head
4017291c4c48 tags: support 'instant' tag retrieval (issue548)
Greg Ward <greg-hg@gerg.ca>
parents: 9151
diff changeset
8 # and add a new one rooted off non-tip: i.e. node and rev of tip are the
4017291c4c48 tags: support 'instant' tag retrieval (issue548)
Greg Ward <greg-hg@gerg.ca>
parents: 9151
diff changeset
9 # same, but stuff has changed behind tip.
4017291c4c48 tags: support 'instant' tag retrieval (issue548)
Greg Ward <greg-hg@gerg.ca>
parents: 9151
diff changeset
10
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
11 echo "% setup"
345
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
12 mkdir t
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
13 cd t
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
14 hg init
9151
f528d1a93491 tags: implement persistent tag caching (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9144
diff changeset
15 cacheexists
345
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
16 hg id
9151
f528d1a93491 tags: implement persistent tag caching (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9144
diff changeset
17 cacheexists
345
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
18 echo a > a
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
19 hg add a
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
20 hg commit -m "test"
345
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
21 hg co
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
22 hg identify
9151
f528d1a93491 tags: implement persistent tag caching (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9144
diff changeset
23 cacheexists
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
24
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
25 echo "% create local tag with long name"
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
26 T=`hg identify --debug --id`
4143
26314500a5e1 Don't truncate tag and branch names after 30 chars (introduced 73860ffbe798)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 3577
diff changeset
27 hg tag -l "This is a local tag with a really long name!"
26314500a5e1 Don't truncate tag and branch names after 30 chars (introduced 73860ffbe798)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 3577
diff changeset
28 hg tags
26314500a5e1 Don't truncate tag and branch names after 30 chars (introduced 73860ffbe798)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 3577
diff changeset
29 rm .hg/localtags
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
30
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
31 echo "% create a tag behind hg's back"
345
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
32 echo "$T first" > .hgtags
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
33 cat .hgtags
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
34 hg add .hgtags
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
35 hg commit -m "add tags"
345
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
36 hg tags
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
37 hg identify
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
38
9151
f528d1a93491 tags: implement persistent tag caching (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9144
diff changeset
39 # repeat with cold tag cache
9366
9ff178e7b627 tags: don't crash if unable to write tag cache
Greg Ward <greg-hg@gerg.ca>
parents: 9152
diff changeset
40 echo "% identify with cold cache"
9151
f528d1a93491 tags: implement persistent tag caching (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9144
diff changeset
41 rm -f .hg/tags.cache
f528d1a93491 tags: implement persistent tag caching (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9144
diff changeset
42 hg identify
f528d1a93491 tags: implement persistent tag caching (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9144
diff changeset
43
9366
9ff178e7b627 tags: don't crash if unable to write tag cache
Greg Ward <greg-hg@gerg.ca>
parents: 9152
diff changeset
44 # and again, but now unable to write tag cache
9ff178e7b627 tags: don't crash if unable to write tag cache
Greg Ward <greg-hg@gerg.ca>
parents: 9152
diff changeset
45 echo "% identify with unwritable cache"
9ff178e7b627 tags: don't crash if unable to write tag cache
Greg Ward <greg-hg@gerg.ca>
parents: 9152
diff changeset
46 rm -f .hg/tags.cache
9ff178e7b627 tags: don't crash if unable to write tag cache
Greg Ward <greg-hg@gerg.ca>
parents: 9152
diff changeset
47 chmod 555 .hg
9ff178e7b627 tags: don't crash if unable to write tag cache
Greg Ward <greg-hg@gerg.ca>
parents: 9152
diff changeset
48 hg identify
9ff178e7b627 tags: don't crash if unable to write tag cache
Greg Ward <greg-hg@gerg.ca>
parents: 9152
diff changeset
49 chmod 755 .hg
9ff178e7b627 tags: don't crash if unable to write tag cache
Greg Ward <greg-hg@gerg.ca>
parents: 9152
diff changeset
50
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
51 echo "% create a branch"
345
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
52 echo bb > a
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
53 hg status
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
54 hg identify
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
55 hg co first
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
56 hg id
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
57 hg -v id
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
58 hg status
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
59 echo 1 > b
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
60 hg add b
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
61 hg commit -m "branch"
345
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
62 hg id
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
63
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
64 echo "% merge the two heads"
2283
e506c14382fd deprecate 'update -m'. use 'merge' instead.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1986
diff changeset
65 hg merge 1
345
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
66 hg id
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
67 hg status
9d8d9207c0b3 Add a tags/identify test group
mpm@selenic.com
parents:
diff changeset
68
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
69 hg commit -m "merge"
2320
dbdce3b99988 fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2283
diff changeset
70
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
71 echo "% create fake head, make sure tag not visible afterwards"
2320
dbdce3b99988 fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2283
diff changeset
72 cp .hgtags tags
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
73 hg tag last
2320
dbdce3b99988 fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2283
diff changeset
74 hg rm .hgtags
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
75 hg commit -m "remove"
2320
dbdce3b99988 fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2283
diff changeset
76
dbdce3b99988 fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2283
diff changeset
77 mv tags .hgtags
dbdce3b99988 fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2283
diff changeset
78 hg add .hgtags
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
79 hg commit -m "readd"
2320
dbdce3b99988 fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2283
diff changeset
80
dbdce3b99988 fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2283
diff changeset
81 hg tags
dbdce3b99988 fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2283
diff changeset
82
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
83 echo "% add invalid tags"
1986
719cf07b076d add checking for invalid entries in tag files
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1933
diff changeset
84 echo "spam" >> .hgtags
719cf07b076d add checking for invalid entries in tag files
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1933
diff changeset
85 echo >> .hgtags
719cf07b076d add checking for invalid entries in tag files
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1933
diff changeset
86 echo "foo bar" >> .hgtags
719cf07b076d add checking for invalid entries in tag files
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1933
diff changeset
87 echo "$T invalid" | sed "s/..../a5a5/" >> .hg/localtags
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
88 echo "committing .hgtags:"
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
89 cat .hgtags
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
90 hg commit -m "tags"
2320
dbdce3b99988 fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2283
diff changeset
91
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
92 echo "% report tag parse error on other head"
2320
dbdce3b99988 fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2283
diff changeset
93 hg up 3
dbdce3b99988 fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2283
diff changeset
94 echo 'x y' >> .hgtags
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
95 hg commit -m "head"
2320
dbdce3b99988 fix parsing of tags. make parse errors useful. add new tag tests.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2283
diff changeset
96
1986
719cf07b076d add checking for invalid entries in tag files
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1933
diff changeset
97 hg tags
719cf07b076d add checking for invalid entries in tag files
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1933
diff changeset
98 hg tip
719cf07b076d add checking for invalid entries in tag files
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 1933
diff changeset
99
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
100 echo "% test tag precedence rules"
3577
7f7425306925 Correct optimization from 3464f5e77f34; add a test.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2966
diff changeset
101 cd ..
7f7425306925 Correct optimization from 3464f5e77f34; add a test.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2966
diff changeset
102 hg init t2
7f7425306925 Correct optimization from 3464f5e77f34; add a test.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2966
diff changeset
103 cd t2
7f7425306925 Correct optimization from 3464f5e77f34; add a test.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2966
diff changeset
104 echo foo > foo
7f7425306925 Correct optimization from 3464f5e77f34; add a test.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2966
diff changeset
105 hg add foo
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
106 hg ci -m 'add foo' # rev 0
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
107 hg tag bar # rev 1
3577
7f7425306925 Correct optimization from 3464f5e77f34; add a test.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2966
diff changeset
108 echo >> foo
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
109 hg ci -m 'change foo 1' # rev 2
3577
7f7425306925 Correct optimization from 3464f5e77f34; add a test.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2966
diff changeset
110 hg up -C 1
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
111 hg tag -r 1 -f bar # rev 3
3577
7f7425306925 Correct optimization from 3464f5e77f34; add a test.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2966
diff changeset
112 hg up -C 1
7f7425306925 Correct optimization from 3464f5e77f34; add a test.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2966
diff changeset
113 echo >> foo
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
114 hg ci -m 'change foo 2' # rev 4
3577
7f7425306925 Correct optimization from 3464f5e77f34; add a test.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2966
diff changeset
115 hg tags
9144
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
116 hg tags # repeat in case of cache effects
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
117
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
118 dumptags() {
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
119 rev=$1
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
120 echo "rev $rev: .hgtags:"
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
121 hg cat -r$rev .hgtags
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
122 }
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
123
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
124 echo "% detailed dump of tag info"
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
125 echo "heads:"
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
126 hg heads -q # expect 4, 3, 2
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
127 dumptags 2
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
128 dumptags 3
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
129 dumptags 4
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
130 echo ".hg/tags.cache:"
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
131 [ -f .hg/tags.cache ] && cat .hg/tags.cache || echo "no such file"
4213
3be4785f8994 tags: add --remove
Matt Mackall <mpm@selenic.com>
parents: 4211
diff changeset
132
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
133 echo "% test tag removal"
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
134 hg tag --remove bar # rev 5
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
135 hg tip -vp
4213
3be4785f8994 tags: add --remove
Matt Mackall <mpm@selenic.com>
parents: 4211
diff changeset
136 hg tags
9144
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
137 hg tags # again, try to expose cache bugs
4266
fe7f38dda34b tags: fix abababa case, with test case
Matt Mackall <mpm@selenic.com>
parents: 4213
diff changeset
138
4651
7176f278d6f9 Test attempt to remove nonexistent tag
Brendan Cully <brendan@kublai.com>
parents: 4482
diff changeset
139 echo '% remove nonexistent tag'
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
140 hg tag --remove foobar
4651
7176f278d6f9 Test attempt to remove nonexistent tag
Brendan Cully <brendan@kublai.com>
parents: 4482
diff changeset
141 hg tip
7176f278d6f9 Test attempt to remove nonexistent tag
Brendan Cully <brendan@kublai.com>
parents: 4482
diff changeset
142
9144
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
143 echo "% rollback undoes tag operation"
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
144 hg rollback # destroy rev 5 (restore bar)
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
145 hg tags
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
146 hg tags
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
147
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
148 echo "% test tag rank"
4266
fe7f38dda34b tags: fix abababa case, with test case
Matt Mackall <mpm@selenic.com>
parents: 4213
diff changeset
149 cd ..
fe7f38dda34b tags: fix abababa case, with test case
Matt Mackall <mpm@selenic.com>
parents: 4213
diff changeset
150 hg init t3
fe7f38dda34b tags: fix abababa case, with test case
Matt Mackall <mpm@selenic.com>
parents: 4213
diff changeset
151 cd t3
fe7f38dda34b tags: fix abababa case, with test case
Matt Mackall <mpm@selenic.com>
parents: 4213
diff changeset
152 echo foo > foo
fe7f38dda34b tags: fix abababa case, with test case
Matt Mackall <mpm@selenic.com>
parents: 4213
diff changeset
153 hg add foo
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
154 hg ci -m 'add foo' # rev 0
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
155 hg tag -f bar # rev 1 bar -> 0
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
156 hg tag -f bar # rev 2 bar -> 1
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
157 hg tag -fr 0 bar # rev 3 bar -> 0
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
158 hg tag -fr 1 bar # rev 4 bar -> 1
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
159 hg tag -fr 0 bar # rev 5 bar -> 0
4266
fe7f38dda34b tags: fix abababa case, with test case
Matt Mackall <mpm@selenic.com>
parents: 4213
diff changeset
160 hg tags
fe7f38dda34b tags: fix abababa case, with test case
Matt Mackall <mpm@selenic.com>
parents: 4213
diff changeset
161 hg co 3
fe7f38dda34b tags: fix abababa case, with test case
Matt Mackall <mpm@selenic.com>
parents: 4213
diff changeset
162 echo barbar > foo
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
163 hg ci -m 'change foo' # rev 6
4266
fe7f38dda34b tags: fix abababa case, with test case
Matt Mackall <mpm@selenic.com>
parents: 4213
diff changeset
164 hg tags
4267
8185a1ca8628 tags: require -f to replace an existing tag
Matt Mackall <mpm@selenic.com>
parents: 4266
diff changeset
165
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
166 echo "% don't allow moving tag without -f"
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
167 hg tag -r 3 bar
4482
99f411ba0380 use .extend instead of .append in readtags
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4267
diff changeset
168 hg tags
99f411ba0380 use .extend instead of .append in readtags
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4267
diff changeset
169
9144
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
170 echo "% strip 1: expose an old head"
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
171 hg --config extensions.mq= strip 5 > /dev/null 2>&1
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
172 hg tags # partly stale cache
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
173 hg tags # up-to-date cache
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
174 echo "% strip 2: destroy whole branch, no old head exposed"
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
175 hg --config extensions.mq= strip 4 > /dev/null 2>&1
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
176 hg tags # partly stale
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
177 rm -f .hg/tags.cache
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
178 hg tags # cold cache
ad72e3b08bc0 test-tags: enhance the test to probe tag caching better (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 9143
diff changeset
179
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
180 echo "% test tag rank with 3 heads"
4482
99f411ba0380 use .extend instead of .append in readtags
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4267
diff changeset
181 cd ..
99f411ba0380 use .extend instead of .append in readtags
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4267
diff changeset
182 hg init t4
99f411ba0380 use .extend instead of .append in readtags
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4267
diff changeset
183 cd t4
99f411ba0380 use .extend instead of .append in readtags
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4267
diff changeset
184 echo foo > foo
99f411ba0380 use .extend instead of .append in readtags
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4267
diff changeset
185 hg add
5524
453acf64f71f run-tests.py: add a default --date "0 0" argument to commit et al
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4659
diff changeset
186 hg ci -m 'add foo' # rev 0
453acf64f71f run-tests.py: add a default --date "0 0" argument to commit et al
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4659
diff changeset
187 hg tag bar # rev 1 bar -> 0
453acf64f71f run-tests.py: add a default --date "0 0" argument to commit et al
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4659
diff changeset
188 hg tag -f bar # rev 2 bar -> 1
4482
99f411ba0380 use .extend instead of .append in readtags
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4267
diff changeset
189 hg up -qC 0
5524
453acf64f71f run-tests.py: add a default --date "0 0" argument to commit et al
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4659
diff changeset
190 hg tag -fr 2 bar # rev 3 bar -> 2
4482
99f411ba0380 use .extend instead of .append in readtags
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4267
diff changeset
191 hg tags
99f411ba0380 use .extend instead of .append in readtags
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4267
diff changeset
192 hg up -qC 0
5524
453acf64f71f run-tests.py: add a default --date "0 0" argument to commit et al
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4659
diff changeset
193 hg tag -m 'retag rev 0' -fr 0 bar # rev 4 bar -> 0, but bar stays at 2
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
194 echo "% bar should still point to rev 2"
4482
99f411ba0380 use .extend instead of .append in readtags
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4267
diff changeset
195 hg tags
5657
47915bf68c44 Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents: 5524
diff changeset
196
47915bf68c44 Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents: 5524
diff changeset
197
9143
a604c98dbf62 test-tags: clarify test output; simplify test script a bit (issue548).
Greg Ward <greg-hg@gerg.ca>
parents: 5658
diff changeset
198 echo "% remove local as global and global as local"
5657
47915bf68c44 Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents: 5524
diff changeset
199 # test that removing global/local tags does not get confused when trying
47915bf68c44 Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents: 5524
diff changeset
200 # to remove a tag of type X which actually only exists as a type Y
47915bf68c44 Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents: 5524
diff changeset
201 cd ..
47915bf68c44 Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents: 5524
diff changeset
202 hg init t5
47915bf68c44 Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents: 5524
diff changeset
203 cd t5
47915bf68c44 Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents: 5524
diff changeset
204 echo foo > foo
47915bf68c44 Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents: 5524
diff changeset
205 hg add
47915bf68c44 Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents: 5524
diff changeset
206 hg ci -m 'add foo' # rev 0
47915bf68c44 Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents: 5524
diff changeset
207
47915bf68c44 Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents: 5524
diff changeset
208 hg tag -r 0 -l localtag
47915bf68c44 Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents: 5524
diff changeset
209 hg tag --remove localtag
47915bf68c44 Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents: 5524
diff changeset
210
47915bf68c44 Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents: 5524
diff changeset
211 hg tag -r 0 globaltag
47915bf68c44 Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents: 5524
diff changeset
212 hg tag --remove -l globaltag
5658
ae3089cefaab Add --verbose support to tags command.
Osku Salerma <osku@iki.fi>
parents: 5657
diff changeset
213 hg tags -v
5657
47915bf68c44 Properly check tag's existence as a local/global tag when removing it.
Osku Salerma <osku@iki.fi>
parents: 5524
diff changeset
214 exit 0