##// END OF EJS Templates
tests: eliminate fast-forward merge in test-tag
Matt Mackall -
r13159:3172da69 default
parent child Browse files
Show More
@@ -1,278 +1,280 b''
1 $ hg init test
1 $ hg init test
2 $ cd test
2 $ cd test
3
3
4 $ echo a > a
4 $ echo a > a
5 $ hg add a
5 $ hg add a
6 $ hg commit -m "test"
6 $ hg commit -m "test"
7 $ hg history
7 $ hg history
8 changeset: 0:acb14030fe0a
8 changeset: 0:acb14030fe0a
9 tag: tip
9 tag: tip
10 user: test
10 user: test
11 date: Thu Jan 01 00:00:00 1970 +0000
11 date: Thu Jan 01 00:00:00 1970 +0000
12 summary: test
12 summary: test
13
13
14
14
15 $ hg tag ' '
15 $ hg tag ' '
16 abort: tag names cannot consist entirely of whitespace
16 abort: tag names cannot consist entirely of whitespace
17 [255]
17 [255]
18
18
19 $ hg tag "bleah"
19 $ hg tag "bleah"
20 $ hg history
20 $ hg history
21 changeset: 1:d4f0d2909abc
21 changeset: 1:d4f0d2909abc
22 tag: tip
22 tag: tip
23 user: test
23 user: test
24 date: Thu Jan 01 00:00:00 1970 +0000
24 date: Thu Jan 01 00:00:00 1970 +0000
25 summary: Added tag bleah for changeset acb14030fe0a
25 summary: Added tag bleah for changeset acb14030fe0a
26
26
27 changeset: 0:acb14030fe0a
27 changeset: 0:acb14030fe0a
28 tag: bleah
28 tag: bleah
29 user: test
29 user: test
30 date: Thu Jan 01 00:00:00 1970 +0000
30 date: Thu Jan 01 00:00:00 1970 +0000
31 summary: test
31 summary: test
32
32
33
33
34 $ echo foo >> .hgtags
34 $ echo foo >> .hgtags
35 $ hg tag "bleah2"
35 $ hg tag "bleah2"
36 abort: working copy of .hgtags is changed (please commit .hgtags manually)
36 abort: working copy of .hgtags is changed (please commit .hgtags manually)
37 [255]
37 [255]
38
38
39 $ hg revert .hgtags
39 $ hg revert .hgtags
40 $ hg tag -r 0 x y z y y z
40 $ hg tag -r 0 x y z y y z
41 abort: tag names must be unique
41 abort: tag names must be unique
42 [255]
42 [255]
43 $ hg tag tap nada dot tip null .
43 $ hg tag tap nada dot tip null .
44 abort: the name 'tip' is reserved
44 abort: the name 'tip' is reserved
45 [255]
45 [255]
46 $ hg tag "bleah"
46 $ hg tag "bleah"
47 abort: tag 'bleah' already exists (use -f to force)
47 abort: tag 'bleah' already exists (use -f to force)
48 [255]
48 [255]
49 $ hg tag "blecch" "bleah"
49 $ hg tag "blecch" "bleah"
50 abort: tag 'bleah' already exists (use -f to force)
50 abort: tag 'bleah' already exists (use -f to force)
51 [255]
51 [255]
52
52
53 $ hg tag --remove "blecch"
53 $ hg tag --remove "blecch"
54 abort: tag 'blecch' does not exist
54 abort: tag 'blecch' does not exist
55 [255]
55 [255]
56 $ hg tag --remove "bleah" "blecch" "blough"
56 $ hg tag --remove "bleah" "blecch" "blough"
57 abort: tag 'blecch' does not exist
57 abort: tag 'blecch' does not exist
58 [255]
58 [255]
59
59
60 $ hg tag -r 0 "bleah0"
60 $ hg tag -r 0 "bleah0"
61 $ hg tag -l -r 1 "bleah1"
61 $ hg tag -l -r 1 "bleah1"
62 $ hg tag gack gawk gorp
62 $ hg tag gack gawk gorp
63 $ hg tag -f gack
63 $ hg tag -f gack
64 $ hg tag --remove gack gorp
64 $ hg tag --remove gack gorp
65
65
66 $ cat .hgtags
66 $ cat .hgtags
67 acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
67 acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
68 acb14030fe0a21b60322c440ad2d20cf7685a376 bleah0
68 acb14030fe0a21b60322c440ad2d20cf7685a376 bleah0
69 336fccc858a4eb69609a291105009e484a6b6b8d gack
69 336fccc858a4eb69609a291105009e484a6b6b8d gack
70 336fccc858a4eb69609a291105009e484a6b6b8d gawk
70 336fccc858a4eb69609a291105009e484a6b6b8d gawk
71 336fccc858a4eb69609a291105009e484a6b6b8d gorp
71 336fccc858a4eb69609a291105009e484a6b6b8d gorp
72 336fccc858a4eb69609a291105009e484a6b6b8d gack
72 336fccc858a4eb69609a291105009e484a6b6b8d gack
73 799667b6f2d9b957f73fa644a918c2df22bab58f gack
73 799667b6f2d9b957f73fa644a918c2df22bab58f gack
74 799667b6f2d9b957f73fa644a918c2df22bab58f gack
74 799667b6f2d9b957f73fa644a918c2df22bab58f gack
75 0000000000000000000000000000000000000000 gack
75 0000000000000000000000000000000000000000 gack
76 336fccc858a4eb69609a291105009e484a6b6b8d gorp
76 336fccc858a4eb69609a291105009e484a6b6b8d gorp
77 0000000000000000000000000000000000000000 gorp
77 0000000000000000000000000000000000000000 gorp
78 $ cat .hg/localtags
78 $ cat .hg/localtags
79 d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
79 d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
80
80
81 tagging on a non-head revision
81 tagging on a non-head revision
82
82
83 $ hg update 0
83 $ hg update 0
84 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
84 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
85 $ hg tag -l localblah
85 $ hg tag -l localblah
86 $ hg tag "foobar"
86 $ hg tag "foobar"
87 abort: not at a branch head (use -f to force)
87 abort: not at a branch head (use -f to force)
88 [255]
88 [255]
89 $ hg tag -f "foobar"
89 $ hg tag -f "foobar"
90 $ cat .hgtags
90 $ cat .hgtags
91 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
91 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
92 $ cat .hg/localtags
92 $ cat .hg/localtags
93 d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
93 d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
94 acb14030fe0a21b60322c440ad2d20cf7685a376 localblah
94 acb14030fe0a21b60322c440ad2d20cf7685a376 localblah
95
95
96 $ hg tag -l 'xx
96 $ hg tag -l 'xx
97 > newline'
97 > newline'
98 abort: '\n' cannot be used in a tag name
98 abort: '\n' cannot be used in a tag name
99 [255]
99 [255]
100 $ hg tag -l 'xx:xx'
100 $ hg tag -l 'xx:xx'
101 abort: ':' cannot be used in a tag name
101 abort: ':' cannot be used in a tag name
102 [255]
102 [255]
103
103
104 cloning local tags
104 cloning local tags
105
105
106 $ cd ..
106 $ cd ..
107 $ hg -R test log -r0:5
107 $ hg -R test log -r0:5
108 changeset: 0:acb14030fe0a
108 changeset: 0:acb14030fe0a
109 tag: bleah
109 tag: bleah
110 tag: bleah0
110 tag: bleah0
111 tag: foobar
111 tag: foobar
112 tag: localblah
112 tag: localblah
113 user: test
113 user: test
114 date: Thu Jan 01 00:00:00 1970 +0000
114 date: Thu Jan 01 00:00:00 1970 +0000
115 summary: test
115 summary: test
116
116
117 changeset: 1:d4f0d2909abc
117 changeset: 1:d4f0d2909abc
118 tag: bleah1
118 tag: bleah1
119 user: test
119 user: test
120 date: Thu Jan 01 00:00:00 1970 +0000
120 date: Thu Jan 01 00:00:00 1970 +0000
121 summary: Added tag bleah for changeset acb14030fe0a
121 summary: Added tag bleah for changeset acb14030fe0a
122
122
123 changeset: 2:336fccc858a4
123 changeset: 2:336fccc858a4
124 tag: gawk
124 tag: gawk
125 user: test
125 user: test
126 date: Thu Jan 01 00:00:00 1970 +0000
126 date: Thu Jan 01 00:00:00 1970 +0000
127 summary: Added tag bleah0 for changeset acb14030fe0a
127 summary: Added tag bleah0 for changeset acb14030fe0a
128
128
129 changeset: 3:799667b6f2d9
129 changeset: 3:799667b6f2d9
130 user: test
130 user: test
131 date: Thu Jan 01 00:00:00 1970 +0000
131 date: Thu Jan 01 00:00:00 1970 +0000
132 summary: Added tag gack, gawk, gorp for changeset 336fccc858a4
132 summary: Added tag gack, gawk, gorp for changeset 336fccc858a4
133
133
134 changeset: 4:154eeb7c0138
134 changeset: 4:154eeb7c0138
135 user: test
135 user: test
136 date: Thu Jan 01 00:00:00 1970 +0000
136 date: Thu Jan 01 00:00:00 1970 +0000
137 summary: Added tag gack for changeset 799667b6f2d9
137 summary: Added tag gack for changeset 799667b6f2d9
138
138
139 changeset: 5:b4bb47aaff09
139 changeset: 5:b4bb47aaff09
140 user: test
140 user: test
141 date: Thu Jan 01 00:00:00 1970 +0000
141 date: Thu Jan 01 00:00:00 1970 +0000
142 summary: Removed tag gack, gorp
142 summary: Removed tag gack, gorp
143
143
144 $ hg clone -q -rbleah1 test test1
144 $ hg clone -q -rbleah1 test test1
145 $ hg -R test1 parents --style=compact
145 $ hg -R test1 parents --style=compact
146 1[tip] d4f0d2909abc 1970-01-01 00:00 +0000 test
146 1[tip] d4f0d2909abc 1970-01-01 00:00 +0000 test
147 Added tag bleah for changeset acb14030fe0a
147 Added tag bleah for changeset acb14030fe0a
148
148
149 $ hg clone -q -r5 test#bleah1 test2
149 $ hg clone -q -r5 test#bleah1 test2
150 $ hg -R test2 parents --style=compact
150 $ hg -R test2 parents --style=compact
151 5[tip] b4bb47aaff09 1970-01-01 00:00 +0000 test
151 5[tip] b4bb47aaff09 1970-01-01 00:00 +0000 test
152 Removed tag gack, gorp
152 Removed tag gack, gorp
153
153
154 $ hg clone -q -U test#bleah1 test3
154 $ hg clone -q -U test#bleah1 test3
155 $ hg -R test3 parents --style=compact
155 $ hg -R test3 parents --style=compact
156
156
157 $ cd test
157 $ cd test
158
158
159 Issue601: hg tag doesn't do the right thing if .hgtags or localtags
159 Issue601: hg tag doesn't do the right thing if .hgtags or localtags
160 doesn't end with EOL
160 doesn't end with EOL
161
161
162 $ python << EOF
162 $ python << EOF
163 > f = file('.hg/localtags'); last = f.readlines()[-1][:-1]; f.close()
163 > f = file('.hg/localtags'); last = f.readlines()[-1][:-1]; f.close()
164 > f = file('.hg/localtags', 'w'); f.write(last); f.close()
164 > f = file('.hg/localtags', 'w'); f.write(last); f.close()
165 > EOF
165 > EOF
166 $ cat .hg/localtags; echo
166 $ cat .hg/localtags; echo
167 acb14030fe0a21b60322c440ad2d20cf7685a376 localblah
167 acb14030fe0a21b60322c440ad2d20cf7685a376 localblah
168 $ hg tag -l localnewline
168 $ hg tag -l localnewline
169 $ cat .hg/localtags; echo
169 $ cat .hg/localtags; echo
170 acb14030fe0a21b60322c440ad2d20cf7685a376 localblah
170 acb14030fe0a21b60322c440ad2d20cf7685a376 localblah
171 c2899151f4e76890c602a2597a650a72666681bf localnewline
171 c2899151f4e76890c602a2597a650a72666681bf localnewline
172
172
173
173
174 $ python << EOF
174 $ python << EOF
175 > f = file('.hgtags'); last = f.readlines()[-1][:-1]; f.close()
175 > f = file('.hgtags'); last = f.readlines()[-1][:-1]; f.close()
176 > f = file('.hgtags', 'w'); f.write(last); f.close()
176 > f = file('.hgtags', 'w'); f.write(last); f.close()
177 > EOF
177 > EOF
178 $ hg ci -m'broken manual edit of .hgtags'
178 $ hg ci -m'broken manual edit of .hgtags'
179 $ cat .hgtags; echo
179 $ cat .hgtags; echo
180 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
180 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
181 $ hg tag newline
181 $ hg tag newline
182 $ cat .hgtags; echo
182 $ cat .hgtags; echo
183 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
183 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
184 a0eea09de1eeec777b46f2085260a373b2fbc293 newline
184 a0eea09de1eeec777b46f2085260a373b2fbc293 newline
185
185
186
186
187 tag and branch using same name
187 tag and branch using same name
188
188
189 $ hg branch tag-and-branch-same-name
189 $ hg branch tag-and-branch-same-name
190 marked working directory as branch tag-and-branch-same-name
190 marked working directory as branch tag-and-branch-same-name
191 $ hg ci -m"discouraged"
191 $ hg ci -m"discouraged"
192 $ hg tag tag-and-branch-same-name
192 $ hg tag tag-and-branch-same-name
193 warning: tag tag-and-branch-same-name conflicts with existing branch name
193 warning: tag tag-and-branch-same-name conflicts with existing branch name
194
194
195 test custom commit messages
195 test custom commit messages
196
196
197 $ cat > editor << '__EOF__'
197 $ cat > editor << '__EOF__'
198 > #!/bin/sh
198 > #!/bin/sh
199 > echo "custom tag message" > "$1"
199 > echo "custom tag message" > "$1"
200 > echo "second line" >> "$1"
200 > echo "second line" >> "$1"
201 > __EOF__
201 > __EOF__
202 $ chmod +x editor
202 $ chmod +x editor
203 $ HGEDITOR="'`pwd`'"/editor hg tag custom-tag -e
203 $ HGEDITOR="'`pwd`'"/editor hg tag custom-tag -e
204 $ hg log -l1 --template "{desc}\n"
204 $ hg log -l1 --template "{desc}\n"
205 custom tag message
205 custom tag message
206 second line
206 second line
207
207
208
208
209 local tag with .hgtags modified
209 local tag with .hgtags modified
210
210
211 $ hg tag hgtags-modified
211 $ hg tag hgtags-modified
212 $ hg rollback
212 $ hg rollback
213 rolling back to revision 11 (undo commit)
213 rolling back to revision 11 (undo commit)
214 $ hg st
214 $ hg st
215 M .hgtags
215 M .hgtags
216 ? .hgtags.orig
216 ? .hgtags.orig
217 ? editor
217 ? editor
218 $ hg tag --local baz
218 $ hg tag --local baz
219 $ hg revert --no-backup .hgtags
219 $ hg revert --no-backup .hgtags
220
220
221
221
222 tagging when at named-branch-head that's not a topo-head
222 tagging when at named-branch-head that's not a topo-head
223
223
224 $ hg up default
224 $ hg up default
225 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
225 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
226 $ hg merge -t internal:local
226 $ hg merge -t internal:local
227 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
227 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
228 (branch merge, don't forget to commit)
228 (branch merge, don't forget to commit)
229 $ hg ci -m 'merge named branch'
229 $ hg ci -m 'merge named branch'
230 $ hg up 11
230 $ hg up 11
231 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
231 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
232 $ hg tag new-topo-head
232 $ hg tag new-topo-head
233
233
234
234
235 tagging on null rev
235 tagging on null rev
236
236
237 $ hg up null
237 $ hg up null
238 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
238 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
239 $ hg tag nullrev
239 $ hg tag nullrev
240 abort: not at a branch head (use -f to force)
240 abort: not at a branch head (use -f to force)
241 [255]
241 [255]
242
242
243 $ hg init empty
243 $ hg init empty
244 $ hg tag -R empty nullrev
244 $ hg tag -R empty nullrev
245
245
246 $ cd ..
246 $ cd ..
247
247
248 tagging on an uncommitted merge (issue2542)
248 tagging on an uncommitted merge (issue2542)
249
249
250 $ hg init repo-tag-uncommitted-merge
250 $ hg init repo-tag-uncommitted-merge
251 $ cd repo-tag-uncommitted-merge
251 $ cd repo-tag-uncommitted-merge
252 $ echo c1 > f1
252 $ echo c1 > f1
253 $ hg ci -Am0
253 $ hg ci -Am0
254 adding f1
254 adding f1
255 $ echo c2 > f2
256 $ hg ci -Am1
257 adding f2
258 $ hg co -q 0
255 $ hg branch b1
259 $ hg branch b1
256 marked working directory as branch b1
260 marked working directory as branch b1
257 $ echo c2 >> f1
261 $ hg ci -m2
258 $ hg ci -m1
259 $ hg up default
262 $ hg up default
260 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
261 $ hg merge b1
264 $ hg merge b1
262 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
265 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 (branch merge, don't forget to commit)
266 (branch merge, don't forget to commit)
264
267
265 $ hg tag t1
268 $ hg tag t1
266 abort: uncommitted merge
269 abort: uncommitted merge
267 [255]
270 [255]
268 $ hg status
271 $ hg status
269 M f1
270 $ hg tag --rev 1 t2
272 $ hg tag --rev 1 t2
271 abort: uncommitted merge
273 abort: uncommitted merge
272 [255]
274 [255]
273 $ hg tag --rev 1 --local t3
275 $ hg tag --rev 1 --local t3
274 $ hg tags -v
276 $ hg tags -v
275 tip 1:9466ada9ee90
277 tip 2:8a8f787d0d5c
276 t3 1:9466ada9ee90 local
278 t3 1:c3adabd1a5f4 local
277
279
278 $ cd ..
280 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now