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