Show More
@@ -1,612 +1,615 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 | (this tests also that editor is not invoked, if '--edit' is not |
|
20 | 20 | specified) |
|
21 | 21 | |
|
22 | 22 | $ HGEDITOR=cat hg tag "bleah" |
|
23 | 23 | $ hg history |
|
24 | 24 | changeset: 1:d4f0d2909abc |
|
25 | 25 | tag: tip |
|
26 | 26 | user: test |
|
27 | 27 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
28 | 28 | summary: Added tag bleah for changeset acb14030fe0a |
|
29 | 29 | |
|
30 | 30 | changeset: 0:acb14030fe0a |
|
31 | 31 | tag: bleah |
|
32 | 32 | user: test |
|
33 | 33 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
34 | 34 | summary: test |
|
35 | 35 | |
|
36 | 36 | |
|
37 | 37 | $ echo foo >> .hgtags |
|
38 | 38 | $ hg tag "bleah2" |
|
39 | 39 | abort: working copy of .hgtags is changed |
|
40 | 40 | (please commit .hgtags manually) |
|
41 | 41 | [255] |
|
42 | 42 | |
|
43 | 43 | $ hg revert .hgtags |
|
44 | 44 | $ hg tag -r 0 x y z y y z |
|
45 | 45 | abort: tag names must be unique |
|
46 | 46 | [255] |
|
47 | 47 | $ hg tag tap nada dot tip |
|
48 | 48 | abort: the name 'tip' is reserved |
|
49 | 49 | [255] |
|
50 | 50 | $ hg tag . |
|
51 | 51 | abort: the name '.' is reserved |
|
52 | 52 | [255] |
|
53 | 53 | $ hg tag null |
|
54 | 54 | abort: the name 'null' is reserved |
|
55 | 55 | [255] |
|
56 | 56 | $ hg tag "bleah" |
|
57 | 57 | abort: tag 'bleah' already exists (use -f to force) |
|
58 | 58 | [255] |
|
59 | 59 | $ hg tag "blecch" "bleah" |
|
60 | 60 | abort: tag 'bleah' already exists (use -f to force) |
|
61 | 61 | [255] |
|
62 | 62 | |
|
63 | 63 | $ hg tag --remove "blecch" |
|
64 | 64 | abort: tag 'blecch' does not exist |
|
65 | 65 | [255] |
|
66 | 66 | $ hg tag --remove "bleah" "blecch" "blough" |
|
67 | 67 | abort: tag 'blecch' does not exist |
|
68 | 68 | [255] |
|
69 | 69 | |
|
70 | 70 | $ hg tag -r 0 "bleah0" |
|
71 | 71 | $ hg tag -l -r 1 "bleah1" |
|
72 | 72 | $ hg tag gack gawk gorp |
|
73 | 73 | $ hg tag -f gack |
|
74 | 74 | $ hg tag --remove gack gorp |
|
75 | 75 | |
|
76 | 76 | $ hg tag "bleah " |
|
77 | 77 | abort: tag 'bleah' already exists (use -f to force) |
|
78 | 78 | [255] |
|
79 | 79 | $ hg tag " bleah" |
|
80 | 80 | abort: tag 'bleah' already exists (use -f to force) |
|
81 | 81 | [255] |
|
82 | 82 | $ hg tag " bleah" |
|
83 | 83 | abort: tag 'bleah' already exists (use -f to force) |
|
84 | 84 | [255] |
|
85 | 85 | $ hg tag -r 0 " bleahbleah " |
|
86 | 86 | $ hg tag -r 0 " bleah bleah " |
|
87 | 87 | |
|
88 | 88 | $ cat .hgtags |
|
89 | 89 | acb14030fe0a21b60322c440ad2d20cf7685a376 bleah |
|
90 | 90 | acb14030fe0a21b60322c440ad2d20cf7685a376 bleah0 |
|
91 | 91 | 336fccc858a4eb69609a291105009e484a6b6b8d gack |
|
92 | 92 | 336fccc858a4eb69609a291105009e484a6b6b8d gawk |
|
93 | 93 | 336fccc858a4eb69609a291105009e484a6b6b8d gorp |
|
94 | 94 | 336fccc858a4eb69609a291105009e484a6b6b8d gack |
|
95 | 95 | 799667b6f2d9b957f73fa644a918c2df22bab58f gack |
|
96 | 96 | 799667b6f2d9b957f73fa644a918c2df22bab58f gack |
|
97 | 97 | 0000000000000000000000000000000000000000 gack |
|
98 | 98 | 336fccc858a4eb69609a291105009e484a6b6b8d gorp |
|
99 | 99 | 0000000000000000000000000000000000000000 gorp |
|
100 | 100 | acb14030fe0a21b60322c440ad2d20cf7685a376 bleahbleah |
|
101 | 101 | acb14030fe0a21b60322c440ad2d20cf7685a376 bleah bleah |
|
102 | 102 | |
|
103 | 103 | $ cat .hg/localtags |
|
104 | 104 | d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1 |
|
105 | 105 | |
|
106 | 106 | tagging on a non-head revision |
|
107 | 107 | |
|
108 | 108 | $ hg update 0 |
|
109 | 109 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
110 | 110 | $ hg tag -l localblah |
|
111 | 111 | $ hg tag "foobar" |
|
112 | 112 | abort: not at a branch head (use -f to force) |
|
113 | 113 | [255] |
|
114 | 114 | $ hg tag -f "foobar" |
|
115 | 115 | $ cat .hgtags |
|
116 | 116 | acb14030fe0a21b60322c440ad2d20cf7685a376 foobar |
|
117 | 117 | $ cat .hg/localtags |
|
118 | 118 | d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1 |
|
119 | 119 | acb14030fe0a21b60322c440ad2d20cf7685a376 localblah |
|
120 | 120 | |
|
121 | 121 | $ hg tag -l 'xx |
|
122 | 122 | > newline' |
|
123 | 123 | abort: '\n' cannot be used in a name |
|
124 | 124 | [255] |
|
125 | 125 | $ hg tag -l 'xx:xx' |
|
126 | 126 | abort: ':' cannot be used in a name |
|
127 | 127 | [255] |
|
128 | 128 | |
|
129 | 129 | cloning local tags |
|
130 | 130 | |
|
131 | 131 | $ cd .. |
|
132 | 132 | $ hg -R test log -r0:5 |
|
133 | 133 | changeset: 0:acb14030fe0a |
|
134 | 134 | tag: bleah |
|
135 | 135 | tag: bleah bleah |
|
136 | 136 | tag: bleah0 |
|
137 | 137 | tag: bleahbleah |
|
138 | 138 | tag: foobar |
|
139 | 139 | tag: localblah |
|
140 | 140 | user: test |
|
141 | 141 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
142 | 142 | summary: test |
|
143 | 143 | |
|
144 | 144 | changeset: 1:d4f0d2909abc |
|
145 | 145 | tag: bleah1 |
|
146 | 146 | user: test |
|
147 | 147 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
148 | 148 | summary: Added tag bleah for changeset acb14030fe0a |
|
149 | 149 | |
|
150 | 150 | changeset: 2:336fccc858a4 |
|
151 | 151 | tag: gawk |
|
152 | 152 | user: test |
|
153 | 153 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
154 | 154 | summary: Added tag bleah0 for changeset acb14030fe0a |
|
155 | 155 | |
|
156 | 156 | changeset: 3:799667b6f2d9 |
|
157 | 157 | user: test |
|
158 | 158 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
159 | 159 | summary: Added tag gack, gawk, gorp for changeset 336fccc858a4 |
|
160 | 160 | |
|
161 | 161 | changeset: 4:154eeb7c0138 |
|
162 | 162 | user: test |
|
163 | 163 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
164 | 164 | summary: Added tag gack for changeset 799667b6f2d9 |
|
165 | 165 | |
|
166 | 166 | changeset: 5:b4bb47aaff09 |
|
167 | 167 | user: test |
|
168 | 168 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
169 | 169 | summary: Removed tag gack, gorp |
|
170 | 170 | |
|
171 | 171 | $ hg clone -q -rbleah1 test test1 |
|
172 | 172 | $ hg -R test1 parents --style=compact |
|
173 | 173 | 1[tip] d4f0d2909abc 1970-01-01 00:00 +0000 test |
|
174 | 174 | Added tag bleah for changeset acb14030fe0a |
|
175 | 175 | |
|
176 | 176 | $ hg clone -q -r5 test#bleah1 test2 |
|
177 | 177 | $ hg -R test2 parents --style=compact |
|
178 | 178 | 5[tip] b4bb47aaff09 1970-01-01 00:00 +0000 test |
|
179 | 179 | Removed tag gack, gorp |
|
180 | 180 | |
|
181 | 181 | $ hg clone -q -U test#bleah1 test3 |
|
182 | 182 | $ hg -R test3 parents --style=compact |
|
183 | 183 | |
|
184 | 184 | $ cd test |
|
185 | 185 | |
|
186 | 186 | Issue601: hg tag doesn't do the right thing if .hgtags or localtags |
|
187 | 187 | doesn't end with EOL |
|
188 | 188 | |
|
189 | 189 | $ python << EOF |
|
190 | 190 | > f = file('.hg/localtags'); last = f.readlines()[-1][:-1]; f.close() |
|
191 | 191 | > f = file('.hg/localtags', 'w'); f.write(last); f.close() |
|
192 | 192 | > EOF |
|
193 | 193 | $ cat .hg/localtags; echo |
|
194 | 194 | acb14030fe0a21b60322c440ad2d20cf7685a376 localblah |
|
195 | 195 | $ hg tag -l localnewline |
|
196 | 196 | $ cat .hg/localtags; echo |
|
197 | 197 | acb14030fe0a21b60322c440ad2d20cf7685a376 localblah |
|
198 | 198 | c2899151f4e76890c602a2597a650a72666681bf localnewline |
|
199 | 199 | |
|
200 | 200 | |
|
201 | 201 | $ python << EOF |
|
202 | 202 | > f = file('.hgtags'); last = f.readlines()[-1][:-1]; f.close() |
|
203 | 203 | > f = file('.hgtags', 'w'); f.write(last); f.close() |
|
204 | 204 | > EOF |
|
205 | 205 | $ hg ci -m'broken manual edit of .hgtags' |
|
206 | 206 | $ cat .hgtags; echo |
|
207 | 207 | acb14030fe0a21b60322c440ad2d20cf7685a376 foobar |
|
208 | 208 | $ hg tag newline |
|
209 | 209 | $ cat .hgtags; echo |
|
210 | 210 | acb14030fe0a21b60322c440ad2d20cf7685a376 foobar |
|
211 | 211 | a0eea09de1eeec777b46f2085260a373b2fbc293 newline |
|
212 | 212 | |
|
213 | 213 | |
|
214 | 214 | tag and branch using same name |
|
215 | 215 | |
|
216 | 216 | $ hg branch tag-and-branch-same-name |
|
217 | 217 | marked working directory as branch tag-and-branch-same-name |
|
218 | 218 | (branches are permanent and global, did you want a bookmark?) |
|
219 | 219 | $ hg ci -m"discouraged" |
|
220 | 220 | $ hg tag tag-and-branch-same-name |
|
221 | 221 | warning: tag tag-and-branch-same-name conflicts with existing branch name |
|
222 | 222 | |
|
223 | 223 | test custom commit messages |
|
224 | 224 | |
|
225 | 225 | $ cat > editor.sh << '__EOF__' |
|
226 | 226 | > echo "==== before editing" |
|
227 | 227 | > cat "$1" |
|
228 | 228 | > echo "====" |
|
229 | 229 | > echo "custom tag message" > "$1" |
|
230 | 230 | > echo "second line" >> "$1" |
|
231 | 231 | > __EOF__ |
|
232 | 232 | |
|
233 | 233 | at first, test saving last-message.txt |
|
234 | 234 | |
|
235 | 235 | (test that editor is not invoked before transaction starting) |
|
236 | 236 | |
|
237 | 237 | $ cat > .hg/hgrc << '__EOF__' |
|
238 | 238 | > [hooks] |
|
239 | 239 | > # this failure occurs before editor invocation |
|
240 | 240 | > pretag.test-saving-lastmessage = false |
|
241 | 241 | > __EOF__ |
|
242 | 242 | $ rm -f .hg/last-message.txt |
|
243 | 243 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e |
|
244 | 244 | abort: pretag.test-saving-lastmessage hook exited with status 1 |
|
245 | 245 | [255] |
|
246 | 246 | $ test -f .hg/last-message.txt |
|
247 | 247 | [1] |
|
248 | 248 | |
|
249 | 249 | (test that editor is invoked and commit message is saved into |
|
250 | 250 | "last-message.txt") |
|
251 | 251 | |
|
252 | 252 | $ cat >> .hg/hgrc << '__EOF__' |
|
253 | 253 | > [hooks] |
|
254 | 254 | > pretag.test-saving-lastmessage = |
|
255 | 255 | > # this failure occurs after editor invocation |
|
256 | 256 | > pretxncommit.unexpectedabort = false |
|
257 | 257 | > __EOF__ |
|
258 | 258 | |
|
259 | 259 | (this tests also that editor is invoked, if '--edit' is specified, |
|
260 | 260 | regardless of '--message') |
|
261 | 261 | |
|
262 | 262 | $ rm -f .hg/last-message.txt |
|
263 | 263 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e -m "foo bar" |
|
264 | 264 | ==== before editing |
|
265 | 265 | foo bar |
|
266 | 266 | |
|
267 | 267 | |
|
268 | 268 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
269 | 269 | HG: Leave message empty to abort commit. |
|
270 | 270 | HG: -- |
|
271 | 271 | HG: user: test |
|
272 | 272 | HG: branch 'tag-and-branch-same-name' |
|
273 | 273 | HG: changed .hgtags |
|
274 | 274 | ==== |
|
275 | 275 | transaction abort! |
|
276 | 276 | rollback completed |
|
277 | 277 | note: commit message saved in .hg/last-message.txt |
|
278 | 278 | abort: pretxncommit.unexpectedabort hook exited with status 1 |
|
279 | 279 | [255] |
|
280 | 280 | $ cat .hg/last-message.txt |
|
281 | 281 | custom tag message |
|
282 | 282 | second line |
|
283 | 283 | |
|
284 | 284 | $ cat >> .hg/hgrc << '__EOF__' |
|
285 | 285 | > [hooks] |
|
286 | 286 | > pretxncommit.unexpectedabort = |
|
287 | 287 | > __EOF__ |
|
288 | 288 | $ hg status .hgtags |
|
289 | 289 | M .hgtags |
|
290 | 290 | $ hg revert --no-backup -q .hgtags |
|
291 | 291 | |
|
292 | 292 | then, test custom commit message itself |
|
293 | 293 | |
|
294 | 294 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e |
|
295 | 295 | ==== before editing |
|
296 | 296 | Added tag custom-tag for changeset 75a534207be6 |
|
297 | 297 | |
|
298 | 298 | |
|
299 | 299 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
300 | 300 | HG: Leave message empty to abort commit. |
|
301 | 301 | HG: -- |
|
302 | 302 | HG: user: test |
|
303 | 303 | HG: branch 'tag-and-branch-same-name' |
|
304 | 304 | HG: changed .hgtags |
|
305 | 305 | ==== |
|
306 | 306 | $ hg log -l1 --template "{desc}\n" |
|
307 | 307 | custom tag message |
|
308 | 308 | second line |
|
309 | 309 | |
|
310 | 310 | |
|
311 | 311 | local tag with .hgtags modified |
|
312 | 312 | |
|
313 | 313 | $ hg tag hgtags-modified |
|
314 | 314 | $ hg rollback |
|
315 | 315 | repository tip rolled back to revision 13 (undo commit) |
|
316 | 316 | working directory now based on revision 13 |
|
317 | 317 | $ hg st |
|
318 | 318 | M .hgtags |
|
319 | 319 | ? .hgtags.orig |
|
320 | 320 | ? editor.sh |
|
321 | 321 | $ hg tag --local baz |
|
322 | 322 | $ hg revert --no-backup .hgtags |
|
323 | 323 | |
|
324 | 324 | |
|
325 | 325 | tagging when at named-branch-head that's not a topo-head |
|
326 | 326 | |
|
327 | 327 | $ hg up default |
|
328 | 328 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
329 | 329 | $ hg merge -t internal:local |
|
330 | 330 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
331 | 331 | (branch merge, don't forget to commit) |
|
332 | 332 | $ hg ci -m 'merge named branch' |
|
333 | 333 | $ hg up 13 |
|
334 | 334 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
335 | 335 | $ hg tag new-topo-head |
|
336 | 336 | |
|
337 | 337 | tagging on null rev |
|
338 | 338 | |
|
339 | 339 | $ hg up null |
|
340 | 340 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
341 | 341 | $ hg tag nullrev |
|
342 | 342 | abort: not at a branch head (use -f to force) |
|
343 | 343 | [255] |
|
344 | 344 | |
|
345 | 345 | $ hg init empty |
|
346 | 346 | $ hg tag -R empty nullrev |
|
347 | 347 | abort: cannot tag null revision |
|
348 | 348 | [255] |
|
349 | 349 | |
|
350 | 350 | $ hg tag -R empty -r 00000000000 -f nulltag |
|
351 | 351 | abort: cannot tag null revision |
|
352 | 352 | [255] |
|
353 | 353 | |
|
354 | 354 | $ cd .. |
|
355 | 355 | |
|
356 | 356 | tagging on an uncommitted merge (issue2542) |
|
357 | 357 | |
|
358 | 358 | $ hg init repo-tag-uncommitted-merge |
|
359 | 359 | $ cd repo-tag-uncommitted-merge |
|
360 | 360 | $ echo c1 > f1 |
|
361 | 361 | $ hg ci -Am0 |
|
362 | 362 | adding f1 |
|
363 | 363 | $ echo c2 > f2 |
|
364 | 364 | $ hg ci -Am1 |
|
365 | 365 | adding f2 |
|
366 | 366 | $ hg co -q 0 |
|
367 | 367 | $ hg branch b1 |
|
368 | 368 | marked working directory as branch b1 |
|
369 | 369 | (branches are permanent and global, did you want a bookmark?) |
|
370 | 370 | $ hg ci -m2 |
|
371 | 371 | $ hg up default |
|
372 | 372 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
373 | 373 | $ hg merge b1 |
|
374 | 374 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
375 | 375 | (branch merge, don't forget to commit) |
|
376 | 376 | |
|
377 | 377 | $ hg tag t1 |
|
378 | 378 | abort: uncommitted merge |
|
379 | 379 | [255] |
|
380 | 380 | $ hg status |
|
381 | 381 | $ hg tag --rev 1 t2 |
|
382 | 382 | abort: uncommitted merge |
|
383 | 383 | [255] |
|
384 | 384 | $ hg tag --rev 1 --local t3 |
|
385 | 385 | $ hg tags -v |
|
386 | 386 | tip 2:2a156e8887cc |
|
387 | 387 | t3 1:c3adabd1a5f4 local |
|
388 | 388 | |
|
389 | 389 | $ cd .. |
|
390 | 390 | |
|
391 | 391 | commit hook on tag used to be run without write lock - issue3344 |
|
392 | 392 | |
|
393 | 393 | $ hg init repo-tag |
|
394 | 394 | $ touch repo-tag/test |
|
395 | 395 | $ hg -R repo-tag commit -A -m "test" |
|
396 | 396 | adding test |
|
397 | 397 | $ hg init repo-tag-target |
|
398 | $ hg -R repo-tag --config hooks.commit="\"hg\" push \"`pwd`/repo-tag-target\"" tag tag | |
|
398 | $ cat > "$TESTTMP/issue3344.sh" <<EOF | |
|
399 | > hg push "$TESTTMP/repo-tag-target" | |
|
400 | > EOF | |
|
401 | $ hg -R repo-tag --config hooks.commit="sh ../issue3344.sh" tag tag | |
|
399 | 402 | pushing to $TESTTMP/repo-tag-target (glob) |
|
400 | 403 | searching for changes |
|
401 | 404 | adding changesets |
|
402 | 405 | adding manifests |
|
403 | 406 | adding file changes |
|
404 | 407 | added 2 changesets with 2 changes to 2 files |
|
405 | 408 | |
|
406 | 409 | automatically merge resolvable tag conflicts (i.e. tags that differ in rank) |
|
407 | 410 | create two clones with some different tags as well as some common tags |
|
408 | 411 | check that we can merge tags that differ in rank |
|
409 | 412 | |
|
410 | 413 | $ hg init repo-automatic-tag-merge |
|
411 | 414 | $ cd repo-automatic-tag-merge |
|
412 | 415 | $ echo c0 > f0 |
|
413 | 416 | $ hg ci -A -m0 |
|
414 | 417 | adding f0 |
|
415 | 418 | $ hg tag tbase |
|
416 | 419 | $ cd .. |
|
417 | 420 | $ hg clone repo-automatic-tag-merge repo-automatic-tag-merge-clone |
|
418 | 421 | updating to branch default |
|
419 | 422 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
420 | 423 | $ cd repo-automatic-tag-merge-clone |
|
421 | 424 | $ echo c1 > f1 |
|
422 | 425 | $ hg ci -A -m1 |
|
423 | 426 | adding f1 |
|
424 | 427 | $ hg tag t1 t2 t3 |
|
425 | 428 | $ hg tag --remove t2 |
|
426 | 429 | $ hg tag t5 |
|
427 | 430 | $ echo c2 > f2 |
|
428 | 431 | $ hg ci -A -m2 |
|
429 | 432 | adding f2 |
|
430 | 433 | $ hg tag -f t3 |
|
431 | 434 | |
|
432 | 435 | $ cd ../repo-automatic-tag-merge |
|
433 | 436 | $ echo c3 > f3 |
|
434 | 437 | $ hg ci -A -m3 |
|
435 | 438 | adding f3 |
|
436 | 439 | $ hg tag -f t4 t5 t6 |
|
437 | 440 | $ hg tag --remove t5 |
|
438 | 441 | $ echo c4 > f4 |
|
439 | 442 | $ hg ci -A -m4 |
|
440 | 443 | adding f4 |
|
441 | 444 | $ hg tag t2 |
|
442 | 445 | $ hg tag -f t6 |
|
443 | 446 | |
|
444 | 447 | $ cd ../repo-automatic-tag-merge-clone |
|
445 | 448 | $ hg pull |
|
446 | 449 | pulling from $TESTTMP/repo-automatic-tag-merge (glob) |
|
447 | 450 | searching for changes |
|
448 | 451 | adding changesets |
|
449 | 452 | adding manifests |
|
450 | 453 | adding file changes |
|
451 | 454 | added 6 changesets with 6 changes to 3 files (+1 heads) |
|
452 | 455 |
(run 'hg heads' |
|
453 | 456 | $ hg merge --tool internal:tagmerge |
|
454 | 457 | merging .hgtags |
|
455 | 458 | 2 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
456 | 459 | (branch merge, don't forget to commit) |
|
457 | 460 | $ hg status |
|
458 | 461 | M .hgtags |
|
459 | 462 | M f3 |
|
460 | 463 | M f4 |
|
461 | 464 | $ hg resolve -l |
|
462 | 465 | R .hgtags |
|
463 | 466 | $ cat .hgtags |
|
464 | 467 | 9aa4e1292a27a248f8d07339bed9931d54907be7 t4 |
|
465 | 468 | 9aa4e1292a27a248f8d07339bed9931d54907be7 t6 |
|
466 | 469 | 9aa4e1292a27a248f8d07339bed9931d54907be7 t6 |
|
467 | 470 | 09af2ce14077a94effef208b49a718f4836d4338 t6 |
|
468 | 471 | 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase |
|
469 | 472 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1 |
|
470 | 473 | 929bca7b18d067cbf3844c3896319a940059d748 t2 |
|
471 | 474 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
472 | 475 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
473 | 476 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
474 | 477 | 0000000000000000000000000000000000000000 t2 |
|
475 | 478 | 875517b4806a848f942811a315a5bce30804ae85 t5 |
|
476 | 479 | 9aa4e1292a27a248f8d07339bed9931d54907be7 t5 |
|
477 | 480 | 9aa4e1292a27a248f8d07339bed9931d54907be7 t5 |
|
478 | 481 | 0000000000000000000000000000000000000000 t5 |
|
479 | 482 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
480 | 483 | 79505d5360b07e3e79d1052e347e73c02b8afa5b t3 |
|
481 | 484 | |
|
482 | 485 | check that the merge tried to minimize the diff with the first merge parent |
|
483 | 486 | |
|
484 | 487 |
|
|
485 | 488 | diff --git a/.hgtags b/.hgtags |
|
486 | 489 | --- a/.hgtags |
|
487 | 490 | +++ b/.hgtags |
|
488 | 491 | @@ -1,9 +1,17 @@ |
|
489 | 492 | +9aa4e1292a27a248f8d07339bed9931d54907be7 t4 |
|
490 | 493 | +9aa4e1292a27a248f8d07339bed9931d54907be7 t6 |
|
491 | 494 | +9aa4e1292a27a248f8d07339bed9931d54907be7 t6 |
|
492 | 495 | +09af2ce14077a94effef208b49a718f4836d4338 t6 |
|
493 | 496 | 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase |
|
494 | 497 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1 |
|
495 | 498 | +929bca7b18d067cbf3844c3896319a940059d748 t2 |
|
496 | 499 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
497 | 500 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
498 | 501 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
499 | 502 | 0000000000000000000000000000000000000000 t2 |
|
500 | 503 | 875517b4806a848f942811a315a5bce30804ae85 t5 |
|
501 | 504 | +9aa4e1292a27a248f8d07339bed9931d54907be7 t5 |
|
502 | 505 | +9aa4e1292a27a248f8d07339bed9931d54907be7 t5 |
|
503 | 506 | +0000000000000000000000000000000000000000 t5 |
|
504 | 507 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
505 | 508 | 79505d5360b07e3e79d1052e347e73c02b8afa5b t3 |
|
506 | 509 | |
|
507 | 510 | detect merge tag conflicts |
|
508 | 511 | |
|
509 | 512 | $ hg update -C -r tip |
|
510 | 513 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
511 | 514 | $ hg tag t7 |
|
512 | 515 |
$ hg update -C -r |
|
513 | 516 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
514 | 517 | $ printf "%s %s\n" `hg log -r . --template "{node} t7"` >> .hgtags |
|
515 | 518 | $ hg commit -m "manually add conflicting t7 tag" |
|
516 | 519 | $ hg merge --tool internal:tagmerge |
|
517 | 520 | merging .hgtags |
|
518 | 521 | automatic .hgtags merge failed |
|
519 | 522 | the following 1 tags are in conflict: t7 |
|
520 | 523 |
|
|
521 | 524 | 2 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
522 | 525 |
|
|
523 | 526 | [1] |
|
524 | 527 | $ hg resolve -l |
|
525 | 528 | U .hgtags |
|
526 | 529 | $ cat .hgtags |
|
527 | 530 | 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase |
|
528 | 531 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1 |
|
529 | 532 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
530 | 533 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
531 | 534 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
532 | 535 | 0000000000000000000000000000000000000000 t2 |
|
533 | 536 | 875517b4806a848f942811a315a5bce30804ae85 t5 |
|
534 | 537 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
535 | 538 | 79505d5360b07e3e79d1052e347e73c02b8afa5b t3 |
|
536 | 539 | ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7 |
|
537 | 540 | |
|
538 | 541 | $ cd .. |
|
539 | 542 | |
|
540 | 543 | handle the loss of tags |
|
541 | 544 | |
|
542 | 545 | $ hg clone repo-automatic-tag-merge-clone repo-merge-lost-tags |
|
543 | 546 | updating to branch default |
|
544 | 547 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
545 | 548 | $ cd repo-merge-lost-tags |
|
546 | 549 | $ echo c5 > f5 |
|
547 | 550 | $ hg ci -A -m5 |
|
548 | 551 | adding f5 |
|
549 | 552 | $ hg tag -f t7 |
|
550 | 553 |
$ hg update -r |
|
551 | 554 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
552 | 555 |
|
|
553 | 556 |
$ hg commit -m |
|
554 | 557 | created new head |
|
555 | 558 |
$ hg log -r |
|
556 | 559 | changeset: 17:ffe462b50880 |
|
557 | 560 | user: test |
|
558 | 561 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
559 | 562 | summary: Added tag t7 for changeset fd3a9e394ce3 |
|
560 | 563 |
|
|
561 | 564 |
$ hg update -r |
|
562 | 565 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
563 | 566 | $ hg merge -r tip --tool internal:tagmerge |
|
564 | 567 | merging .hgtags |
|
565 | 568 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
566 | 569 |
|
|
567 | 570 | $ hg resolve -l |
|
568 | 571 | R .hgtags |
|
569 | 572 | $ cat .hgtags |
|
570 | 573 | 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase |
|
571 | 574 | 0000000000000000000000000000000000000000 tbase |
|
572 | 575 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1 |
|
573 | 576 | 0000000000000000000000000000000000000000 t1 |
|
574 | 577 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
575 | 578 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
576 | 579 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
577 | 580 | 0000000000000000000000000000000000000000 t2 |
|
578 | 581 | 875517b4806a848f942811a315a5bce30804ae85 t5 |
|
579 | 582 | 0000000000000000000000000000000000000000 t5 |
|
580 | 583 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
581 | 584 | 79505d5360b07e3e79d1052e347e73c02b8afa5b t3 |
|
582 | 585 | 0000000000000000000000000000000000000000 t3 |
|
583 | 586 | ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7 |
|
584 | 587 | 0000000000000000000000000000000000000000 t7 |
|
585 | 588 | ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7 |
|
586 | 589 | fd3a9e394ce3afb354a496323bf68ac1755a30de t7 |
|
587 | 590 | |
|
588 | 591 | also check that we minimize the diff with the 1st merge parent |
|
589 | 592 | |
|
590 | 593 | $ hg diff --git -r 'p1()' .hgtags |
|
591 | 594 | diff --git a/.hgtags b/.hgtags |
|
592 | 595 | --- a/.hgtags |
|
593 | 596 | +++ b/.hgtags |
|
594 | 597 | @@ -1,12 +1,17 @@ |
|
595 | 598 | 6cee5c8f3e5b4ae1a3996d2f6489c3e08eb5aea7 tbase |
|
596 | 599 | +0000000000000000000000000000000000000000 tbase |
|
597 | 600 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t1 |
|
598 | 601 | +0000000000000000000000000000000000000000 t1 |
|
599 | 602 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
600 | 603 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
601 | 604 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t2 |
|
602 | 605 | 0000000000000000000000000000000000000000 t2 |
|
603 | 606 | 875517b4806a848f942811a315a5bce30804ae85 t5 |
|
604 | 607 | +0000000000000000000000000000000000000000 t5 |
|
605 | 608 | 4f3e9b90005b68b4d8a3f4355cedc302a8364f5c t3 |
|
606 | 609 | 79505d5360b07e3e79d1052e347e73c02b8afa5b t3 |
|
607 | 610 | +0000000000000000000000000000000000000000 t3 |
|
608 | 611 | ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7 |
|
609 | 612 | +0000000000000000000000000000000000000000 t7 |
|
610 | 613 | ea918d56be86a4afc5a95312e8b6750e1428d9d2 t7 |
|
611 | 614 | fd3a9e394ce3afb354a496323bf68ac1755a30de t7 |
|
612 | 615 |
General Comments 0
You need to be logged in to leave comments.
Login now