##// END OF EJS Templates
test-keyword: improve grammar and spelling in branchcache note...
Christian Ebert -
r18295:3cdf04e1 default
parent child Browse files
Show More
@@ -1,1155 +1,1155 b''
1 1 $ cat <<EOF >> $HGRCPATH
2 2 > [extensions]
3 3 > keyword =
4 4 > mq =
5 5 > notify =
6 6 > record =
7 7 > transplant =
8 8 > [ui]
9 9 > interactive = true
10 10 > EOF
11 11
12 12 hide outer repo
13 13 $ hg init
14 14
15 15 Run kwdemo before [keyword] files are set up
16 16 as it would succeed without uisetup otherwise
17 17
18 18 $ hg --quiet kwdemo
19 19 [extensions]
20 20 keyword =
21 21 [keyword]
22 22 demo.txt =
23 23 [keywordset]
24 24 svn = False
25 25 [keywordmaps]
26 26 Author = {author|user}
27 27 Date = {date|utcdate}
28 28 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
29 29 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
30 30 RCSFile = {file|basename},v
31 31 RCSfile = {file|basename},v
32 32 Revision = {node|short}
33 33 Source = {root}/{file},v
34 34 $Author: test $
35 35 $Date: ????/??/?? ??:??:?? $ (glob)
36 36 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
37 37 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
38 38 $RCSFile: demo.txt,v $
39 39 $RCSfile: demo.txt,v $
40 40 $Revision: ???????????? $ (glob)
41 41 $Source: */demo.txt,v $ (glob)
42 42
43 43 $ hg --quiet kwdemo "Branch = {branches}"
44 44 [extensions]
45 45 keyword =
46 46 [keyword]
47 47 demo.txt =
48 48 [keywordset]
49 49 svn = False
50 50 [keywordmaps]
51 51 Branch = {branches}
52 52 $Branch: demobranch $
53 53
54 54 $ cat <<EOF >> $HGRCPATH
55 55 > [keyword]
56 56 > ** =
57 57 > b = ignore
58 58 > i = ignore
59 59 > [hooks]
60 60 > EOF
61 61 $ cp $HGRCPATH $HGRCPATH.nohooks
62 62 > cat <<EOF >> $HGRCPATH
63 63 > commit=
64 64 > commit.test=cp a hooktest
65 65 > EOF
66 66
67 67 $ hg init Test-bndl
68 68 $ cd Test-bndl
69 69
70 70 kwshrink should exit silently in empty/invalid repo
71 71
72 72 $ hg kwshrink
73 73
74 74 Symlinks cannot be created on Windows.
75 75 A bundle to test this was made with:
76 76 hg init t
77 77 cd t
78 78 echo a > a
79 79 ln -s a sym
80 80 hg add sym
81 81 hg ci -m addsym -u mercurial
82 82 hg bundle --base null ../test-keyword.hg
83 83
84 84 $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg
85 85 pulling from *test-keyword.hg (glob)
86 86 requesting all changes
87 87 adding changesets
88 88 adding manifests
89 89 adding file changes
90 90 added 1 changesets with 1 changes to 1 files
91 91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 92
93 93 $ echo 'expand $Id$' > a
94 94 $ echo 'do not process $Id:' >> a
95 95 $ echo 'xxx $' >> a
96 96 $ echo 'ignore $Id$' > b
97 97
98 98 Output files as they were created
99 99
100 100 $ cat a b
101 101 expand $Id$
102 102 do not process $Id:
103 103 xxx $
104 104 ignore $Id$
105 105
106 106 no kwfiles
107 107
108 108 $ hg kwfiles
109 109
110 110 untracked candidates
111 111
112 112 $ hg -v kwfiles --unknown
113 113 k a
114 114
115 115 Add files and check status
116 116
117 117 $ hg addremove
118 118 adding a
119 119 adding b
120 120 $ hg status
121 121 A a
122 122 A b
123 123
124 124
125 125 Default keyword expansion including commit hook
126 126 Interrupted commit should not change state or run commit hook
127 127
128 128 $ hg --debug commit
129 129 abort: empty commit message
130 130 [255]
131 131 $ hg status
132 132 A a
133 133 A b
134 134
135 135 Commit with several checks
136 136
137 137 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
138 138 a
139 139 b
140 140 overwriting a expanding keywords
141 141 running hook commit.test: cp a hooktest
142 142 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
143 143 $ hg status
144 144 ? hooktest
145 145 $ hg debugrebuildstate
146 146 $ hg --quiet identify
147 147 ef63ca68695b
148 148
149 149 cat files in working directory with keywords expanded
150 150
151 151 $ cat a b
152 152 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
153 153 do not process $Id:
154 154 xxx $
155 155 ignore $Id$
156 156
157 157 hg cat files and symlink, no expansion
158 158
159 159 $ hg cat sym a b && echo
160 160 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
161 161 do not process $Id:
162 162 xxx $
163 163 ignore $Id$
164 164 a
165 165
166 166 $ diff a hooktest
167 167
168 168 $ cp $HGRCPATH.nohooks $HGRCPATH
169 169 $ rm hooktest
170 170
171 171 hg status of kw-ignored binary file starting with '\1\n'
172 172
173 173 >>> open("i", "wb").write("\1\nfoo")
174 174 $ hg -q commit -Am metasep i
175 175 $ hg status
176 176 >>> open("i", "wb").write("\1\nbar")
177 177 $ hg status
178 178 M i
179 179 $ hg -q commit -m "modify metasep" i
180 180 $ hg status --rev 2:3
181 181 M i
182 182 $ touch empty
183 183 $ hg -q commit -A -m "another file"
184 184 $ hg status -A --rev 3:4 i
185 185 C i
186 186
187 187 $ hg -q strip -n 2
188 188
189 189 Test hook execution
190 190
191 191 bundle
192 192
193 193 $ hg bundle --base null ../kw.hg
194 194 2 changesets found
195 195 $ cd ..
196 196 $ hg init Test
197 197 $ cd Test
198 198
199 199 Notify on pull to check whether keywords stay as is in email
200 200 ie. if patch.diff wrapper acts as it should
201 201
202 202 $ cat <<EOF >> $HGRCPATH
203 203 > [hooks]
204 204 > incoming.notify = python:hgext.notify.hook
205 205 > [notify]
206 206 > sources = pull
207 207 > diffstat = False
208 208 > maxsubject = 15
209 209 > [reposubs]
210 210 > * = Test
211 211 > EOF
212 212
213 213 Pull from bundle and trigger notify
214 214
215 215 $ hg pull -u ../kw.hg
216 216 pulling from ../kw.hg
217 217 requesting all changes
218 218 adding changesets
219 219 adding manifests
220 220 adding file changes
221 221 added 2 changesets with 3 changes to 3 files
222 222 Content-Type: text/plain; charset="us-ascii"
223 223 MIME-Version: 1.0
224 224 Content-Transfer-Encoding: 7bit
225 225 Date: * (glob)
226 226 Subject: changeset in...
227 227 From: mercurial
228 228 X-Hg-Notification: changeset a2392c293916
229 229 Message-Id: <hg.a2392c293916*> (glob)
230 230 To: Test
231 231
232 232 changeset a2392c293916 in $TESTTMP/Test (glob)
233 233 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
234 234 description:
235 235 addsym
236 236
237 237 diffs (6 lines):
238 238
239 239 diff -r 000000000000 -r a2392c293916 sym
240 240 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
241 241 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
242 242 @@ -0,0 +1,1 @@
243 243 +a
244 244 \ No newline at end of file
245 245 Content-Type: text/plain; charset="us-ascii"
246 246 MIME-Version: 1.0
247 247 Content-Transfer-Encoding: 7bit
248 248 Date:* (glob)
249 249 Subject: changeset in...
250 250 From: User Name <user@example.com>
251 251 X-Hg-Notification: changeset ef63ca68695b
252 252 Message-Id: <hg.ef63ca68695b*> (glob)
253 253 To: Test
254 254
255 255 changeset ef63ca68695b in $TESTTMP/Test (glob)
256 256 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
257 257 description:
258 258 absym
259 259
260 260 diffs (12 lines):
261 261
262 262 diff -r a2392c293916 -r ef63ca68695b a
263 263 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
264 264 +++ b/a Thu Jan 01 00:00:00 1970 +0000
265 265 @@ -0,0 +1,3 @@
266 266 +expand $Id$
267 267 +do not process $Id:
268 268 +xxx $
269 269 diff -r a2392c293916 -r ef63ca68695b b
270 270 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
271 271 +++ b/b Thu Jan 01 00:00:00 1970 +0000
272 272 @@ -0,0 +1,1 @@
273 273 +ignore $Id$
274 274 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
275 275
276 276 $ cp $HGRCPATH.nohooks $HGRCPATH
277 277
278 278 Touch files and check with status
279 279
280 280 $ touch a b
281 281 $ hg status
282 282
283 283 Update and expand
284 284
285 285 $ rm sym a b
286 286 $ hg update -C
287 287 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
288 288 $ cat a b
289 289 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
290 290 do not process $Id:
291 291 xxx $
292 292 ignore $Id$
293 293
294 294 Check whether expansion is filewise and file mode is preserved
295 295
296 296 $ echo '$Id$' > c
297 297 $ echo 'tests for different changenodes' >> c
298 298 #if unix-permissions
299 299 $ chmod 600 c
300 300 $ ls -l c | cut -b 1-10
301 301 -rw-------
302 302 #endif
303 303
304 304 commit file c
305 305
306 306 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
307 307 adding c
308 308 #if unix-permissions
309 309 $ ls -l c | cut -b 1-10
310 310 -rw-------
311 311 #endif
312 312
313 313 force expansion
314 314
315 315 $ hg -v kwexpand
316 316 overwriting a expanding keywords
317 317 overwriting c expanding keywords
318 318
319 319 compare changenodes in a and c
320 320
321 321 $ cat a c
322 322 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
323 323 do not process $Id:
324 324 xxx $
325 325 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
326 326 tests for different changenodes
327 327
328 328 record
329 329
330 330 $ echo '$Id$' > r
331 331 $ hg add r
332 332
333 333 record chunk
334 334
335 335 >>> lines = open('a', 'rb').readlines()
336 336 >>> lines.insert(1, 'foo\n')
337 337 >>> lines.append('bar\n')
338 338 >>> open('a', 'wb').writelines(lines)
339 339 $ hg record -d '10 1' -m rectest a<<EOF
340 340 > y
341 341 > y
342 342 > n
343 343 > EOF
344 344 diff --git a/a b/a
345 345 2 hunks, 2 lines changed
346 346 examine changes to 'a'? [Ynesfdaq?]
347 347 @@ -1,3 +1,4 @@
348 348 expand $Id$
349 349 +foo
350 350 do not process $Id:
351 351 xxx $
352 352 record change 1/2 to 'a'? [Ynesfdaq?]
353 353 @@ -2,2 +3,3 @@
354 354 do not process $Id:
355 355 xxx $
356 356 +bar
357 357 record change 2/2 to 'a'? [Ynesfdaq?]
358 358
359 359 $ hg identify
360 360 5f5eb23505c3+ tip
361 361 $ hg status
362 362 M a
363 363 A r
364 364
365 365 Cat modified file a
366 366
367 367 $ cat a
368 368 expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
369 369 foo
370 370 do not process $Id:
371 371 xxx $
372 372 bar
373 373
374 374 Diff remaining chunk
375 375
376 376 $ hg diff a
377 377 diff -r 5f5eb23505c3 a
378 378 --- a/a Thu Jan 01 00:00:09 1970 -0000
379 379 +++ b/a * (glob)
380 380 @@ -2,3 +2,4 @@
381 381 foo
382 382 do not process $Id:
383 383 xxx $
384 384 +bar
385 385
386 386 $ hg rollback
387 387 repository tip rolled back to revision 2 (undo commit)
388 388 working directory now based on revision 2
389 389
390 390 Record all chunks in file a
391 391
392 392 $ echo foo > msg
393 393
394 394 - do not use "hg record -m" here!
395 395
396 396 $ hg record -l msg -d '11 1' a<<EOF
397 397 > y
398 398 > y
399 399 > y
400 400 > EOF
401 401 diff --git a/a b/a
402 402 2 hunks, 2 lines changed
403 403 examine changes to 'a'? [Ynesfdaq?]
404 404 @@ -1,3 +1,4 @@
405 405 expand $Id$
406 406 +foo
407 407 do not process $Id:
408 408 xxx $
409 409 record change 1/2 to 'a'? [Ynesfdaq?]
410 410 @@ -2,2 +3,3 @@
411 411 do not process $Id:
412 412 xxx $
413 413 +bar
414 414 record change 2/2 to 'a'? [Ynesfdaq?]
415 415
416 416 File a should be clean
417 417
418 418 $ hg status -A a
419 419 C a
420 420
421 421 rollback and revert expansion
422 422
423 423 $ cat a
424 424 expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
425 425 foo
426 426 do not process $Id:
427 427 xxx $
428 428 bar
429 429 $ hg --verbose rollback
430 430 repository tip rolled back to revision 2 (undo commit)
431 431 working directory now based on revision 2
432 432 overwriting a expanding keywords
433 433 $ hg status a
434 434 M a
435 435 $ cat a
436 436 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
437 437 foo
438 438 do not process $Id:
439 439 xxx $
440 440 bar
441 441 $ echo '$Id$' > y
442 442 $ echo '$Id$' > z
443 443 $ hg add y
444 444 $ hg commit -Am "rollback only" z
445 445 $ cat z
446 446 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
447 447 $ hg --verbose rollback
448 448 repository tip rolled back to revision 2 (undo commit)
449 449 working directory now based on revision 2
450 450 overwriting z shrinking keywords
451 451
452 452 Only z should be overwritten
453 453
454 454 $ hg status a y z
455 455 M a
456 456 A y
457 457 A z
458 458 $ cat z
459 459 $Id$
460 460 $ hg forget y z
461 461 $ rm y z
462 462
463 463 record added file alone
464 464
465 465 $ hg -v record -l msg -d '12 2' r<<EOF
466 466 > y
467 467 > EOF
468 468 diff --git a/r b/r
469 469 new file mode 100644
470 470 examine changes to 'r'? [Ynesfdaq?]
471 471 r
472 472 committed changeset 3:82a2f715724d
473 473 overwriting r expanding keywords
474 474 - status call required for dirstate.normallookup() check
475 475 $ hg status r
476 476 $ hg --verbose rollback
477 477 repository tip rolled back to revision 2 (undo commit)
478 478 working directory now based on revision 2
479 479 overwriting r shrinking keywords
480 480 $ hg forget r
481 481 $ rm msg r
482 482 $ hg update -C
483 483 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
484 484
485 485 record added keyword ignored file
486 486
487 487 $ echo '$Id$' > i
488 488 $ hg add i
489 489 $ hg --verbose record -d '13 1' -m recignored<<EOF
490 490 > y
491 491 > EOF
492 492 diff --git a/i b/i
493 493 new file mode 100644
494 494 examine changes to 'i'? [Ynesfdaq?]
495 495 i
496 496 committed changeset 3:9f40ceb5a072
497 497 $ cat i
498 498 $Id$
499 499 $ hg -q rollback
500 500 $ hg forget i
501 501 $ rm i
502 502
503 503 amend
504 504
505 505 $ echo amend >> a
506 506 $ echo amend >> b
507 507 $ hg -q commit -d '14 1' -m 'prepare amend'
508 508
509 509 $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
510 510 overwriting a expanding keywords
511 511 $ hg -q id
512 512 67d8c481a6be
513 513 $ head -1 a
514 514 expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $
515 515
516 516 $ hg -q strip -n tip
517 517
518 518 Test patch queue repo
519 519
520 520 $ hg init --mq
521 521 $ hg qimport -r tip -n mqtest.diff
522 522 $ hg commit --mq -m mqtest
523 523
524 524 Keywords should not be expanded in patch
525 525
526 526 $ cat .hg/patches/mqtest.diff
527 527 # HG changeset patch
528 528 # User User Name <user@example.com>
529 529 # Date 1 0
530 530 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
531 531 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
532 532 cndiff
533 533
534 534 diff -r ef63ca68695b -r 40a904bbbe4c c
535 535 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
536 536 +++ b/c Thu Jan 01 00:00:01 1970 +0000
537 537 @@ -0,0 +1,2 @@
538 538 +$Id$
539 539 +tests for different changenodes
540 540
541 541 $ hg qpop
542 542 popping mqtest.diff
543 543 patch queue now empty
544 544
545 545 qgoto, implying qpush, should expand
546 546
547 547 $ hg qgoto mqtest.diff
548 548 applying mqtest.diff
549 549 now at: mqtest.diff
550 550 $ cat c
551 551 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
552 552 tests for different changenodes
553 553 $ hg cat c
554 554 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
555 555 tests for different changenodes
556 556
557 557 Keywords should not be expanded in filelog
558 558
559 559 $ hg --config 'extensions.keyword=!' cat c
560 560 $Id$
561 561 tests for different changenodes
562 562
563 563 qpop and move on
564 564
565 565 $ hg qpop
566 566 popping mqtest.diff
567 567 patch queue now empty
568 568
569 569 Copy and show added kwfiles
570 570
571 571 $ hg cp a c
572 572 $ hg kwfiles
573 573 a
574 574 c
575 575
576 576 Commit and show expansion in original and copy
577 577
578 578 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
579 579 invalid branchheads cache (unserved): tip differs
580 580 c
581 581 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
582 582 overwriting c expanding keywords
583 583 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
584 584 $ cat a c
585 585 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
586 586 do not process $Id:
587 587 xxx $
588 588 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
589 589 do not process $Id:
590 590 xxx $
591 591
592 592 Touch copied c and check its status
593 593
594 594 $ touch c
595 595 $ hg status
596 596
597 597 Copy kwfile to keyword ignored file unexpanding keywords
598 598
599 599 $ hg --verbose copy a i
600 600 copying a to i
601 601 overwriting i shrinking keywords
602 602 $ head -n 1 i
603 603 expand $Id$
604 604 $ hg forget i
605 605 $ rm i
606 606
607 607 Copy ignored file to ignored file: no overwriting
608 608
609 609 $ hg --verbose copy b i
610 610 copying b to i
611 611 $ hg forget i
612 612 $ rm i
613 613
614 614 cp symlink file; hg cp -A symlink file (part1)
615 615 - copied symlink points to kwfile: overwrite
616 616
617 617 #if symlink
618 618 $ cp sym i
619 619 $ ls -l i
620 620 -rw-r--r--* (glob)
621 621 $ head -1 i
622 622 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
623 623 $ hg copy --after --verbose sym i
624 624 copying sym to i
625 625 overwriting i shrinking keywords
626 626 $ head -1 i
627 627 expand $Id$
628 628 $ hg forget i
629 629 $ rm i
630 630 #endif
631 631
632 632 Test different options of hg kwfiles
633 633
634 634 $ hg kwfiles
635 635 a
636 636 c
637 637 $ hg -v kwfiles --ignore
638 638 I b
639 639 I sym
640 640 $ hg kwfiles --all
641 641 K a
642 642 K c
643 643 I b
644 644 I sym
645 645
646 646 Diff specific revision
647 647
648 648 $ hg diff --rev 1
649 649 diff -r ef63ca68695b c
650 650 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
651 651 +++ b/c * (glob)
652 652 @@ -0,0 +1,3 @@
653 653 +expand $Id$
654 654 +do not process $Id:
655 655 +xxx $
656 656
657 657 Status after rollback:
658 658
659 659 $ hg rollback
660 660 repository tip rolled back to revision 1 (undo commit)
661 661 working directory now based on revision 1
662 662 $ hg status
663 663 A c
664 664 $ hg update --clean
665 665 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
666 666
667 667 #if symlink
668 668
669 669 cp symlink file; hg cp -A symlink file (part2)
670 670 - copied symlink points to kw ignored file: do not overwrite
671 671
672 672 $ cat a > i
673 673 $ ln -s i symignored
674 674 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
675 675 $ cp symignored x
676 676 $ hg copy --after --verbose symignored x
677 677 copying symignored to x
678 678 $ head -n 1 x
679 679 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
680 680 $ hg forget x
681 681 $ rm x
682 682
683 683 $ hg rollback
684 684 repository tip rolled back to revision 1 (undo commit)
685 685 working directory now based on revision 1
686 686 $ hg update --clean
687 687 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
688 688 $ rm i symignored
689 689
690 690 #endif
691 691
692 692 Custom keywordmaps as argument to kwdemo
693 693
694 694 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
695 695 [extensions]
696 696 keyword =
697 697 [keyword]
698 698 ** =
699 699 b = ignore
700 700 demo.txt =
701 701 i = ignore
702 702 [keywordset]
703 703 svn = False
704 704 [keywordmaps]
705 705 Xinfo = {author}: {desc}
706 706 $Xinfo: test: hg keyword configuration and expansion example $
707 707
708 708 Configure custom keywordmaps
709 709
710 710 $ cat <<EOF >>$HGRCPATH
711 711 > [keywordmaps]
712 712 > Id = {file} {node|short} {date|rfc822date} {author|user}
713 713 > Xinfo = {author}: {desc}
714 714 > EOF
715 715
716 716 Cat and hg cat files before custom expansion
717 717
718 718 $ cat a b
719 719 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
720 720 do not process $Id:
721 721 xxx $
722 722 ignore $Id$
723 723 $ hg cat sym a b && echo
724 724 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
725 725 do not process $Id:
726 726 xxx $
727 727 ignore $Id$
728 728 a
729 729
730 730 Write custom keyword and prepare multi-line commit message
731 731
732 732 $ echo '$Xinfo$' >> a
733 733 $ cat <<EOF >> log
734 734 > firstline
735 735 > secondline
736 736 > EOF
737 737
738 738 Interrupted commit should not change state
739 739
740 740 $ hg commit
741 741 abort: empty commit message
742 742 [255]
743 743 $ hg status
744 744 M a
745 745 ? c
746 746 ? log
747 747
748 748 Commit with multi-line message and custom expansion
749 749
750 750 |Note:
751 751 |
752 752 | After the last rollback, the "unserved" branchheads cache became invalid, but
753 | all changeset in the repo were public. So filtering wise:
753 | all changesets in the repo were public. For filtering this means:
754 754 | "mutable" == "unserved" == ΓΈ.
755 755 |
756 | As the "unserved" cache is invalid, we fall back to "mutable" cache. But not
757 | update is needed between "mutable" and "unserved" cache and the "unserved"
758 | cache is not updated on disk. The on disk version therefor stay invalid for
759 | some time. This explains why the "unserved" branchheads cache is detect
756 | As the "unserved" cache is invalid, we fall back to the "mutable" cache. But
757 | no update is needed between "mutable" and "unserved" and the "unserved" cache
758 | is not updated on disk. The on-disk version therefore stays invalid for some
759 | time. This explains why the "unserved" branchheads cache is detected as
760 760 | invalid here.
761 761
762 762 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
763 763 invalid branchheads cache (unserved): tip differs
764 764 a
765 765 invalid branchheads cache: tip differs
766 766 invalid branchheads cache (unserved): tip differs
767 767 overwriting a expanding keywords
768 768 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
769 769 $ rm log
770 770
771 771 Stat, verify and show custom expansion (firstline)
772 772
773 773 $ hg status
774 774 ? c
775 775 $ hg verify
776 776 checking changesets
777 777 checking manifests
778 778 crosschecking files in changesets and manifests
779 779 checking files
780 780 3 files, 3 changesets, 4 total revisions
781 781 $ cat a b
782 782 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
783 783 do not process $Id:
784 784 xxx $
785 785 $Xinfo: User Name <user@example.com>: firstline $
786 786 ignore $Id$
787 787 $ hg cat sym a b && echo
788 788 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
789 789 do not process $Id:
790 790 xxx $
791 791 $Xinfo: User Name <user@example.com>: firstline $
792 792 ignore $Id$
793 793 a
794 794
795 795 annotate
796 796
797 797 $ hg annotate a
798 798 1: expand $Id$
799 799 1: do not process $Id:
800 800 1: xxx $
801 801 2: $Xinfo$
802 802
803 803 remove with status checks
804 804
805 805 $ hg debugrebuildstate
806 806 $ hg remove a
807 807 $ hg --debug commit -m rma
808 808 invalid branchheads cache: tip differs
809 809 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
810 810 $ hg status
811 811 ? c
812 812
813 813 Rollback, revert, and check expansion
814 814
815 815 $ hg rollback
816 816 repository tip rolled back to revision 2 (undo commit)
817 817 working directory now based on revision 2
818 818 $ hg status
819 819 R a
820 820 ? c
821 821 $ hg revert --no-backup --rev tip a
822 822 $ cat a
823 823 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
824 824 do not process $Id:
825 825 xxx $
826 826 $Xinfo: User Name <user@example.com>: firstline $
827 827
828 828 Clone to test global and local configurations
829 829
830 830 $ cd ..
831 831
832 832 Expansion in destination with global configuration
833 833
834 834 $ hg --quiet clone Test globalconf
835 835 $ cat globalconf/a
836 836 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
837 837 do not process $Id:
838 838 xxx $
839 839 $Xinfo: User Name <user@example.com>: firstline $
840 840
841 841 No expansion in destination with local configuration in origin only
842 842
843 843 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
844 844 $ cat localconf/a
845 845 expand $Id$
846 846 do not process $Id:
847 847 xxx $
848 848 $Xinfo$
849 849
850 850 Clone to test incoming
851 851
852 852 $ hg clone -r1 Test Test-a
853 853 adding changesets
854 854 adding manifests
855 855 adding file changes
856 856 added 2 changesets with 3 changes to 3 files
857 857 updating to branch default
858 858 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
859 859 $ cd Test-a
860 860 $ cat <<EOF >> .hg/hgrc
861 861 > [paths]
862 862 > default = ../Test
863 863 > EOF
864 864 $ hg incoming
865 865 comparing with $TESTTMP/Test (glob)
866 866 searching for changes
867 867 changeset: 2:bb948857c743
868 868 tag: tip
869 869 user: User Name <user@example.com>
870 870 date: Thu Jan 01 00:00:02 1970 +0000
871 871 summary: firstline
872 872
873 873 Imported patch should not be rejected
874 874
875 875 >>> import re
876 876 >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
877 877 >>> open('a', 'wb').write(text)
878 878 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
879 879 a
880 880 overwriting a expanding keywords
881 881 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
882 882 $ hg export -o ../rejecttest.diff tip
883 883 $ cd ../Test
884 884 $ hg import ../rejecttest.diff
885 885 applying ../rejecttest.diff
886 886 $ cat a b
887 887 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
888 888 do not process $Id: rejecttest
889 889 xxx $
890 890 $Xinfo: User Name <user@example.com>: rejects? $
891 891 ignore $Id$
892 892
893 893 $ hg rollback
894 894 repository tip rolled back to revision 2 (undo import)
895 895 working directory now based on revision 2
896 896 $ hg update --clean
897 897 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
898 898
899 899 kwexpand/kwshrink on selected files
900 900
901 901 $ mkdir x
902 902 $ hg copy a x/a
903 903 $ hg --verbose kwshrink a
904 904 overwriting a shrinking keywords
905 905 - sleep required for dirstate.normal() check
906 906 $ sleep 1
907 907 $ hg status a
908 908 $ hg --verbose kwexpand a
909 909 overwriting a expanding keywords
910 910 $ hg status a
911 911
912 912 kwexpand x/a should abort
913 913
914 914 $ hg --verbose kwexpand x/a
915 915 abort: outstanding uncommitted changes
916 916 [255]
917 917 $ cd x
918 918 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
919 919 x/a
920 920 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
921 921 invalid branchheads cache: tip differs
922 922 overwriting x/a expanding keywords
923 923 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
924 924 $ cat a
925 925 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
926 926 do not process $Id:
927 927 xxx $
928 928 $Xinfo: User Name <user@example.com>: xa $
929 929
930 930 kwshrink a inside directory x
931 931
932 932 $ hg --verbose kwshrink a
933 933 overwriting x/a shrinking keywords
934 934 $ cat a
935 935 expand $Id$
936 936 do not process $Id:
937 937 xxx $
938 938 $Xinfo$
939 939 $ cd ..
940 940
941 941 kwexpand nonexistent
942 942
943 943 $ hg kwexpand nonexistent
944 944 nonexistent:* (glob)
945 945
946 946
947 947 #if serve
948 948 hg serve
949 949 - expand with hgweb file
950 950 - no expansion with hgweb annotate/changeset/filediff
951 951 - check errors
952 952
953 953 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
954 954 $ cat hg.pid >> $DAEMON_PIDS
955 955 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/a/?style=raw'
956 956 200 Script output follows
957 957
958 958 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
959 959 do not process $Id:
960 960 xxx $
961 961 $Xinfo: User Name <user@example.com>: firstline $
962 962 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/a/?style=raw'
963 963 200 Script output follows
964 964
965 965
966 966 user@1: expand $Id$
967 967 user@1: do not process $Id:
968 968 user@1: xxx $
969 969 user@2: $Xinfo$
970 970
971 971
972 972
973 973
974 974 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'rev/tip/?style=raw'
975 975 200 Script output follows
976 976
977 977
978 978 # HG changeset patch
979 979 # User User Name <user@example.com>
980 980 # Date 3 0
981 981 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
982 982 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
983 983 xa
984 984
985 985 diff -r bb948857c743 -r b4560182a3f9 x/a
986 986 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
987 987 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
988 988 @@ -0,0 +1,4 @@
989 989 +expand $Id$
990 990 +do not process $Id:
991 991 +xxx $
992 992 +$Xinfo$
993 993
994 994 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'diff/bb948857c743/a?style=raw'
995 995 200 Script output follows
996 996
997 997
998 998 diff -r ef63ca68695b -r bb948857c743 a
999 999 --- a/a Thu Jan 01 00:00:00 1970 +0000
1000 1000 +++ b/a Thu Jan 01 00:00:02 1970 +0000
1001 1001 @@ -1,3 +1,4 @@
1002 1002 expand $Id$
1003 1003 do not process $Id:
1004 1004 xxx $
1005 1005 +$Xinfo$
1006 1006
1007 1007
1008 1008
1009 1009
1010 1010 $ cat errors.log
1011 1011 #endif
1012 1012
1013 1013 Prepare merge and resolve tests
1014 1014
1015 1015 $ echo '$Id$' > m
1016 1016 $ hg add m
1017 1017 $ hg commit -m 4kw
1018 1018 $ echo foo >> m
1019 1019 $ hg commit -m 5foo
1020 1020
1021 1021 simplemerge
1022 1022
1023 1023 $ hg update 4
1024 1024 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1025 1025 $ echo foo >> m
1026 1026 $ hg commit -m 6foo
1027 1027 created new head
1028 1028 $ hg merge
1029 1029 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1030 1030 (branch merge, don't forget to commit)
1031 1031 $ hg commit -m simplemerge
1032 1032 $ cat m
1033 1033 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
1034 1034 foo
1035 1035
1036 1036 conflict: keyword should stay outside conflict zone
1037 1037
1038 1038 $ hg update 4
1039 1039 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1040 1040 $ echo bar >> m
1041 1041 $ hg commit -m 8bar
1042 1042 created new head
1043 1043 $ hg merge
1044 1044 merging m
1045 1045 warning: conflicts during merge.
1046 1046 merging m incomplete! (edit conflicts, then use 'hg resolve --mark')
1047 1047 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1048 1048 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1049 1049 [1]
1050 1050 $ cat m
1051 1051 $Id$
1052 1052 <<<<<<< local
1053 1053 bar
1054 1054 =======
1055 1055 foo
1056 1056 >>>>>>> other
1057 1057
1058 1058 resolve to local
1059 1059
1060 1060 $ HGMERGE=internal:local hg resolve -a
1061 1061 $ hg commit -m localresolve
1062 1062 $ cat m
1063 1063 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1064 1064 bar
1065 1065
1066 1066 Test restricted mode with transplant -b
1067 1067
1068 1068 $ hg update 6
1069 1069 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1070 1070 $ hg branch foo
1071 1071 marked working directory as branch foo
1072 1072 (branches are permanent and global, did you want a bookmark?)
1073 1073 $ mv a a.bak
1074 1074 $ echo foobranch > a
1075 1075 $ cat a.bak >> a
1076 1076 $ rm a.bak
1077 1077 $ hg commit -m 9foobranch
1078 1078 $ hg update default
1079 1079 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1080 1080 $ hg -y transplant -b foo tip
1081 1081 applying 4aa30d025d50
1082 1082 4aa30d025d50 transplanted to e00abbf63521
1083 1083
1084 1084 Expansion in changeset but not in file
1085 1085
1086 1086 $ hg tip -p
1087 1087 changeset: 11:e00abbf63521
1088 1088 tag: tip
1089 1089 parent: 9:800511b3a22d
1090 1090 user: test
1091 1091 date: Thu Jan 01 00:00:00 1970 +0000
1092 1092 summary: 9foobranch
1093 1093
1094 1094 diff -r 800511b3a22d -r e00abbf63521 a
1095 1095 --- a/a Thu Jan 01 00:00:00 1970 +0000
1096 1096 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1097 1097 @@ -1,3 +1,4 @@
1098 1098 +foobranch
1099 1099 expand $Id$
1100 1100 do not process $Id:
1101 1101 xxx $
1102 1102
1103 1103 $ head -n 2 a
1104 1104 foobranch
1105 1105 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1106 1106
1107 1107 Turn off expansion
1108 1108
1109 1109 $ hg -q rollback
1110 1110 $ hg -q update -C
1111 1111
1112 1112 kwshrink with unknown file u
1113 1113
1114 1114 $ cp a u
1115 1115 $ hg --verbose kwshrink
1116 1116 overwriting a shrinking keywords
1117 1117 overwriting m shrinking keywords
1118 1118 overwriting x/a shrinking keywords
1119 1119
1120 1120 Keywords shrunk in working directory, but not yet disabled
1121 1121 - cat shows unexpanded keywords
1122 1122 - hg cat shows expanded keywords
1123 1123
1124 1124 $ cat a b
1125 1125 expand $Id$
1126 1126 do not process $Id:
1127 1127 xxx $
1128 1128 $Xinfo$
1129 1129 ignore $Id$
1130 1130 $ hg cat sym a b && echo
1131 1131 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1132 1132 do not process $Id:
1133 1133 xxx $
1134 1134 $Xinfo: User Name <user@example.com>: firstline $
1135 1135 ignore $Id$
1136 1136 a
1137 1137
1138 1138 Now disable keyword expansion
1139 1139
1140 1140 $ rm "$HGRCPATH"
1141 1141 $ cat a b
1142 1142 expand $Id$
1143 1143 do not process $Id:
1144 1144 xxx $
1145 1145 $Xinfo$
1146 1146 ignore $Id$
1147 1147 $ hg cat sym a b && echo
1148 1148 expand $Id$
1149 1149 do not process $Id:
1150 1150 xxx $
1151 1151 $Xinfo$
1152 1152 ignore $Id$
1153 1153 a
1154 1154
1155 1155 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now