Show More
@@ -1,124 +1,128 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | mkdir t |
|
3 | mkdir t | |
4 | cd t |
|
4 | cd t | |
5 | hg init |
|
5 | hg init | |
6 | hg id |
|
6 | hg id | |
7 | echo a > a |
|
7 | echo a > a | |
8 | hg add a |
|
8 | hg add a | |
9 | hg commit -m "test" -d "1000000 0" |
|
9 | hg commit -m "test" -d "1000000 0" | |
10 | hg co |
|
10 | hg co | |
11 | hg identify |
|
11 | hg identify | |
12 | T=`hg tip --debug | head -n 1 | cut -d : -f 3` |
|
12 | T=`hg tip --debug | head -n 1 | cut -d : -f 3` | |
13 | hg tag -l "This is a local tag with a really long name!" |
|
13 | hg tag -l "This is a local tag with a really long name!" | |
14 | hg tags |
|
14 | hg tags | |
15 | rm .hg/localtags |
|
15 | rm .hg/localtags | |
16 | echo "$T first" > .hgtags |
|
16 | echo "$T first" > .hgtags | |
17 | cat .hgtags |
|
17 | cat .hgtags | |
18 | hg add .hgtags |
|
18 | hg add .hgtags | |
19 | hg commit -m "add tags" -d "1000000 0" |
|
19 | hg commit -m "add tags" -d "1000000 0" | |
20 | hg tags |
|
20 | hg tags | |
21 | hg identify |
|
21 | hg identify | |
22 | echo bb > a |
|
22 | echo bb > a | |
23 | hg status |
|
23 | hg status | |
24 | hg identify |
|
24 | hg identify | |
25 | hg co first |
|
25 | hg co first | |
26 | hg id |
|
26 | hg id | |
27 | hg -v id |
|
27 | hg -v id | |
28 | hg status |
|
28 | hg status | |
29 | echo 1 > b |
|
29 | echo 1 > b | |
30 | hg add b |
|
30 | hg add b | |
31 | hg commit -m "branch" -d "1000000 0" |
|
31 | hg commit -m "branch" -d "1000000 0" | |
32 | hg id |
|
32 | hg id | |
33 | hg merge 1 |
|
33 | hg merge 1 | |
34 | hg id |
|
34 | hg id | |
35 | hg status |
|
35 | hg status | |
36 |
|
36 | |||
37 | hg commit -m "merge" -d "1000000 0" |
|
37 | hg commit -m "merge" -d "1000000 0" | |
38 |
|
38 | |||
39 | # create fake head, make sure tag not visible afterwards |
|
39 | # create fake head, make sure tag not visible afterwards | |
40 | cp .hgtags tags |
|
40 | cp .hgtags tags | |
41 | hg tag -d "1000000 0" last |
|
41 | hg tag -d "1000000 0" last | |
42 | hg rm .hgtags |
|
42 | hg rm .hgtags | |
43 | hg commit -m "remove" -d "1000000 0" |
|
43 | hg commit -m "remove" -d "1000000 0" | |
44 |
|
44 | |||
45 | mv tags .hgtags |
|
45 | mv tags .hgtags | |
46 | hg add .hgtags |
|
46 | hg add .hgtags | |
47 | hg commit -m "readd" -d "1000000 0" |
|
47 | hg commit -m "readd" -d "1000000 0" | |
48 |
|
48 | |||
49 | hg tags |
|
49 | hg tags | |
50 |
|
50 | |||
51 | # invalid tags |
|
51 | # invalid tags | |
52 | echo "spam" >> .hgtags |
|
52 | echo "spam" >> .hgtags | |
53 | echo >> .hgtags |
|
53 | echo >> .hgtags | |
54 | echo "foo bar" >> .hgtags |
|
54 | echo "foo bar" >> .hgtags | |
55 | echo "$T invalid" | sed "s/..../a5a5/" >> .hg/localtags |
|
55 | echo "$T invalid" | sed "s/..../a5a5/" >> .hg/localtags | |
56 | hg commit -m "tags" -d "1000000 0" |
|
56 | hg commit -m "tags" -d "1000000 0" | |
57 |
|
57 | |||
58 | # report tag parse error on other head |
|
58 | # report tag parse error on other head | |
59 | hg up 3 |
|
59 | hg up 3 | |
60 | echo 'x y' >> .hgtags |
|
60 | echo 'x y' >> .hgtags | |
61 | hg commit -m "head" -d "1000000 0" |
|
61 | hg commit -m "head" -d "1000000 0" | |
62 |
|
62 | |||
63 | hg tags |
|
63 | hg tags | |
64 | hg tip |
|
64 | hg tip | |
65 |
|
65 | |||
66 | # test tag precedence rules |
|
66 | # test tag precedence rules | |
67 | cd .. |
|
67 | cd .. | |
68 | hg init t2 |
|
68 | hg init t2 | |
69 | cd t2 |
|
69 | cd t2 | |
70 | echo foo > foo |
|
70 | echo foo > foo | |
71 | hg add foo |
|
71 | hg add foo | |
72 | hg ci -m 'add foo' -d '1000000 0' # rev 0 |
|
72 | hg ci -m 'add foo' -d '1000000 0' # rev 0 | |
73 | hg tag -d '1000000 0' bar # rev 1 |
|
73 | hg tag -d '1000000 0' bar # rev 1 | |
74 | echo >> foo |
|
74 | echo >> foo | |
75 | hg ci -m 'change foo 1' -d '1000000 0' # rev 2 |
|
75 | hg ci -m 'change foo 1' -d '1000000 0' # rev 2 | |
76 | hg up -C 1 |
|
76 | hg up -C 1 | |
77 | hg tag -r 1 -d '1000000 0' -f bar # rev 3 |
|
77 | hg tag -r 1 -d '1000000 0' -f bar # rev 3 | |
78 | hg up -C 1 |
|
78 | hg up -C 1 | |
79 | echo >> foo |
|
79 | echo >> foo | |
80 | hg ci -m 'change foo 2' -d '1000000 0' # rev 4 |
|
80 | hg ci -m 'change foo 2' -d '1000000 0' # rev 4 | |
81 | hg tags |
|
81 | hg tags | |
82 |
|
82 | |||
83 | # test tag removal |
|
83 | # test tag removal | |
84 | hg tag --remove -d '1000000 0' bar |
|
84 | hg tag --remove -d '1000000 0' bar | |
85 | hg tip |
|
85 | hg tip | |
86 | hg tags |
|
86 | hg tags | |
87 |
|
87 | |||
|
88 | echo '% remove nonexistent tag' | |||
|
89 | hg tag --remove -d '1000000 0' foobar | |||
|
90 | hg tip | |||
|
91 | ||||
88 | # test tag rank |
|
92 | # test tag rank | |
89 | cd .. |
|
93 | cd .. | |
90 | hg init t3 |
|
94 | hg init t3 | |
91 | cd t3 |
|
95 | cd t3 | |
92 | echo foo > foo |
|
96 | echo foo > foo | |
93 | hg add foo |
|
97 | hg add foo | |
94 | hg ci -m 'add foo' -d '1000000 0' # rev 0 |
|
98 | hg ci -m 'add foo' -d '1000000 0' # rev 0 | |
95 | hg tag -d '1000000 0' -f bar # rev 1 bar -> 0 |
|
99 | hg tag -d '1000000 0' -f bar # rev 1 bar -> 0 | |
96 | hg tag -d '1000000 0' -f bar # rev 2 bar -> 1 |
|
100 | hg tag -d '1000000 0' -f bar # rev 2 bar -> 1 | |
97 | hg tag -d '1000000 0' -fr 0 bar # rev 3 bar -> 0 |
|
101 | hg tag -d '1000000 0' -fr 0 bar # rev 3 bar -> 0 | |
98 | hg tag -d '1000000 0' -fr 1 bar # rev 3 bar -> 1 |
|
102 | hg tag -d '1000000 0' -fr 1 bar # rev 3 bar -> 1 | |
99 | hg tag -d '1000000 0' -fr 0 bar # rev 4 bar -> 0 |
|
103 | hg tag -d '1000000 0' -fr 0 bar # rev 4 bar -> 0 | |
100 | hg tags |
|
104 | hg tags | |
101 | hg co 3 |
|
105 | hg co 3 | |
102 | echo barbar > foo |
|
106 | echo barbar > foo | |
103 | hg ci -m 'change foo' -d '1000000 0' # rev 0 |
|
107 | hg ci -m 'change foo' -d '1000000 0' # rev 0 | |
104 | hg tags |
|
108 | hg tags | |
105 |
|
109 | |||
106 | hg tag -d '1000000 0' -r 3 bar # should complain |
|
110 | hg tag -d '1000000 0' -r 3 bar # should complain | |
107 | hg tags |
|
111 | hg tags | |
108 |
|
112 | |||
109 | # test tag rank with 3 heads |
|
113 | # test tag rank with 3 heads | |
110 | cd .. |
|
114 | cd .. | |
111 | hg init t4 |
|
115 | hg init t4 | |
112 | cd t4 |
|
116 | cd t4 | |
113 | echo foo > foo |
|
117 | echo foo > foo | |
114 | hg add |
|
118 | hg add | |
115 | hg ci -m 'add foo' -d '0 0' # rev 0 |
|
119 | hg ci -m 'add foo' -d '0 0' # rev 0 | |
116 | hg tag -d '0 0' bar # rev 1 bar -> 0 |
|
120 | hg tag -d '0 0' bar # rev 1 bar -> 0 | |
117 | hg tag -d '0 0' -f bar # rev 2 bar -> 1 |
|
121 | hg tag -d '0 0' -f bar # rev 2 bar -> 1 | |
118 | hg up -qC 0 |
|
122 | hg up -qC 0 | |
119 | hg tag -d '0 0' -fr 2 bar # rev 3 bar -> 2 |
|
123 | hg tag -d '0 0' -fr 2 bar # rev 3 bar -> 2 | |
120 | hg tags |
|
124 | hg tags | |
121 | hg up -qC 0 |
|
125 | hg up -qC 0 | |
122 | hg tag -d '0 0' -m 'retag rev 0' -fr 0 bar # rev 4 bar -> 0, but bar stays at 2 |
|
126 | hg tag -d '0 0' -m 'retag rev 0' -fr 0 bar # rev 4 bar -> 0, but bar stays at 2 | |
123 | echo % bar should still point to rev 2 |
|
127 | echo % bar should still point to rev 2 | |
124 | hg tags |
|
128 | hg tags |
@@ -1,65 +1,73 b'' | |||||
1 | unknown |
|
1 | unknown | |
2 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
2 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
3 | 0acdaf898367 tip |
|
3 | 0acdaf898367 tip | |
4 | tip 0:0acdaf898367 |
|
4 | tip 0:0acdaf898367 | |
5 | This is a local tag with a really long name! 0:0acdaf898367 |
|
5 | This is a local tag with a really long name! 0:0acdaf898367 | |
6 | 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 first |
|
6 | 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 first | |
7 | tip 1:8a3ca90d111d |
|
7 | tip 1:8a3ca90d111d | |
8 | first 0:0acdaf898367 |
|
8 | first 0:0acdaf898367 | |
9 | 8a3ca90d111d tip |
|
9 | 8a3ca90d111d tip | |
10 | M a |
|
10 | M a | |
11 | 8a3ca90d111d+ tip |
|
11 | 8a3ca90d111d+ tip | |
12 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
12 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
13 | 0acdaf898367+ first |
|
13 | 0acdaf898367+ first | |
14 | 0acdaf898367+ first |
|
14 | 0acdaf898367+ first | |
15 | M a |
|
15 | M a | |
16 | 8216907a933d tip |
|
16 | 8216907a933d tip | |
17 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
17 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
18 | (branch merge, don't forget to commit) |
|
18 | (branch merge, don't forget to commit) | |
19 | 8216907a933d+8a3ca90d111d+ tip |
|
19 | 8216907a933d+8a3ca90d111d+ tip | |
20 | M .hgtags |
|
20 | M .hgtags | |
21 | tip 6:e2174d339386 |
|
21 | tip 6:e2174d339386 | |
22 | first 0:0acdaf898367 |
|
22 | first 0:0acdaf898367 | |
23 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
23 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
24 | .hgtags@c071f74ab5eb, line 2: cannot parse entry |
|
24 | .hgtags@c071f74ab5eb, line 2: cannot parse entry | |
25 | .hgtags@c071f74ab5eb, line 4: node 'foo' is not well formed |
|
25 | .hgtags@c071f74ab5eb, line 4: node 'foo' is not well formed | |
26 | .hgtags@4ca6f1b1a68c, line 2: node 'x' is not well formed |
|
26 | .hgtags@4ca6f1b1a68c, line 2: node 'x' is not well formed | |
27 | localtags, line 1: tag 'invalid' refers to unknown node |
|
27 | localtags, line 1: tag 'invalid' refers to unknown node | |
28 | tip 8:4ca6f1b1a68c |
|
28 | tip 8:4ca6f1b1a68c | |
29 | first 0:0acdaf898367 |
|
29 | first 0:0acdaf898367 | |
30 | changeset: 8:4ca6f1b1a68c |
|
30 | changeset: 8:4ca6f1b1a68c | |
31 | .hgtags@c071f74ab5eb, line 2: cannot parse entry |
|
31 | .hgtags@c071f74ab5eb, line 2: cannot parse entry | |
32 | .hgtags@c071f74ab5eb, line 4: node 'foo' is not well formed |
|
32 | .hgtags@c071f74ab5eb, line 4: node 'foo' is not well formed | |
33 | .hgtags@4ca6f1b1a68c, line 2: node 'x' is not well formed |
|
33 | .hgtags@4ca6f1b1a68c, line 2: node 'x' is not well formed | |
34 | localtags, line 1: tag 'invalid' refers to unknown node |
|
34 | localtags, line 1: tag 'invalid' refers to unknown node | |
35 | tag: tip |
|
35 | tag: tip | |
36 | parent: 3:b2ef3841386b |
|
36 | parent: 3:b2ef3841386b | |
37 | user: test |
|
37 | user: test | |
38 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
38 | date: Mon Jan 12 13:46:40 1970 +0000 | |
39 | summary: head |
|
39 | summary: head | |
40 |
|
40 | |||
41 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
41 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
42 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
42 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
43 | tip 4:36195b728445 |
|
43 | tip 4:36195b728445 | |
44 | bar 1:b204a97e6e8d |
|
44 | bar 1:b204a97e6e8d | |
45 | changeset: 5:57e1983b4a60 |
|
45 | changeset: 5:57e1983b4a60 | |
46 | tag: tip |
|
46 | tag: tip | |
47 | user: test |
|
47 | user: test | |
48 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
48 | date: Mon Jan 12 13:46:40 1970 +0000 | |
49 | summary: Removed tag bar |
|
49 | summary: Removed tag bar | |
50 |
|
50 | |||
51 | tip 5:57e1983b4a60 |
|
51 | tip 5:57e1983b4a60 | |
|
52 | % remove nonexistent tag | |||
|
53 | abort: tag foobar does not exist | |||
|
54 | changeset: 5:57e1983b4a60 | |||
|
55 | tag: tip | |||
|
56 | user: test | |||
|
57 | date: Mon Jan 12 13:46:40 1970 +0000 | |||
|
58 | summary: Removed tag bar | |||
|
59 | ||||
52 | tip 5:d8bb4d1eff25 |
|
60 | tip 5:d8bb4d1eff25 | |
53 | bar 0:b409d9da318e |
|
61 | bar 0:b409d9da318e | |
54 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
62 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
55 | tip 6:b5ff9d142648 |
|
63 | tip 6:b5ff9d142648 | |
56 | bar 0:b409d9da318e |
|
64 | bar 0:b409d9da318e | |
57 | abort: a tag named bar already exists (use -f to force) |
|
65 | abort: a tag named bar already exists (use -f to force) | |
58 | tip 6:b5ff9d142648 |
|
66 | tip 6:b5ff9d142648 | |
59 | bar 0:b409d9da318e |
|
67 | bar 0:b409d9da318e | |
60 | adding foo |
|
68 | adding foo | |
61 | tip 3:ca8479b4351c |
|
69 | tip 3:ca8479b4351c | |
62 | bar 2:72b852876a42 |
|
70 | bar 2:72b852876a42 | |
63 | % bar should still point to rev 2 |
|
71 | % bar should still point to rev 2 | |
64 | tip 4:40af5d225513 |
|
72 | tip 4:40af5d225513 | |
65 | bar 2:72b852876a42 |
|
73 | bar 2:72b852876a42 |
General Comments 0
You need to be logged in to leave comments.
Login now