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