##// END OF EJS Templates
tests: add a i18n translation test for log output...
Sean Farley -
r23771:9f81f9e5 default
parent child Browse files
Show More
@@ -1,1802 +1,1820 b''
1 1 Log on empty repository: checking consistency
2 2
3 3 $ hg init empty
4 4 $ cd empty
5 5 $ hg log
6 6 $ hg log -r 1
7 7 abort: unknown revision '1'!
8 8 [255]
9 9 $ hg log -r -1:0
10 10 abort: unknown revision '-1'!
11 11 [255]
12 12 $ hg log -r 'branch(name)'
13 13 abort: unknown revision 'name'!
14 14 [255]
15 15 $ hg log -r null -q
16 16 -1:000000000000
17 17
18 18 The g is crafted to have 2 filelog topological heads in a linear
19 19 changeset graph
20 20
21 21 $ hg init a
22 22 $ cd a
23 23 $ echo a > a
24 24 $ echo f > f
25 25 $ hg ci -Ama -d '1 0'
26 26 adding a
27 27 adding f
28 28
29 29 $ hg cp a b
30 30 $ hg cp f g
31 31 $ hg ci -mb -d '2 0'
32 32
33 33 $ mkdir dir
34 34 $ hg mv b dir
35 35 $ echo g >> g
36 36 $ echo f >> f
37 37 $ hg ci -mc -d '3 0'
38 38
39 39 $ hg mv a b
40 40 $ hg cp -f f g
41 41 $ echo a > d
42 42 $ hg add d
43 43 $ hg ci -md -d '4 0'
44 44
45 45 $ hg mv dir/b e
46 46 $ hg ci -me -d '5 0'
47 47
48 48 $ hg log a
49 49 changeset: 0:9161b9aeaf16
50 50 user: test
51 51 date: Thu Jan 01 00:00:01 1970 +0000
52 52 summary: a
53 53
54 54 log on directory
55 55
56 56 $ hg log dir
57 57 changeset: 4:7e4639b4691b
58 58 tag: tip
59 59 user: test
60 60 date: Thu Jan 01 00:00:05 1970 +0000
61 61 summary: e
62 62
63 63 changeset: 2:f8954cd4dc1f
64 64 user: test
65 65 date: Thu Jan 01 00:00:03 1970 +0000
66 66 summary: c
67 67
68 68 $ hg log somethingthatdoesntexist dir
69 69 changeset: 4:7e4639b4691b
70 70 tag: tip
71 71 user: test
72 72 date: Thu Jan 01 00:00:05 1970 +0000
73 73 summary: e
74 74
75 75 changeset: 2:f8954cd4dc1f
76 76 user: test
77 77 date: Thu Jan 01 00:00:03 1970 +0000
78 78 summary: c
79 79
80 80
81 81 -f, non-existent directory
82 82
83 83 $ hg log -f dir
84 84 abort: cannot follow file not in parent revision: "dir"
85 85 [255]
86 86
87 87 -f, directory
88 88
89 89 $ hg up -q 3
90 90 $ hg log -f dir
91 91 changeset: 2:f8954cd4dc1f
92 92 user: test
93 93 date: Thu Jan 01 00:00:03 1970 +0000
94 94 summary: c
95 95
96 96 -f, directory with --patch
97 97
98 98 $ hg log -f dir -p
99 99 changeset: 2:f8954cd4dc1f
100 100 user: test
101 101 date: Thu Jan 01 00:00:03 1970 +0000
102 102 summary: c
103 103
104 104 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
105 105 --- /dev/null* (glob)
106 106 +++ b/dir/b* (glob)
107 107 @@ -0,0 +1,1 @@
108 108 +a
109 109
110 110
111 111 -f, pattern
112 112
113 113 $ hg log -f -I 'dir**' -p
114 114 changeset: 2:f8954cd4dc1f
115 115 user: test
116 116 date: Thu Jan 01 00:00:03 1970 +0000
117 117 summary: c
118 118
119 119 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
120 120 --- /dev/null* (glob)
121 121 +++ b/dir/b* (glob)
122 122 @@ -0,0 +1,1 @@
123 123 +a
124 124
125 125 $ hg up -q 4
126 126
127 127 -f, a wrong style
128 128
129 129 $ hg log -f -l1 --style something
130 130 abort: style 'something' not found
131 131 (available styles: bisect, changelog, compact, default, phases, xml)
132 132 [255]
133 133
134 134 -f, phases style
135 135
136 136
137 137 $ hg log -f -l1 --style phases
138 138 changeset: 4:7e4639b4691b
139 139 tag: tip
140 140 phase: draft
141 141 user: test
142 142 date: Thu Jan 01 00:00:05 1970 +0000
143 143 summary: e
144 144
145 145
146 146 -f, but no args
147 147
148 148 $ hg log -f
149 149 changeset: 4:7e4639b4691b
150 150 tag: tip
151 151 user: test
152 152 date: Thu Jan 01 00:00:05 1970 +0000
153 153 summary: e
154 154
155 155 changeset: 3:2ca5ba701980
156 156 user: test
157 157 date: Thu Jan 01 00:00:04 1970 +0000
158 158 summary: d
159 159
160 160 changeset: 2:f8954cd4dc1f
161 161 user: test
162 162 date: Thu Jan 01 00:00:03 1970 +0000
163 163 summary: c
164 164
165 165 changeset: 1:d89b0a12d229
166 166 user: test
167 167 date: Thu Jan 01 00:00:02 1970 +0000
168 168 summary: b
169 169
170 170 changeset: 0:9161b9aeaf16
171 171 user: test
172 172 date: Thu Jan 01 00:00:01 1970 +0000
173 173 summary: a
174 174
175 175
176 176 one rename
177 177
178 178 $ hg up -q 2
179 179 $ hg log -vf a
180 180 changeset: 0:9161b9aeaf16
181 181 user: test
182 182 date: Thu Jan 01 00:00:01 1970 +0000
183 183 files: a f
184 184 description:
185 185 a
186 186
187 187
188 188
189 189 many renames
190 190
191 191 $ hg up -q tip
192 192 $ hg log -vf e
193 193 changeset: 4:7e4639b4691b
194 194 tag: tip
195 195 user: test
196 196 date: Thu Jan 01 00:00:05 1970 +0000
197 197 files: dir/b e
198 198 description:
199 199 e
200 200
201 201
202 202 changeset: 2:f8954cd4dc1f
203 203 user: test
204 204 date: Thu Jan 01 00:00:03 1970 +0000
205 205 files: b dir/b f g
206 206 description:
207 207 c
208 208
209 209
210 210 changeset: 1:d89b0a12d229
211 211 user: test
212 212 date: Thu Jan 01 00:00:02 1970 +0000
213 213 files: b g
214 214 description:
215 215 b
216 216
217 217
218 218 changeset: 0:9161b9aeaf16
219 219 user: test
220 220 date: Thu Jan 01 00:00:01 1970 +0000
221 221 files: a f
222 222 description:
223 223 a
224 224
225 225
226 226
227 227
228 228 log -pf dir/b
229 229
230 230 $ hg up -q 3
231 231 $ hg log -pf dir/b
232 232 changeset: 2:f8954cd4dc1f
233 233 user: test
234 234 date: Thu Jan 01 00:00:03 1970 +0000
235 235 summary: c
236 236
237 237 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
238 238 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
239 239 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
240 240 @@ -0,0 +1,1 @@
241 241 +a
242 242
243 243 changeset: 1:d89b0a12d229
244 244 user: test
245 245 date: Thu Jan 01 00:00:02 1970 +0000
246 246 summary: b
247 247
248 248 diff -r 9161b9aeaf16 -r d89b0a12d229 b
249 249 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
250 250 +++ b/b Thu Jan 01 00:00:02 1970 +0000
251 251 @@ -0,0 +1,1 @@
252 252 +a
253 253
254 254 changeset: 0:9161b9aeaf16
255 255 user: test
256 256 date: Thu Jan 01 00:00:01 1970 +0000
257 257 summary: a
258 258
259 259 diff -r 000000000000 -r 9161b9aeaf16 a
260 260 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
261 261 +++ b/a Thu Jan 01 00:00:01 1970 +0000
262 262 @@ -0,0 +1,1 @@
263 263 +a
264 264
265 265
266 266 log -pf b inside dir
267 267
268 268 $ hg --cwd=dir log -pf b
269 269 changeset: 2:f8954cd4dc1f
270 270 user: test
271 271 date: Thu Jan 01 00:00:03 1970 +0000
272 272 summary: c
273 273
274 274 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
275 275 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
276 276 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
277 277 @@ -0,0 +1,1 @@
278 278 +a
279 279
280 280 changeset: 1:d89b0a12d229
281 281 user: test
282 282 date: Thu Jan 01 00:00:02 1970 +0000
283 283 summary: b
284 284
285 285 diff -r 9161b9aeaf16 -r d89b0a12d229 b
286 286 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
287 287 +++ b/b Thu Jan 01 00:00:02 1970 +0000
288 288 @@ -0,0 +1,1 @@
289 289 +a
290 290
291 291 changeset: 0:9161b9aeaf16
292 292 user: test
293 293 date: Thu Jan 01 00:00:01 1970 +0000
294 294 summary: a
295 295
296 296 diff -r 000000000000 -r 9161b9aeaf16 a
297 297 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
298 298 +++ b/a Thu Jan 01 00:00:01 1970 +0000
299 299 @@ -0,0 +1,1 @@
300 300 +a
301 301
302 302
303 303 log -pf, but no args
304 304
305 305 $ hg log -pf
306 306 changeset: 3:2ca5ba701980
307 307 user: test
308 308 date: Thu Jan 01 00:00:04 1970 +0000
309 309 summary: d
310 310
311 311 diff -r f8954cd4dc1f -r 2ca5ba701980 a
312 312 --- a/a Thu Jan 01 00:00:03 1970 +0000
313 313 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
314 314 @@ -1,1 +0,0 @@
315 315 -a
316 316 diff -r f8954cd4dc1f -r 2ca5ba701980 b
317 317 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
318 318 +++ b/b Thu Jan 01 00:00:04 1970 +0000
319 319 @@ -0,0 +1,1 @@
320 320 +a
321 321 diff -r f8954cd4dc1f -r 2ca5ba701980 d
322 322 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
323 323 +++ b/d Thu Jan 01 00:00:04 1970 +0000
324 324 @@ -0,0 +1,1 @@
325 325 +a
326 326 diff -r f8954cd4dc1f -r 2ca5ba701980 g
327 327 --- a/g Thu Jan 01 00:00:03 1970 +0000
328 328 +++ b/g Thu Jan 01 00:00:04 1970 +0000
329 329 @@ -1,2 +1,2 @@
330 330 f
331 331 -g
332 332 +f
333 333
334 334 changeset: 2:f8954cd4dc1f
335 335 user: test
336 336 date: Thu Jan 01 00:00:03 1970 +0000
337 337 summary: c
338 338
339 339 diff -r d89b0a12d229 -r f8954cd4dc1f b
340 340 --- a/b Thu Jan 01 00:00:02 1970 +0000
341 341 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
342 342 @@ -1,1 +0,0 @@
343 343 -a
344 344 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
345 345 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
346 346 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
347 347 @@ -0,0 +1,1 @@
348 348 +a
349 349 diff -r d89b0a12d229 -r f8954cd4dc1f f
350 350 --- a/f Thu Jan 01 00:00:02 1970 +0000
351 351 +++ b/f Thu Jan 01 00:00:03 1970 +0000
352 352 @@ -1,1 +1,2 @@
353 353 f
354 354 +f
355 355 diff -r d89b0a12d229 -r f8954cd4dc1f g
356 356 --- a/g Thu Jan 01 00:00:02 1970 +0000
357 357 +++ b/g Thu Jan 01 00:00:03 1970 +0000
358 358 @@ -1,1 +1,2 @@
359 359 f
360 360 +g
361 361
362 362 changeset: 1:d89b0a12d229
363 363 user: test
364 364 date: Thu Jan 01 00:00:02 1970 +0000
365 365 summary: b
366 366
367 367 diff -r 9161b9aeaf16 -r d89b0a12d229 b
368 368 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
369 369 +++ b/b Thu Jan 01 00:00:02 1970 +0000
370 370 @@ -0,0 +1,1 @@
371 371 +a
372 372 diff -r 9161b9aeaf16 -r d89b0a12d229 g
373 373 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
374 374 +++ b/g Thu Jan 01 00:00:02 1970 +0000
375 375 @@ -0,0 +1,1 @@
376 376 +f
377 377
378 378 changeset: 0:9161b9aeaf16
379 379 user: test
380 380 date: Thu Jan 01 00:00:01 1970 +0000
381 381 summary: a
382 382
383 383 diff -r 000000000000 -r 9161b9aeaf16 a
384 384 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
385 385 +++ b/a Thu Jan 01 00:00:01 1970 +0000
386 386 @@ -0,0 +1,1 @@
387 387 +a
388 388 diff -r 000000000000 -r 9161b9aeaf16 f
389 389 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
390 390 +++ b/f Thu Jan 01 00:00:01 1970 +0000
391 391 @@ -0,0 +1,1 @@
392 392 +f
393 393
394 394
395 395 log -vf dir/b
396 396
397 397 $ hg log -vf dir/b
398 398 changeset: 2:f8954cd4dc1f
399 399 user: test
400 400 date: Thu Jan 01 00:00:03 1970 +0000
401 401 files: b dir/b f g
402 402 description:
403 403 c
404 404
405 405
406 406 changeset: 1:d89b0a12d229
407 407 user: test
408 408 date: Thu Jan 01 00:00:02 1970 +0000
409 409 files: b g
410 410 description:
411 411 b
412 412
413 413
414 414 changeset: 0:9161b9aeaf16
415 415 user: test
416 416 date: Thu Jan 01 00:00:01 1970 +0000
417 417 files: a f
418 418 description:
419 419 a
420 420
421 421
422 422
423 423
424 424 -f and multiple filelog heads
425 425
426 426 $ hg up -q 2
427 427 $ hg log -f g --template '{rev}\n'
428 428 2
429 429 1
430 430 0
431 431 $ hg up -q tip
432 432 $ hg log -f g --template '{rev}\n'
433 433 3
434 434 2
435 435 0
436 436
437 437
438 438 log copies with --copies
439 439
440 440 $ hg log -vC --template '{rev} {file_copies}\n'
441 441 4 e (dir/b)
442 442 3 b (a)g (f)
443 443 2 dir/b (b)
444 444 1 b (a)g (f)
445 445 0
446 446
447 447 log copies switch without --copies, with old filecopy template
448 448
449 449 $ hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
450 450 4
451 451 3
452 452 2
453 453 1
454 454 0
455 455
456 456 log copies switch with --copies
457 457
458 458 $ hg log -vC --template '{rev} {file_copies_switch}\n'
459 459 4 e (dir/b)
460 460 3 b (a)g (f)
461 461 2 dir/b (b)
462 462 1 b (a)g (f)
463 463 0
464 464
465 465
466 466 log copies with hardcoded style and with --style=default
467 467
468 468 $ hg log -vC -r4
469 469 changeset: 4:7e4639b4691b
470 470 tag: tip
471 471 user: test
472 472 date: Thu Jan 01 00:00:05 1970 +0000
473 473 files: dir/b e
474 474 copies: e (dir/b)
475 475 description:
476 476 e
477 477
478 478
479 479 $ hg log -vC -r4 --style=default
480 480 changeset: 4:7e4639b4691b
481 481 tag: tip
482 482 user: test
483 483 date: Thu Jan 01 00:00:05 1970 +0000
484 484 files: dir/b e
485 485 copies: e (dir/b)
486 486 description:
487 487 e
488 488
489 489
490 490
491 491
492 492 log copies, non-linear manifest
493 493
494 494 $ hg up -C 3
495 495 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
496 496 $ hg mv dir/b e
497 497 $ echo foo > foo
498 498 $ hg ci -Ame2 -d '6 0'
499 499 adding foo
500 500 created new head
501 501 $ hg log -v --template '{rev} {file_copies}\n' -r 5
502 502 5 e (dir/b)
503 503
504 504
505 505 log copies, execute bit set
506 506
507 507 #if execbit
508 508 $ chmod +x e
509 509 $ hg ci -me3 -d '7 0'
510 510 $ hg log -v --template '{rev} {file_copies}\n' -r 6
511 511 6
512 512 #endif
513 513
514 514
515 515 log -p d
516 516
517 517 $ hg log -pv d
518 518 changeset: 3:2ca5ba701980
519 519 user: test
520 520 date: Thu Jan 01 00:00:04 1970 +0000
521 521 files: a b d g
522 522 description:
523 523 d
524 524
525 525
526 526 diff -r f8954cd4dc1f -r 2ca5ba701980 d
527 527 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
528 528 +++ b/d Thu Jan 01 00:00:04 1970 +0000
529 529 @@ -0,0 +1,1 @@
530 530 +a
531 531
532 532
533 533
534 534 log --removed file
535 535
536 536 $ hg log --removed -v a
537 537 changeset: 3:2ca5ba701980
538 538 user: test
539 539 date: Thu Jan 01 00:00:04 1970 +0000
540 540 files: a b d g
541 541 description:
542 542 d
543 543
544 544
545 545 changeset: 0:9161b9aeaf16
546 546 user: test
547 547 date: Thu Jan 01 00:00:01 1970 +0000
548 548 files: a f
549 549 description:
550 550 a
551 551
552 552
553 553
554 554 log --removed revrange file
555 555
556 556 $ hg log --removed -v -r0:2 a
557 557 changeset: 0:9161b9aeaf16
558 558 user: test
559 559 date: Thu Jan 01 00:00:01 1970 +0000
560 560 files: a f
561 561 description:
562 562 a
563 563
564 564
565 565 $ cd ..
566 566
567 567 log --follow tests
568 568
569 569 $ hg init follow
570 570 $ cd follow
571 571
572 572 $ echo base > base
573 573 $ hg ci -Ambase -d '1 0'
574 574 adding base
575 575
576 576 $ echo r1 >> base
577 577 $ hg ci -Amr1 -d '1 0'
578 578 $ echo r2 >> base
579 579 $ hg ci -Amr2 -d '1 0'
580 580
581 581 $ hg up -C 1
582 582 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
583 583 $ echo b1 > b1
584 584 $ hg ci -Amb1 -d '1 0'
585 585 adding b1
586 586 created new head
587 587
588 588
589 589 log -f
590 590
591 591 $ hg log -f
592 592 changeset: 3:e62f78d544b4
593 593 tag: tip
594 594 parent: 1:3d5bf5654eda
595 595 user: test
596 596 date: Thu Jan 01 00:00:01 1970 +0000
597 597 summary: b1
598 598
599 599 changeset: 1:3d5bf5654eda
600 600 user: test
601 601 date: Thu Jan 01 00:00:01 1970 +0000
602 602 summary: r1
603 603
604 604 changeset: 0:67e992f2c4f3
605 605 user: test
606 606 date: Thu Jan 01 00:00:01 1970 +0000
607 607 summary: base
608 608
609 609
610 610
611 611 log -f -r 1:tip
612 612
613 613 $ hg up -C 0
614 614 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
615 615 $ echo b2 > b2
616 616 $ hg ci -Amb2 -d '1 0'
617 617 adding b2
618 618 created new head
619 619 $ hg log -f -r 1:tip
620 620 changeset: 1:3d5bf5654eda
621 621 user: test
622 622 date: Thu Jan 01 00:00:01 1970 +0000
623 623 summary: r1
624 624
625 625 changeset: 2:60c670bf5b30
626 626 user: test
627 627 date: Thu Jan 01 00:00:01 1970 +0000
628 628 summary: r2
629 629
630 630 changeset: 3:e62f78d544b4
631 631 parent: 1:3d5bf5654eda
632 632 user: test
633 633 date: Thu Jan 01 00:00:01 1970 +0000
634 634 summary: b1
635 635
636 636
637 637
638 638 log -r . with two parents
639 639
640 640 $ hg up -C 3
641 641 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
642 642 $ hg merge tip
643 643 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
644 644 (branch merge, don't forget to commit)
645 645 $ hg log -r .
646 646 changeset: 3:e62f78d544b4
647 647 parent: 1:3d5bf5654eda
648 648 user: test
649 649 date: Thu Jan 01 00:00:01 1970 +0000
650 650 summary: b1
651 651
652 652
653 653
654 654 log -r . with one parent
655 655
656 656 $ hg ci -mm12 -d '1 0'
657 657 $ hg log -r .
658 658 changeset: 5:302e9dd6890d
659 659 tag: tip
660 660 parent: 3:e62f78d544b4
661 661 parent: 4:ddb82e70d1a1
662 662 user: test
663 663 date: Thu Jan 01 00:00:01 1970 +0000
664 664 summary: m12
665 665
666 666
667 667 $ echo postm >> b1
668 668 $ hg ci -Amb1.1 -d'1 0'
669 669
670 670
671 671 log --follow-first
672 672
673 673 $ hg log --follow-first
674 674 changeset: 6:2404bbcab562
675 675 tag: tip
676 676 user: test
677 677 date: Thu Jan 01 00:00:01 1970 +0000
678 678 summary: b1.1
679 679
680 680 changeset: 5:302e9dd6890d
681 681 parent: 3:e62f78d544b4
682 682 parent: 4:ddb82e70d1a1
683 683 user: test
684 684 date: Thu Jan 01 00:00:01 1970 +0000
685 685 summary: m12
686 686
687 687 changeset: 3:e62f78d544b4
688 688 parent: 1:3d5bf5654eda
689 689 user: test
690 690 date: Thu Jan 01 00:00:01 1970 +0000
691 691 summary: b1
692 692
693 693 changeset: 1:3d5bf5654eda
694 694 user: test
695 695 date: Thu Jan 01 00:00:01 1970 +0000
696 696 summary: r1
697 697
698 698 changeset: 0:67e992f2c4f3
699 699 user: test
700 700 date: Thu Jan 01 00:00:01 1970 +0000
701 701 summary: base
702 702
703 703
704 704
705 705 log -P 2
706 706
707 707 $ hg log -P 2
708 708 changeset: 6:2404bbcab562
709 709 tag: tip
710 710 user: test
711 711 date: Thu Jan 01 00:00:01 1970 +0000
712 712 summary: b1.1
713 713
714 714 changeset: 5:302e9dd6890d
715 715 parent: 3:e62f78d544b4
716 716 parent: 4:ddb82e70d1a1
717 717 user: test
718 718 date: Thu Jan 01 00:00:01 1970 +0000
719 719 summary: m12
720 720
721 721 changeset: 4:ddb82e70d1a1
722 722 parent: 0:67e992f2c4f3
723 723 user: test
724 724 date: Thu Jan 01 00:00:01 1970 +0000
725 725 summary: b2
726 726
727 727 changeset: 3:e62f78d544b4
728 728 parent: 1:3d5bf5654eda
729 729 user: test
730 730 date: Thu Jan 01 00:00:01 1970 +0000
731 731 summary: b1
732 732
733 733
734 734
735 735 log -r tip -p --git
736 736
737 737 $ hg log -r tip -p --git
738 738 changeset: 6:2404bbcab562
739 739 tag: tip
740 740 user: test
741 741 date: Thu Jan 01 00:00:01 1970 +0000
742 742 summary: b1.1
743 743
744 744 diff --git a/b1 b/b1
745 745 --- a/b1
746 746 +++ b/b1
747 747 @@ -1,1 +1,2 @@
748 748 b1
749 749 +postm
750 750
751 751
752 752
753 753 log -r ""
754 754
755 755 $ hg log -r ''
756 756 hg: parse error: empty query
757 757 [255]
758 758
759 759 log -r <some unknown node id>
760 760
761 761 $ hg log -r 1000000000000000000000000000000000000000
762 762 abort: unknown revision '1000000000000000000000000000000000000000'!
763 763 [255]
764 764
765 765 log -k r1
766 766
767 767 $ hg log -k r1
768 768 changeset: 1:3d5bf5654eda
769 769 user: test
770 770 date: Thu Jan 01 00:00:01 1970 +0000
771 771 summary: r1
772 772
773 773 log -p -l2 --color=always
774 774
775 775 $ hg --config extensions.color= --config color.mode=ansi \
776 776 > log -p -l2 --color=always
777 777 \x1b[0;33mchangeset: 6:2404bbcab562\x1b[0m (esc)
778 778 tag: tip
779 779 user: test
780 780 date: Thu Jan 01 00:00:01 1970 +0000
781 781 summary: b1.1
782 782
783 783 \x1b[0;1mdiff -r 302e9dd6890d -r 2404bbcab562 b1\x1b[0m (esc)
784 784 \x1b[0;31;1m--- a/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
785 785 \x1b[0;32;1m+++ b/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
786 786 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
787 787 b1
788 788 \x1b[0;32m+postm\x1b[0m (esc)
789 789
790 790 \x1b[0;33mchangeset: 5:302e9dd6890d\x1b[0m (esc)
791 791 parent: 3:e62f78d544b4
792 792 parent: 4:ddb82e70d1a1
793 793 user: test
794 794 date: Thu Jan 01 00:00:01 1970 +0000
795 795 summary: m12
796 796
797 797 \x1b[0;1mdiff -r e62f78d544b4 -r 302e9dd6890d b2\x1b[0m (esc)
798 798 \x1b[0;31;1m--- /dev/null Thu Jan 01 00:00:00 1970 +0000\x1b[0m (esc)
799 799 \x1b[0;32;1m+++ b/b2 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
800 800 \x1b[0;35m@@ -0,0 +1,1 @@\x1b[0m (esc)
801 801 \x1b[0;32m+b2\x1b[0m (esc)
802 802
803 803
804 804
805 805 log -r tip --stat
806 806
807 807 $ hg log -r tip --stat
808 808 changeset: 6:2404bbcab562
809 809 tag: tip
810 810 user: test
811 811 date: Thu Jan 01 00:00:01 1970 +0000
812 812 summary: b1.1
813 813
814 814 b1 | 1 +
815 815 1 files changed, 1 insertions(+), 0 deletions(-)
816 816
817 817
818 818 $ cd ..
819 819
820 820
821 821 User
822 822
823 823 $ hg init usertest
824 824 $ cd usertest
825 825
826 826 $ echo a > a
827 827 $ hg ci -A -m "a" -u "User One <user1@example.org>"
828 828 adding a
829 829 $ echo b > b
830 830 $ hg ci -A -m "b" -u "User Two <user2@example.org>"
831 831 adding b
832 832
833 833 $ hg log -u "User One <user1@example.org>"
834 834 changeset: 0:29a4c94f1924
835 835 user: User One <user1@example.org>
836 836 date: Thu Jan 01 00:00:00 1970 +0000
837 837 summary: a
838 838
839 839 $ hg log -u "user1" -u "user2"
840 840 changeset: 1:e834b5e69c0e
841 841 tag: tip
842 842 user: User Two <user2@example.org>
843 843 date: Thu Jan 01 00:00:00 1970 +0000
844 844 summary: b
845 845
846 846 changeset: 0:29a4c94f1924
847 847 user: User One <user1@example.org>
848 848 date: Thu Jan 01 00:00:00 1970 +0000
849 849 summary: a
850 850
851 851 $ hg log -u "user3"
852 852
853 853 $ cd ..
854 854
855 855 $ hg init branches
856 856 $ cd branches
857 857
858 858 $ echo a > a
859 859 $ hg ci -A -m "commit on default"
860 860 adding a
861 861 $ hg branch test
862 862 marked working directory as branch test
863 863 (branches are permanent and global, did you want a bookmark?)
864 864 $ echo b > b
865 865 $ hg ci -A -m "commit on test"
866 866 adding b
867 867
868 868 $ hg up default
869 869 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
870 870 $ echo c > c
871 871 $ hg ci -A -m "commit on default"
872 872 adding c
873 873 $ hg up test
874 874 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
875 875 $ echo c > c
876 876 $ hg ci -A -m "commit on test"
877 877 adding c
878 878
879 879
880 880 log -b default
881 881
882 882 $ hg log -b default
883 883 changeset: 2:c3a4f03cc9a7
884 884 parent: 0:24427303d56f
885 885 user: test
886 886 date: Thu Jan 01 00:00:00 1970 +0000
887 887 summary: commit on default
888 888
889 889 changeset: 0:24427303d56f
890 890 user: test
891 891 date: Thu Jan 01 00:00:00 1970 +0000
892 892 summary: commit on default
893 893
894 894
895 895
896 896 log -b test
897 897
898 898 $ hg log -b test
899 899 changeset: 3:f5d8de11c2e2
900 900 branch: test
901 901 tag: tip
902 902 parent: 1:d32277701ccb
903 903 user: test
904 904 date: Thu Jan 01 00:00:00 1970 +0000
905 905 summary: commit on test
906 906
907 907 changeset: 1:d32277701ccb
908 908 branch: test
909 909 user: test
910 910 date: Thu Jan 01 00:00:00 1970 +0000
911 911 summary: commit on test
912 912
913 913
914 914
915 915 log -b dummy
916 916
917 917 $ hg log -b dummy
918 918 abort: unknown revision 'dummy'!
919 919 [255]
920 920
921 921
922 922 log -b .
923 923
924 924 $ hg log -b .
925 925 changeset: 3:f5d8de11c2e2
926 926 branch: test
927 927 tag: tip
928 928 parent: 1:d32277701ccb
929 929 user: test
930 930 date: Thu Jan 01 00:00:00 1970 +0000
931 931 summary: commit on test
932 932
933 933 changeset: 1:d32277701ccb
934 934 branch: test
935 935 user: test
936 936 date: Thu Jan 01 00:00:00 1970 +0000
937 937 summary: commit on test
938 938
939 939
940 940
941 941 log -b default -b test
942 942
943 943 $ hg log -b default -b test
944 944 changeset: 3:f5d8de11c2e2
945 945 branch: test
946 946 tag: tip
947 947 parent: 1:d32277701ccb
948 948 user: test
949 949 date: Thu Jan 01 00:00:00 1970 +0000
950 950 summary: commit on test
951 951
952 952 changeset: 2:c3a4f03cc9a7
953 953 parent: 0:24427303d56f
954 954 user: test
955 955 date: Thu Jan 01 00:00:00 1970 +0000
956 956 summary: commit on default
957 957
958 958 changeset: 1:d32277701ccb
959 959 branch: test
960 960 user: test
961 961 date: Thu Jan 01 00:00:00 1970 +0000
962 962 summary: commit on test
963 963
964 964 changeset: 0:24427303d56f
965 965 user: test
966 966 date: Thu Jan 01 00:00:00 1970 +0000
967 967 summary: commit on default
968 968
969 969
970 970
971 971 log -b default -b .
972 972
973 973 $ hg log -b default -b .
974 974 changeset: 3:f5d8de11c2e2
975 975 branch: test
976 976 tag: tip
977 977 parent: 1:d32277701ccb
978 978 user: test
979 979 date: Thu Jan 01 00:00:00 1970 +0000
980 980 summary: commit on test
981 981
982 982 changeset: 2:c3a4f03cc9a7
983 983 parent: 0:24427303d56f
984 984 user: test
985 985 date: Thu Jan 01 00:00:00 1970 +0000
986 986 summary: commit on default
987 987
988 988 changeset: 1:d32277701ccb
989 989 branch: test
990 990 user: test
991 991 date: Thu Jan 01 00:00:00 1970 +0000
992 992 summary: commit on test
993 993
994 994 changeset: 0:24427303d56f
995 995 user: test
996 996 date: Thu Jan 01 00:00:00 1970 +0000
997 997 summary: commit on default
998 998
999 999
1000 1000
1001 1001 log -b . -b test
1002 1002
1003 1003 $ hg log -b . -b test
1004 1004 changeset: 3:f5d8de11c2e2
1005 1005 branch: test
1006 1006 tag: tip
1007 1007 parent: 1:d32277701ccb
1008 1008 user: test
1009 1009 date: Thu Jan 01 00:00:00 1970 +0000
1010 1010 summary: commit on test
1011 1011
1012 1012 changeset: 1:d32277701ccb
1013 1013 branch: test
1014 1014 user: test
1015 1015 date: Thu Jan 01 00:00:00 1970 +0000
1016 1016 summary: commit on test
1017 1017
1018 1018
1019 1019
1020 1020 log -b 2
1021 1021
1022 1022 $ hg log -b 2
1023 1023 changeset: 2:c3a4f03cc9a7
1024 1024 parent: 0:24427303d56f
1025 1025 user: test
1026 1026 date: Thu Jan 01 00:00:00 1970 +0000
1027 1027 summary: commit on default
1028 1028
1029 1029 changeset: 0:24427303d56f
1030 1030 user: test
1031 1031 date: Thu Jan 01 00:00:00 1970 +0000
1032 1032 summary: commit on default
1033 1033
1034 #if gettext
1034 1035
1036 Test that all log names are translated (e.g. branches, bookmarks, tags):
1037
1038 $ hg bookmark babar -r tip
1039
1040 $ HGENCODING=UTF-8 LANGUAGE=de hg log -r tip
1041 \xc3\x84nderung: 3:f5d8de11c2e2 (esc)
1042 Zweig: test
1043 Lesezeichen: babar
1044 Marke: tip
1045 Vorg\xc3\xa4nger: 1:d32277701ccb (esc)
1046 Nutzer: test
1047 Datum: Thu Jan 01 00:00:00 1970 +0000
1048 Zusammenfassung: commit on test
1049
1050 $ hg bookmark -d babar
1051
1052 #endif
1035 1053
1036 1054 log -p --cwd dir (in subdir)
1037 1055
1038 1056 $ mkdir dir
1039 1057 $ hg log -p --cwd dir
1040 1058 changeset: 3:f5d8de11c2e2
1041 1059 branch: test
1042 1060 tag: tip
1043 1061 parent: 1:d32277701ccb
1044 1062 user: test
1045 1063 date: Thu Jan 01 00:00:00 1970 +0000
1046 1064 summary: commit on test
1047 1065
1048 1066 diff -r d32277701ccb -r f5d8de11c2e2 c
1049 1067 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1050 1068 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1051 1069 @@ -0,0 +1,1 @@
1052 1070 +c
1053 1071
1054 1072 changeset: 2:c3a4f03cc9a7
1055 1073 parent: 0:24427303d56f
1056 1074 user: test
1057 1075 date: Thu Jan 01 00:00:00 1970 +0000
1058 1076 summary: commit on default
1059 1077
1060 1078 diff -r 24427303d56f -r c3a4f03cc9a7 c
1061 1079 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1062 1080 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1063 1081 @@ -0,0 +1,1 @@
1064 1082 +c
1065 1083
1066 1084 changeset: 1:d32277701ccb
1067 1085 branch: test
1068 1086 user: test
1069 1087 date: Thu Jan 01 00:00:00 1970 +0000
1070 1088 summary: commit on test
1071 1089
1072 1090 diff -r 24427303d56f -r d32277701ccb b
1073 1091 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1074 1092 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1075 1093 @@ -0,0 +1,1 @@
1076 1094 +b
1077 1095
1078 1096 changeset: 0:24427303d56f
1079 1097 user: test
1080 1098 date: Thu Jan 01 00:00:00 1970 +0000
1081 1099 summary: commit on default
1082 1100
1083 1101 diff -r 000000000000 -r 24427303d56f a
1084 1102 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1085 1103 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1086 1104 @@ -0,0 +1,1 @@
1087 1105 +a
1088 1106
1089 1107
1090 1108
1091 1109 log -p -R repo
1092 1110
1093 1111 $ cd dir
1094 1112 $ hg log -p -R .. ../a
1095 1113 changeset: 0:24427303d56f
1096 1114 user: test
1097 1115 date: Thu Jan 01 00:00:00 1970 +0000
1098 1116 summary: commit on default
1099 1117
1100 1118 diff -r 000000000000 -r 24427303d56f a
1101 1119 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1102 1120 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1103 1121 @@ -0,0 +1,1 @@
1104 1122 +a
1105 1123
1106 1124
1107 1125 $ cd ../..
1108 1126
1109 1127 $ hg init follow2
1110 1128 $ cd follow2
1111 1129
1112 1130 # Build the following history:
1113 1131 # tip - o - x - o - x - x
1114 1132 # \ /
1115 1133 # o - o - o - x
1116 1134 # \ /
1117 1135 # o
1118 1136 #
1119 1137 # Where "o" is a revision containing "foo" and
1120 1138 # "x" is a revision without "foo"
1121 1139
1122 1140 $ touch init
1123 1141 $ hg ci -A -m "init, unrelated"
1124 1142 adding init
1125 1143 $ echo 'foo' > init
1126 1144 $ hg ci -m "change, unrelated"
1127 1145 $ echo 'foo' > foo
1128 1146 $ hg ci -A -m "add unrelated old foo"
1129 1147 adding foo
1130 1148 $ hg rm foo
1131 1149 $ hg ci -m "delete foo, unrelated"
1132 1150 $ echo 'related' > foo
1133 1151 $ hg ci -A -m "add foo, related"
1134 1152 adding foo
1135 1153
1136 1154 $ hg up 0
1137 1155 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1138 1156 $ touch branch
1139 1157 $ hg ci -A -m "first branch, unrelated"
1140 1158 adding branch
1141 1159 created new head
1142 1160 $ touch foo
1143 1161 $ hg ci -A -m "create foo, related"
1144 1162 adding foo
1145 1163 $ echo 'change' > foo
1146 1164 $ hg ci -m "change foo, related"
1147 1165
1148 1166 $ hg up 6
1149 1167 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1150 1168 $ echo 'change foo in branch' > foo
1151 1169 $ hg ci -m "change foo in branch, related"
1152 1170 created new head
1153 1171 $ hg merge 7
1154 1172 merging foo
1155 1173 warning: conflicts during merge.
1156 1174 merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
1157 1175 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1158 1176 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1159 1177 [1]
1160 1178 $ echo 'merge 1' > foo
1161 1179 $ hg resolve -m foo
1162 1180 (no more unresolved files)
1163 1181 $ hg ci -m "First merge, related"
1164 1182
1165 1183 $ hg merge 4
1166 1184 merging foo
1167 1185 warning: conflicts during merge.
1168 1186 merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
1169 1187 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
1170 1188 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1171 1189 [1]
1172 1190 $ echo 'merge 2' > foo
1173 1191 $ hg resolve -m foo
1174 1192 (no more unresolved files)
1175 1193 $ hg ci -m "Last merge, related"
1176 1194
1177 1195 $ hg log --graph
1178 1196 @ changeset: 10:4dae8563d2c5
1179 1197 |\ tag: tip
1180 1198 | | parent: 9:7b35701b003e
1181 1199 | | parent: 4:88176d361b69
1182 1200 | | user: test
1183 1201 | | date: Thu Jan 01 00:00:00 1970 +0000
1184 1202 | | summary: Last merge, related
1185 1203 | |
1186 1204 | o changeset: 9:7b35701b003e
1187 1205 | |\ parent: 8:e5416ad8a855
1188 1206 | | | parent: 7:87fe3144dcfa
1189 1207 | | | user: test
1190 1208 | | | date: Thu Jan 01 00:00:00 1970 +0000
1191 1209 | | | summary: First merge, related
1192 1210 | | |
1193 1211 | | o changeset: 8:e5416ad8a855
1194 1212 | | | parent: 6:dc6c325fe5ee
1195 1213 | | | user: test
1196 1214 | | | date: Thu Jan 01 00:00:00 1970 +0000
1197 1215 | | | summary: change foo in branch, related
1198 1216 | | |
1199 1217 | o | changeset: 7:87fe3144dcfa
1200 1218 | |/ user: test
1201 1219 | | date: Thu Jan 01 00:00:00 1970 +0000
1202 1220 | | summary: change foo, related
1203 1221 | |
1204 1222 | o changeset: 6:dc6c325fe5ee
1205 1223 | | user: test
1206 1224 | | date: Thu Jan 01 00:00:00 1970 +0000
1207 1225 | | summary: create foo, related
1208 1226 | |
1209 1227 | o changeset: 5:73db34516eb9
1210 1228 | | parent: 0:e87515fd044a
1211 1229 | | user: test
1212 1230 | | date: Thu Jan 01 00:00:00 1970 +0000
1213 1231 | | summary: first branch, unrelated
1214 1232 | |
1215 1233 o | changeset: 4:88176d361b69
1216 1234 | | user: test
1217 1235 | | date: Thu Jan 01 00:00:00 1970 +0000
1218 1236 | | summary: add foo, related
1219 1237 | |
1220 1238 o | changeset: 3:dd78ae4afb56
1221 1239 | | user: test
1222 1240 | | date: Thu Jan 01 00:00:00 1970 +0000
1223 1241 | | summary: delete foo, unrelated
1224 1242 | |
1225 1243 o | changeset: 2:c4c64aedf0f7
1226 1244 | | user: test
1227 1245 | | date: Thu Jan 01 00:00:00 1970 +0000
1228 1246 | | summary: add unrelated old foo
1229 1247 | |
1230 1248 o | changeset: 1:e5faa7440653
1231 1249 |/ user: test
1232 1250 | date: Thu Jan 01 00:00:00 1970 +0000
1233 1251 | summary: change, unrelated
1234 1252 |
1235 1253 o changeset: 0:e87515fd044a
1236 1254 user: test
1237 1255 date: Thu Jan 01 00:00:00 1970 +0000
1238 1256 summary: init, unrelated
1239 1257
1240 1258
1241 1259 $ hg --traceback log -f foo
1242 1260 changeset: 10:4dae8563d2c5
1243 1261 tag: tip
1244 1262 parent: 9:7b35701b003e
1245 1263 parent: 4:88176d361b69
1246 1264 user: test
1247 1265 date: Thu Jan 01 00:00:00 1970 +0000
1248 1266 summary: Last merge, related
1249 1267
1250 1268 changeset: 9:7b35701b003e
1251 1269 parent: 8:e5416ad8a855
1252 1270 parent: 7:87fe3144dcfa
1253 1271 user: test
1254 1272 date: Thu Jan 01 00:00:00 1970 +0000
1255 1273 summary: First merge, related
1256 1274
1257 1275 changeset: 8:e5416ad8a855
1258 1276 parent: 6:dc6c325fe5ee
1259 1277 user: test
1260 1278 date: Thu Jan 01 00:00:00 1970 +0000
1261 1279 summary: change foo in branch, related
1262 1280
1263 1281 changeset: 7:87fe3144dcfa
1264 1282 user: test
1265 1283 date: Thu Jan 01 00:00:00 1970 +0000
1266 1284 summary: change foo, related
1267 1285
1268 1286 changeset: 6:dc6c325fe5ee
1269 1287 user: test
1270 1288 date: Thu Jan 01 00:00:00 1970 +0000
1271 1289 summary: create foo, related
1272 1290
1273 1291 changeset: 4:88176d361b69
1274 1292 user: test
1275 1293 date: Thu Jan 01 00:00:00 1970 +0000
1276 1294 summary: add foo, related
1277 1295
1278 1296
1279 1297 Also check when maxrev < lastrevfilelog
1280 1298
1281 1299 $ hg --traceback log -f -r4 foo
1282 1300 changeset: 4:88176d361b69
1283 1301 user: test
1284 1302 date: Thu Jan 01 00:00:00 1970 +0000
1285 1303 summary: add foo, related
1286 1304
1287 1305 $ cd ..
1288 1306
1289 1307 Issue2383: hg log showing _less_ differences than hg diff
1290 1308
1291 1309 $ hg init issue2383
1292 1310 $ cd issue2383
1293 1311
1294 1312 Create a test repo:
1295 1313
1296 1314 $ echo a > a
1297 1315 $ hg ci -Am0
1298 1316 adding a
1299 1317 $ echo b > b
1300 1318 $ hg ci -Am1
1301 1319 adding b
1302 1320 $ hg co 0
1303 1321 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1304 1322 $ echo b > a
1305 1323 $ hg ci -m2
1306 1324 created new head
1307 1325
1308 1326 Merge:
1309 1327
1310 1328 $ hg merge
1311 1329 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1312 1330 (branch merge, don't forget to commit)
1313 1331
1314 1332 Make sure there's a file listed in the merge to trigger the bug:
1315 1333
1316 1334 $ echo c > a
1317 1335 $ hg ci -m3
1318 1336
1319 1337 Two files shown here in diff:
1320 1338
1321 1339 $ hg diff --rev 2:3
1322 1340 diff -r b09be438c43a -r 8e07aafe1edc a
1323 1341 --- a/a Thu Jan 01 00:00:00 1970 +0000
1324 1342 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1325 1343 @@ -1,1 +1,1 @@
1326 1344 -b
1327 1345 +c
1328 1346 diff -r b09be438c43a -r 8e07aafe1edc b
1329 1347 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1330 1348 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1331 1349 @@ -0,0 +1,1 @@
1332 1350 +b
1333 1351
1334 1352 Diff here should be the same:
1335 1353
1336 1354 $ hg log -vpr 3
1337 1355 changeset: 3:8e07aafe1edc
1338 1356 tag: tip
1339 1357 parent: 2:b09be438c43a
1340 1358 parent: 1:925d80f479bb
1341 1359 user: test
1342 1360 date: Thu Jan 01 00:00:00 1970 +0000
1343 1361 files: a
1344 1362 description:
1345 1363 3
1346 1364
1347 1365
1348 1366 diff -r b09be438c43a -r 8e07aafe1edc a
1349 1367 --- a/a Thu Jan 01 00:00:00 1970 +0000
1350 1368 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1351 1369 @@ -1,1 +1,1 @@
1352 1370 -b
1353 1371 +c
1354 1372 diff -r b09be438c43a -r 8e07aafe1edc b
1355 1373 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1356 1374 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1357 1375 @@ -0,0 +1,1 @@
1358 1376 +b
1359 1377
1360 1378 $ cd ..
1361 1379
1362 1380 'hg log -r rev fn' when last(filelog(fn)) != rev
1363 1381
1364 1382 $ hg init simplelog
1365 1383 $ cd simplelog
1366 1384 $ echo f > a
1367 1385 $ hg ci -Am'a' -d '0 0'
1368 1386 adding a
1369 1387 $ echo f >> a
1370 1388 $ hg ci -Am'a bis' -d '1 0'
1371 1389
1372 1390 $ hg log -r0 a
1373 1391 changeset: 0:9f758d63dcde
1374 1392 user: test
1375 1393 date: Thu Jan 01 00:00:00 1970 +0000
1376 1394 summary: a
1377 1395
1378 1396 enable obsolete to test hidden feature
1379 1397
1380 1398 $ cat >> $HGRCPATH << EOF
1381 1399 > [experimental]
1382 1400 > evolution=createmarkers
1383 1401 > EOF
1384 1402
1385 1403 $ hg log --template='{rev}:{node}\n'
1386 1404 1:a765632148dc55d38c35c4f247c618701886cb2f
1387 1405 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1388 1406 $ hg debugobsolete a765632148dc55d38c35c4f247c618701886cb2f
1389 1407 $ hg up null -q
1390 1408 $ hg log --template='{rev}:{node}\n'
1391 1409 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1392 1410 $ hg log --template='{rev}:{node}\n' --hidden
1393 1411 1:a765632148dc55d38c35c4f247c618701886cb2f
1394 1412 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1395 1413 $ hg log -r a
1396 1414 abort: hidden revision 'a'!
1397 1415 (use --hidden to access hidden revisions)
1398 1416 [255]
1399 1417
1400 1418 test that parent prevent a changeset to be hidden
1401 1419
1402 1420 $ hg up 1 -q --hidden
1403 1421 $ hg log --template='{rev}:{node}\n'
1404 1422 1:a765632148dc55d38c35c4f247c618701886cb2f
1405 1423 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1406 1424
1407 1425 test that second parent prevent a changeset to be hidden too
1408 1426
1409 1427 $ hg debugsetparents 0 1 # nothing suitable to merge here
1410 1428 $ hg log --template='{rev}:{node}\n'
1411 1429 1:a765632148dc55d38c35c4f247c618701886cb2f
1412 1430 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1413 1431 $ hg debugsetparents 1
1414 1432 $ hg up -q null
1415 1433
1416 1434 bookmarks prevent a changeset being hidden
1417 1435
1418 1436 $ hg bookmark --hidden -r 1 X
1419 1437 $ hg log --template '{rev}:{node}\n'
1420 1438 1:a765632148dc55d38c35c4f247c618701886cb2f
1421 1439 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1422 1440 $ hg bookmark -d X
1423 1441
1424 1442 divergent bookmarks are not hidden
1425 1443
1426 1444 $ hg bookmark --hidden -r 1 X@foo
1427 1445 $ hg log --template '{rev}:{node}\n'
1428 1446 1:a765632148dc55d38c35c4f247c618701886cb2f
1429 1447 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1430 1448
1431 1449 clear extensions configuration
1432 1450 $ echo '[extensions]' >> $HGRCPATH
1433 1451 $ echo "obs=!" >> $HGRCPATH
1434 1452 $ cd ..
1435 1453
1436 1454 test -u/-k for problematic encoding
1437 1455 # unicode: cp932:
1438 1456 # u30A2 0x83 0x41(= 'A')
1439 1457 # u30C2 0x83 0x61(= 'a')
1440 1458
1441 1459 $ hg init problematicencoding
1442 1460 $ cd problematicencoding
1443 1461
1444 1462 $ python > setup.sh <<EOF
1445 1463 > print u'''
1446 1464 > echo a > text
1447 1465 > hg add text
1448 1466 > hg --encoding utf-8 commit -u '\u30A2' -m none
1449 1467 > echo b > text
1450 1468 > hg --encoding utf-8 commit -u '\u30C2' -m none
1451 1469 > echo c > text
1452 1470 > hg --encoding utf-8 commit -u none -m '\u30A2'
1453 1471 > echo d > text
1454 1472 > hg --encoding utf-8 commit -u none -m '\u30C2'
1455 1473 > '''.encode('utf-8')
1456 1474 > EOF
1457 1475 $ sh < setup.sh
1458 1476
1459 1477 test in problematic encoding
1460 1478 $ python > test.sh <<EOF
1461 1479 > print u'''
1462 1480 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2'
1463 1481 > echo ====
1464 1482 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2'
1465 1483 > echo ====
1466 1484 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2'
1467 1485 > echo ====
1468 1486 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2'
1469 1487 > '''.encode('cp932')
1470 1488 > EOF
1471 1489 $ sh < test.sh
1472 1490 0
1473 1491 ====
1474 1492 1
1475 1493 ====
1476 1494 2
1477 1495 0
1478 1496 ====
1479 1497 3
1480 1498 1
1481 1499
1482 1500 $ cd ..
1483 1501
1484 1502 test hg log on non-existent files and on directories
1485 1503 $ hg init issue1340
1486 1504 $ cd issue1340
1487 1505 $ mkdir d1; mkdir D2; mkdir D3.i; mkdir d4.hg; mkdir d5.d; mkdir .d6
1488 1506 $ echo 1 > d1/f1
1489 1507 $ echo 1 > D2/f1
1490 1508 $ echo 1 > D3.i/f1
1491 1509 $ echo 1 > d4.hg/f1
1492 1510 $ echo 1 > d5.d/f1
1493 1511 $ echo 1 > .d6/f1
1494 1512 $ hg -q add .
1495 1513 $ hg commit -m "a bunch of weird directories"
1496 1514 $ hg log -l1 d1/f1 | grep changeset
1497 1515 changeset: 0:65624cd9070a
1498 1516 $ hg log -l1 f1
1499 1517 $ hg log -l1 . | grep changeset
1500 1518 changeset: 0:65624cd9070a
1501 1519 $ hg log -l1 ./ | grep changeset
1502 1520 changeset: 0:65624cd9070a
1503 1521 $ hg log -l1 d1 | grep changeset
1504 1522 changeset: 0:65624cd9070a
1505 1523 $ hg log -l1 D2 | grep changeset
1506 1524 changeset: 0:65624cd9070a
1507 1525 $ hg log -l1 D2/f1 | grep changeset
1508 1526 changeset: 0:65624cd9070a
1509 1527 $ hg log -l1 D3.i | grep changeset
1510 1528 changeset: 0:65624cd9070a
1511 1529 $ hg log -l1 D3.i/f1 | grep changeset
1512 1530 changeset: 0:65624cd9070a
1513 1531 $ hg log -l1 d4.hg | grep changeset
1514 1532 changeset: 0:65624cd9070a
1515 1533 $ hg log -l1 d4.hg/f1 | grep changeset
1516 1534 changeset: 0:65624cd9070a
1517 1535 $ hg log -l1 d5.d | grep changeset
1518 1536 changeset: 0:65624cd9070a
1519 1537 $ hg log -l1 d5.d/f1 | grep changeset
1520 1538 changeset: 0:65624cd9070a
1521 1539 $ hg log -l1 .d6 | grep changeset
1522 1540 changeset: 0:65624cd9070a
1523 1541 $ hg log -l1 .d6/f1 | grep changeset
1524 1542 changeset: 0:65624cd9070a
1525 1543
1526 1544 issue3772: hg log -r :null showing revision 0 as well
1527 1545
1528 1546 $ hg log -r :null
1529 1547 changeset: 0:65624cd9070a
1530 1548 tag: tip
1531 1549 user: test
1532 1550 date: Thu Jan 01 00:00:00 1970 +0000
1533 1551 summary: a bunch of weird directories
1534 1552
1535 1553 changeset: -1:000000000000
1536 1554 user:
1537 1555 date: Thu Jan 01 00:00:00 1970 +0000
1538 1556
1539 1557 $ hg log -r null:null
1540 1558 changeset: -1:000000000000
1541 1559 user:
1542 1560 date: Thu Jan 01 00:00:00 1970 +0000
1543 1561
1544 1562
1545 1563 $ cd ..
1546 1564
1547 1565 hg log -f dir across branches
1548 1566
1549 1567 $ hg init acrossbranches
1550 1568 $ cd acrossbranches
1551 1569 $ mkdir d
1552 1570 $ echo a > d/a && hg ci -Aqm a
1553 1571 $ echo b > d/a && hg ci -Aqm b
1554 1572 $ hg up -q 0
1555 1573 $ echo b > d/a && hg ci -Aqm c
1556 1574 $ hg log -f d -T '{desc}' -G
1557 1575 @ c
1558 1576 |
1559 1577 o a
1560 1578
1561 1579 $ hg log -f d/a -T '{desc}' -G
1562 1580 @ c
1563 1581 |
1564 1582 o a
1565 1583
1566 1584 $ cd ..
1567 1585
1568 1586 hg log -f with linkrev pointing to another branch
1569 1587 -------------------------------------------------
1570 1588
1571 1589 create history with a filerev whose linkrev points to another branch
1572 1590
1573 1591 $ hg init branchedlinkrev
1574 1592 $ cd branchedlinkrev
1575 1593 $ echo 1 > a
1576 1594 $ hg commit -Am 'content1'
1577 1595 adding a
1578 1596 $ echo 2 > a
1579 1597 $ hg commit -m 'content2'
1580 1598 $ hg up --rev 'desc(content1)'
1581 1599 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1582 1600 $ echo unrelated > unrelated
1583 1601 $ hg commit -Am 'unrelated'
1584 1602 adding unrelated
1585 1603 created new head
1586 1604 $ hg graft -r 'desc(content2)'
1587 1605 grafting 1:2294ae80ad84 "content2"
1588 1606 $ echo 3 > a
1589 1607 $ hg commit -m 'content3'
1590 1608 $ hg log -G
1591 1609 @ changeset: 4:50b9b36e9c5d
1592 1610 | tag: tip
1593 1611 | user: test
1594 1612 | date: Thu Jan 01 00:00:00 1970 +0000
1595 1613 | summary: content3
1596 1614 |
1597 1615 o changeset: 3:15b2327059e5
1598 1616 | user: test
1599 1617 | date: Thu Jan 01 00:00:00 1970 +0000
1600 1618 | summary: content2
1601 1619 |
1602 1620 o changeset: 2:2029acd1168c
1603 1621 | parent: 0:ae0a3c9f9e95
1604 1622 | user: test
1605 1623 | date: Thu Jan 01 00:00:00 1970 +0000
1606 1624 | summary: unrelated
1607 1625 |
1608 1626 | o changeset: 1:2294ae80ad84
1609 1627 |/ user: test
1610 1628 | date: Thu Jan 01 00:00:00 1970 +0000
1611 1629 | summary: content2
1612 1630 |
1613 1631 o changeset: 0:ae0a3c9f9e95
1614 1632 user: test
1615 1633 date: Thu Jan 01 00:00:00 1970 +0000
1616 1634 summary: content1
1617 1635
1618 1636
1619 1637 log -f on the file should list the graft result.
1620 1638
1621 1639 $ hg log -Gf a
1622 1640 @ changeset: 4:50b9b36e9c5d
1623 1641 | tag: tip
1624 1642 | user: test
1625 1643 | date: Thu Jan 01 00:00:00 1970 +0000
1626 1644 | summary: content3
1627 1645 |
1628 1646 o changeset: 3:15b2327059e5
1629 1647 | user: test
1630 1648 | date: Thu Jan 01 00:00:00 1970 +0000
1631 1649 | summary: content2
1632 1650 |
1633 1651 o changeset: 0:ae0a3c9f9e95
1634 1652 user: test
1635 1653 date: Thu Jan 01 00:00:00 1970 +0000
1636 1654 summary: content1
1637 1655
1638 1656
1639 1657 plain log lists the original version
1640 1658 (XXX we should probably list both)
1641 1659
1642 1660 $ hg log -G a
1643 1661 @ changeset: 4:50b9b36e9c5d
1644 1662 | tag: tip
1645 1663 | user: test
1646 1664 | date: Thu Jan 01 00:00:00 1970 +0000
1647 1665 | summary: content3
1648 1666 |
1649 1667 | o changeset: 1:2294ae80ad84
1650 1668 |/ user: test
1651 1669 | date: Thu Jan 01 00:00:00 1970 +0000
1652 1670 | summary: content2
1653 1671 |
1654 1672 o changeset: 0:ae0a3c9f9e95
1655 1673 user: test
1656 1674 date: Thu Jan 01 00:00:00 1970 +0000
1657 1675 summary: content1
1658 1676
1659 1677
1660 1678 hg log -f from the grafted changeset
1661 1679 (The bootstrap should properly take the topology in account)
1662 1680
1663 1681 $ hg up 'desc(content3)^'
1664 1682 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1665 1683 $ hg log -Gf a
1666 1684 @ changeset: 3:15b2327059e5
1667 1685 | user: test
1668 1686 | date: Thu Jan 01 00:00:00 1970 +0000
1669 1687 | summary: content2
1670 1688 |
1671 1689 o changeset: 0:ae0a3c9f9e95
1672 1690 user: test
1673 1691 date: Thu Jan 01 00:00:00 1970 +0000
1674 1692 summary: content1
1675 1693
1676 1694
1677 1695 Test that we use the first non-hidden changeset in that case.
1678 1696
1679 1697 (hide the changeset)
1680 1698
1681 1699 $ hg log -T '{node}\n' -r 1
1682 1700 2294ae80ad8447bc78383182eeac50cb049df623
1683 1701 $ hg debugobsolete 2294ae80ad8447bc78383182eeac50cb049df623
1684 1702 $ hg log -G
1685 1703 o changeset: 4:50b9b36e9c5d
1686 1704 | tag: tip
1687 1705 | user: test
1688 1706 | date: Thu Jan 01 00:00:00 1970 +0000
1689 1707 | summary: content3
1690 1708 |
1691 1709 @ changeset: 3:15b2327059e5
1692 1710 | user: test
1693 1711 | date: Thu Jan 01 00:00:00 1970 +0000
1694 1712 | summary: content2
1695 1713 |
1696 1714 o changeset: 2:2029acd1168c
1697 1715 | parent: 0:ae0a3c9f9e95
1698 1716 | user: test
1699 1717 | date: Thu Jan 01 00:00:00 1970 +0000
1700 1718 | summary: unrelated
1701 1719 |
1702 1720 o changeset: 0:ae0a3c9f9e95
1703 1721 user: test
1704 1722 date: Thu Jan 01 00:00:00 1970 +0000
1705 1723 summary: content1
1706 1724
1707 1725
1708 1726 Check that log on the file does not drop the file revision.
1709 1727
1710 1728 $ hg log -G a
1711 1729 o changeset: 4:50b9b36e9c5d
1712 1730 | tag: tip
1713 1731 | user: test
1714 1732 | date: Thu Jan 01 00:00:00 1970 +0000
1715 1733 | summary: content3
1716 1734 |
1717 1735 @ changeset: 3:15b2327059e5
1718 1736 | user: test
1719 1737 | date: Thu Jan 01 00:00:00 1970 +0000
1720 1738 | summary: content2
1721 1739 |
1722 1740 o changeset: 0:ae0a3c9f9e95
1723 1741 user: test
1724 1742 date: Thu Jan 01 00:00:00 1970 +0000
1725 1743 summary: content1
1726 1744
1727 1745
1728 1746 Even when a head revision is linkrev-shadowed.
1729 1747
1730 1748 $ hg log -T '{node}\n' -r 4
1731 1749 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
1732 1750 $ hg debugobsolete 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
1733 1751 $ hg log -G a
1734 1752 @ changeset: 3:15b2327059e5
1735 1753 | tag: tip
1736 1754 | user: test
1737 1755 | date: Thu Jan 01 00:00:00 1970 +0000
1738 1756 | summary: content2
1739 1757 |
1740 1758 o changeset: 0:ae0a3c9f9e95
1741 1759 user: test
1742 1760 date: Thu Jan 01 00:00:00 1970 +0000
1743 1761 summary: content1
1744 1762
1745 1763
1746 1764 $ cd ..
1747 1765
1748 1766 Even when the file revision is missing from some head:
1749 1767
1750 1768 $ hg init issue4490
1751 1769 $ cd issue4490
1752 1770 $ echo '[experimental]' >> .hg/hgrc
1753 1771 $ echo 'evolution=createmarkers' >> .hg/hgrc
1754 1772 $ echo a > a
1755 1773 $ hg ci -Am0
1756 1774 adding a
1757 1775 $ echo b > b
1758 1776 $ hg ci -Am1
1759 1777 adding b
1760 1778 $ echo B > b
1761 1779 $ hg ci --amend -m 1
1762 1780 $ hg up 0
1763 1781 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1764 1782 $ echo c > c
1765 1783 $ hg ci -Am2
1766 1784 adding c
1767 1785 created new head
1768 1786 $ hg up 'head() and not .'
1769 1787 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1770 1788 $ hg log -G
1771 1789 o changeset: 4:db815d6d32e6
1772 1790 | tag: tip
1773 1791 | parent: 0:f7b1eb17ad24
1774 1792 | user: test
1775 1793 | date: Thu Jan 01 00:00:00 1970 +0000
1776 1794 | summary: 2
1777 1795 |
1778 1796 | @ changeset: 3:9bc8ce7f9356
1779 1797 |/ parent: 0:f7b1eb17ad24
1780 1798 | user: test
1781 1799 | date: Thu Jan 01 00:00:00 1970 +0000
1782 1800 | summary: 1
1783 1801 |
1784 1802 o changeset: 0:f7b1eb17ad24
1785 1803 user: test
1786 1804 date: Thu Jan 01 00:00:00 1970 +0000
1787 1805 summary: 0
1788 1806
1789 1807 $ hg log -f -G b
1790 1808 @ changeset: 3:9bc8ce7f9356
1791 1809 | parent: 0:f7b1eb17ad24
1792 1810 | user: test
1793 1811 | date: Thu Jan 01 00:00:00 1970 +0000
1794 1812 | summary: 1
1795 1813 |
1796 1814 $ hg log -G b
1797 1815 @ changeset: 3:9bc8ce7f9356
1798 1816 | parent: 0:f7b1eb17ad24
1799 1817 | user: test
1800 1818 | date: Thu Jan 01 00:00:00 1970 +0000
1801 1819 | summary: 1
1802 1820 |
General Comments 0
You need to be logged in to leave comments. Login now