tests/test-keyword.out
changeset 782 09bae16e7a6d
parent 781 c7a471b49819
child 783 8a23ff764a02
child 785 77154fe0e3a5
equal deleted inserted replaced
781:c7a471b49819 782:09bae16e7a6d
     1 % hg kwdemo
       
     2 [extensions]
       
     3 keyword =
       
     4 [keyword]
       
     5 demo.txt = 
       
     6 [keywordmaps]
       
     7 Author = {author|user}
       
     8 Date = {date|utcdate}
       
     9 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
       
    10 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
       
    11 RCSFile = {file|basename},v
       
    12 RCSfile = {file|basename},v
       
    13 Revision = {node|short}
       
    14 Source = {root}/{file},v
       
    15 $Author: test $
       
    16 $Date: 2000/00/00 00:00:00 $
       
    17 $Header: /TMP/demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $
       
    18 $Id: demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $
       
    19 $RCSFile: demo.txt,v $
       
    20 $RCSfile: demo.txt,v $
       
    21 $Revision: xxxxxxxxxxxx $
       
    22 $Source: /TMP/demo.txt,v $
       
    23 [extensions]
       
    24 keyword =
       
    25 [keyword]
       
    26 demo.txt = 
       
    27 [keywordmaps]
       
    28 Branch = {branches}
       
    29 $Branch: demobranch $
       
    30 % kwshrink should exit silently in empty/invalid repo
       
    31 pulling from test-keyword.hg
       
    32 requesting all changes
       
    33 adding changesets
       
    34 adding manifests
       
    35 adding file changes
       
    36 added 1 changesets with 1 changes to 1 files
       
    37 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    38 % cat
       
    39 expand $Id$
       
    40 do not process $Id:
       
    41 xxx $
       
    42 ignore $Id$
       
    43 % no kwfiles
       
    44 % untracked candidates
       
    45 k a
       
    46 % addremove
       
    47 adding a
       
    48 adding b
       
    49 % status
       
    50 A a
       
    51 A b
       
    52 % default keyword expansion including commit hook
       
    53 % interrupted commit should not change state or run commit hook
       
    54 abort: empty commit message
       
    55 % status
       
    56 A a
       
    57 A b
       
    58 % commit
       
    59 a
       
    60 b
       
    61 overwriting a expanding keywords
       
    62 running hook commit.test: cp a hooktest
       
    63 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
       
    64 % status
       
    65 ? hooktest
       
    66 % identify
       
    67 ef63ca68695b
       
    68 % cat
       
    69 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
       
    70 do not process $Id:
       
    71 xxx $
       
    72 ignore $Id$
       
    73 % hg cat
       
    74 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
       
    75 do not process $Id:
       
    76 xxx $
       
    77 ignore $Id$
       
    78 a
       
    79 % diff a hooktest
       
    80 % removing commit hook from config
       
    81 % bundle
       
    82 2 changesets found
       
    83 % notify on pull to check whether keywords stay as is in email
       
    84 % ie. if patch.diff wrapper acts as it should
       
    85 % pull from bundle
       
    86 pulling from ../kw.hg
       
    87 requesting all changes
       
    88 adding changesets
       
    89 adding manifests
       
    90 adding file changes
       
    91 added 2 changesets with 3 changes to 3 files
       
    92 
       
    93 diff -r 000000000000 -r a2392c293916 sym
       
    94 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
    95 +++ b/sym	Sat Feb 09 20:25:47 2008 +0100
       
    96 @@ -0,0 +1,1 @@
       
    97 +a
       
    98 \ No newline at end of file
       
    99 
       
   100 diff -r a2392c293916 -r ef63ca68695b a
       
   101 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
   102 +++ b/a	Thu Jan 01 00:00:00 1970 +0000
       
   103 @@ -0,0 +1,3 @@
       
   104 +expand $Id$
       
   105 +do not process $Id:
       
   106 +xxx $
       
   107 diff -r a2392c293916 -r ef63ca68695b b
       
   108 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
   109 +++ b/b	Thu Jan 01 00:00:00 1970 +0000
       
   110 @@ -0,0 +1,1 @@
       
   111 +ignore $Id$
       
   112 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   113 % remove notify config
       
   114 % touch
       
   115 % status
       
   116 % update
       
   117 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   118 % cat
       
   119 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
       
   120 do not process $Id:
       
   121 xxx $
       
   122 ignore $Id$
       
   123 % check whether expansion is filewise
       
   124 % commit c
       
   125 adding c
       
   126 % force expansion
       
   127 overwriting a expanding keywords
       
   128 overwriting c expanding keywords
       
   129 % compare changenodes in a c
       
   130 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
       
   131 do not process $Id:
       
   132 xxx $
       
   133 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
       
   134 tests for different changenodes
       
   135 % record chunk
       
   136 diff --git a/a b/a
       
   137 2 hunks, 2 lines changed
       
   138 examine changes to 'a'? [Ynsfdaq?] 
       
   139 @@ -1,3 +1,4 @@
       
   140  expand $Id$
       
   141 +foo
       
   142  do not process $Id:
       
   143  xxx $
       
   144 record change 1/2 to 'a'? [Ynsfdaq?] 
       
   145 @@ -2,2 +3,3 @@
       
   146  do not process $Id:
       
   147  xxx $
       
   148 +bar
       
   149 record change 2/2 to 'a'? [Ynsfdaq?] 
       
   150 
       
   151 d17e03c92c97+ tip
       
   152 M a
       
   153 % cat modified file
       
   154 expand $Id: a,v d17e03c92c97 1970/01/01 00:00:01 test $
       
   155 foo
       
   156 do not process $Id:
       
   157 xxx $
       
   158 bar
       
   159 diff -r d17e03c92c97 a
       
   160 --- a/a	Wed Dec 31 23:59:51 1969 -0000
       
   161 @@ -2,3 +2,4 @@
       
   162  foo
       
   163  do not process $Id:
       
   164  xxx $
       
   165 +bar
       
   166 rolling back to revision 2 (undo commit)
       
   167 % record file
       
   168 diff --git a/a b/a
       
   169 2 hunks, 2 lines changed
       
   170 examine changes to 'a'? [Ynsfdaq?] 
       
   171 @@ -1,3 +1,4 @@
       
   172  expand $Id$
       
   173 +foo
       
   174  do not process $Id:
       
   175  xxx $
       
   176 record change 1/2 to 'a'? [Ynsfdaq?] 
       
   177 @@ -2,2 +3,3 @@
       
   178  do not process $Id:
       
   179  xxx $
       
   180 +bar
       
   181 record change 2/2 to 'a'? [Ynsfdaq?] 
       
   182 % a should be clean
       
   183 C a
       
   184 rolling back to revision 2 (undo commit)
       
   185 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   186 % init --mq
       
   187 % qimport
       
   188 % commit --mq
       
   189 % keywords should not be expanded in patch
       
   190 # HG changeset patch
       
   191 # User User Name <user@example.com>
       
   192 # Date 1 0
       
   193 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
       
   194 # Parent  ef63ca68695bc9495032c6fda1350c71e6d256e9
       
   195 cndiff
       
   196 
       
   197 diff -r ef63ca68695b -r 40a904bbbe4c c
       
   198 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
   199 +++ b/c	Thu Jan 01 00:00:01 1970 +0000
       
   200 @@ -0,0 +1,2 @@
       
   201 +$Id$
       
   202 +tests for different changenodes
       
   203 % qpop
       
   204 popping mqtest.diff
       
   205 patch queue now empty
       
   206 % qgoto - should imply qpush
       
   207 applying mqtest.diff
       
   208 now at: mqtest.diff
       
   209 % cat
       
   210 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
       
   211 tests for different changenodes
       
   212 % hg cat
       
   213 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
       
   214 tests for different changenodes
       
   215 % keyword should not be expanded in filelog
       
   216 $Id$
       
   217 tests for different changenodes
       
   218 % qpop and move on
       
   219 popping mqtest.diff
       
   220 patch queue now empty
       
   221 % copy
       
   222 % kwfiles added
       
   223 a
       
   224 c
       
   225 % commit
       
   226 c
       
   227  c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
       
   228 overwriting c expanding keywords
       
   229 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
       
   230 % cat a c
       
   231 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
       
   232 do not process $Id:
       
   233 xxx $
       
   234 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
       
   235 do not process $Id:
       
   236 xxx $
       
   237 % touch copied c
       
   238 % status
       
   239 % kwfiles
       
   240 a
       
   241 c
       
   242 % ignored files
       
   243 I b
       
   244 I sym
       
   245 % all files
       
   246 K a
       
   247 K c
       
   248 I b
       
   249 I sym
       
   250 % diff --rev
       
   251 diff -r ef63ca68695b c
       
   252 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
   253 @@ -0,0 +1,3 @@
       
   254 +expand $Id$
       
   255 +do not process $Id:
       
   256 +xxx $
       
   257 % rollback
       
   258 rolling back to revision 1 (undo commit)
       
   259 % status
       
   260 A c
       
   261 % update -C
       
   262 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   263 % custom keyword expansion
       
   264 % try with kwdemo
       
   265 [extensions]
       
   266 keyword =
       
   267 [keyword]
       
   268 ** = 
       
   269 b = ignore
       
   270 demo.txt = 
       
   271 [keywordmaps]
       
   272 Xinfo = {author}: {desc}
       
   273 $Xinfo: test: hg keyword configuration and expansion example $
       
   274 % cat
       
   275 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
       
   276 do not process $Id:
       
   277 xxx $
       
   278 ignore $Id$
       
   279 % hg cat
       
   280 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
       
   281 do not process $Id:
       
   282 xxx $
       
   283 ignore $Id$
       
   284 a
       
   285 % interrupted commit should not change state
       
   286 abort: empty commit message
       
   287 % status
       
   288 M a
       
   289 ? c
       
   290 ? log
       
   291 % commit
       
   292 a
       
   293 overwriting a expanding keywords
       
   294 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
       
   295 % status
       
   296 ? c
       
   297 % verify
       
   298 checking changesets
       
   299 checking manifests
       
   300 crosschecking files in changesets and manifests
       
   301 checking files
       
   302 3 files, 3 changesets, 4 total revisions
       
   303 % cat
       
   304 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
       
   305 do not process $Id:
       
   306 xxx $
       
   307 $Xinfo: User Name <user@example.com>: firstline $
       
   308 ignore $Id$
       
   309 % hg cat
       
   310 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
       
   311 do not process $Id:
       
   312 xxx $
       
   313 $Xinfo: User Name <user@example.com>: firstline $
       
   314 ignore $Id$
       
   315 a
       
   316 % annotate
       
   317 1: expand $Id$
       
   318 1: do not process $Id:
       
   319 1: xxx $
       
   320 2: $Xinfo$
       
   321 % remove
       
   322 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
       
   323 % status
       
   324 ? c
       
   325 % rollback
       
   326 rolling back to revision 2 (undo commit)
       
   327 % status
       
   328 R a
       
   329 ? c
       
   330 % revert a
       
   331 % cat a
       
   332 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
       
   333 do not process $Id:
       
   334 xxx $
       
   335 $Xinfo: User Name <user@example.com>: firstline $
       
   336 % clone
       
   337 % expansion in dest
       
   338 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
       
   339 do not process $Id:
       
   340 xxx $
       
   341 $Xinfo: User Name <user@example.com>: firstline $
       
   342 % no expansion in dest
       
   343 expand $Id$
       
   344 do not process $Id:
       
   345 xxx $
       
   346 $Xinfo$
       
   347 % clone to test incoming
       
   348 requesting all changes
       
   349 adding changesets
       
   350 adding manifests
       
   351 adding file changes
       
   352 added 2 changesets with 3 changes to 3 files
       
   353 updating to branch default
       
   354 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   355 % incoming
       
   356 comparing with test-keyword/Test
       
   357 searching for changes
       
   358 changeset:   2:bb948857c743
       
   359 tag:         tip
       
   360 user:        User Name <user@example.com>
       
   361 date:        Thu Jan 01 00:00:02 1970 +0000
       
   362 summary:     firstline
       
   363 
       
   364 % commit rejecttest
       
   365 a
       
   366 overwriting a expanding keywords
       
   367 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
       
   368 % export
       
   369 % import
       
   370 applying ../rejecttest.diff
       
   371 % cat
       
   372 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
       
   373 do not process $Id: rejecttest
       
   374 xxx $
       
   375 $Xinfo: User Name <user@example.com>: rejects? $
       
   376 ignore $Id$
       
   377 
       
   378 % rollback
       
   379 rolling back to revision 2 (undo commit)
       
   380 % clean update
       
   381 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   382 % kwexpand/kwshrink on selected files
       
   383 % copy a x/a
       
   384 % kwexpand a
       
   385 overwriting a expanding keywords
       
   386 % kwexpand x/a should abort
       
   387 abort: outstanding uncommitted changes
       
   388 x/a
       
   389  x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
       
   390 overwriting x/a expanding keywords
       
   391 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
       
   392 % cat a
       
   393 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
       
   394 do not process $Id:
       
   395 xxx $
       
   396 $Xinfo: User Name <user@example.com>: xa $
       
   397 % kwshrink a inside directory x
       
   398 overwriting x/a shrinking keywords
       
   399 % cat a
       
   400 expand $Id$
       
   401 do not process $Id:
       
   402 xxx $
       
   403 $Xinfo$
       
   404 % kwexpand nonexistent
       
   405 nonexistent:
       
   406 % hg serve
       
   407 % expansion
       
   408 % hgweb file
       
   409 200 Script output follows
       
   410 
       
   411 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
       
   412 do not process $Id:
       
   413 xxx $
       
   414 $Xinfo: User Name <user@example.com>: firstline $
       
   415 % no expansion
       
   416 % hgweb annotate
       
   417 200 Script output follows
       
   418 
       
   419 
       
   420 user@1: expand $Id$
       
   421 user@1: do not process $Id:
       
   422 user@1: xxx $
       
   423 user@2: $Xinfo$
       
   424 
       
   425 
       
   426 
       
   427 
       
   428 % hgweb changeset
       
   429 200 Script output follows
       
   430 
       
   431 
       
   432 # HG changeset patch
       
   433 # User User Name <user@example.com>
       
   434 # Date 3 0
       
   435 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
       
   436 # Parent  bb948857c743469b22bbf51f7ec8112279ca5d83
       
   437 xa
       
   438 
       
   439 diff -r bb948857c743 -r b4560182a3f9 x/a
       
   440 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
   441 +++ b/x/a	Thu Jan 01 00:00:03 1970 +0000
       
   442 @@ -0,0 +1,4 @@
       
   443 +expand $Id$
       
   444 +do not process $Id:
       
   445 +xxx $
       
   446 +$Xinfo$
       
   447 
       
   448 % hgweb filediff
       
   449 200 Script output follows
       
   450 
       
   451 
       
   452 diff -r ef63ca68695b -r bb948857c743 a
       
   453 --- a/a	Thu Jan 01 00:00:00 1970 +0000
       
   454 +++ b/a	Thu Jan 01 00:00:02 1970 +0000
       
   455 @@ -1,3 +1,4 @@
       
   456  expand $Id$
       
   457  do not process $Id:
       
   458  xxx $
       
   459 +$Xinfo$
       
   460 
       
   461 
       
   462 
       
   463 
       
   464 % errors encountered
       
   465 % merge/resolve
       
   466 % simplemerge
       
   467 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   468 created new head
       
   469 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   470 (branch merge, don't forget to commit)
       
   471 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
       
   472 foo
       
   473 % conflict
       
   474 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   475 created new head
       
   476 merging m
       
   477 warning: conflicts during merge.
       
   478 merging m failed!
       
   479 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
       
   480 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
       
   481 % keyword stays outside conflict zone
       
   482 $Id$
       
   483 <<<<<<< local
       
   484 bar
       
   485 =======
       
   486 foo
       
   487 >>>>>>> other
       
   488 % resolve to local
       
   489 $Id: m 41efa6d38e9b Thu, 01 Jan 1970 00:00:00 +0000 test $
       
   490 bar
       
   491 % test restricted mode with transplant -b
       
   492 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   493 marked working directory as branch foo
       
   494 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   495 applying 4aa30d025d50
       
   496 4aa30d025d50 transplanted to 5a4da427c162
       
   497 % no expansion in changeset
       
   498 changeset:   11:5a4da427c162
       
   499 tag:         tip
       
   500 parent:      9:41efa6d38e9b
       
   501 user:        test
       
   502 date:        Thu Jan 01 00:00:00 1970 +0000
       
   503 summary:     9foobranch
       
   504 
       
   505 diff -r 41efa6d38e9b -r 5a4da427c162 a
       
   506 --- a/a	Thu Jan 01 00:00:00 1970 +0000
       
   507 +++ b/a	Thu Jan 01 00:00:00 1970 +0000
       
   508 @@ -1,3 +1,4 @@
       
   509 +foobranch
       
   510  expand $Id$
       
   511  do not process $Id:
       
   512  xxx $
       
   513 
       
   514 % expansion in file
       
   515 foobranch
       
   516 expand $Id: a 5a4da427c162 Thu, 01 Jan 1970 00:00:00 +0000 test $
       
   517 % switch off expansion
       
   518 % kwshrink with unknown file u
       
   519 overwriting a shrinking keywords
       
   520 overwriting m shrinking keywords
       
   521 overwriting x/a shrinking keywords
       
   522 % cat
       
   523 expand $Id$
       
   524 do not process $Id:
       
   525 xxx $
       
   526 $Xinfo$
       
   527 ignore $Id$
       
   528 % hg cat
       
   529 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
       
   530 do not process $Id:
       
   531 xxx $
       
   532 $Xinfo: User Name <user@example.com>: firstline $
       
   533 ignore $Id$
       
   534 a
       
   535 % cat
       
   536 expand $Id$
       
   537 do not process $Id:
       
   538 xxx $
       
   539 $Xinfo$
       
   540 ignore $Id$
       
   541 % hg cat
       
   542 expand $Id$
       
   543 do not process $Id:
       
   544 xxx $
       
   545 $Xinfo$
       
   546 ignore $Id$
       
   547 a