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