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