tests/test-keyword.t
changeset 1118 9eb32646a6b8
parent 1117 8d5052f23e99
child 1119 5f7f30917a18
equal deleted inserted replaced
1114:22b300b7a7c1 1118:9eb32646a6b8
     1   $ "$TESTDIR/hghave" unix-permissions serve || exit 80
       
     2 
       
     3   $ cat <<EOF >> $HGRCPATH
     1   $ cat <<EOF >> $HGRCPATH
     4   > [extensions]
     2   > [extensions]
     5   > keyword =
     3   > keyword =
     6   > mq =
     4   > mq =
     7   > notify =
     5   > notify =
   295 
   293 
   296 Check whether expansion is filewise and file mode is preserved
   294 Check whether expansion is filewise and file mode is preserved
   297 
   295 
   298   $ echo '$Id$' > c
   296   $ echo '$Id$' > c
   299   $ echo 'tests for different changenodes' >> c
   297   $ echo 'tests for different changenodes' >> c
       
   298 #if unix-permissions
   300   $ chmod 600 c
   299   $ chmod 600 c
   301   $ ls -l c | cut -b 1-10
   300   $ ls -l c | cut -b 1-10
   302   -rw-------
   301   -rw-------
       
   302 #endif
   303 
   303 
   304 commit file c
   304 commit file c
   305 
   305 
   306   $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
   306   $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
   307   adding c
   307   adding c
       
   308 #if unix-permissions
   308   $ ls -l c | cut -b 1-10
   309   $ ls -l c | cut -b 1-10
   309   -rw-------
   310   -rw-------
       
   311 #endif
   310 
   312 
   311 force expansion
   313 force expansion
   312 
   314 
   313   $ hg -v kwexpand
   315   $ hg -v kwexpand
   314   overwriting a expanding keywords
   316   overwriting a expanding keywords
   328   $ echo '$Id$' > r
   330   $ echo '$Id$' > r
   329   $ hg add r
   331   $ hg add r
   330 
   332 
   331 record chunk
   333 record chunk
   332 
   334 
   333   >>> lines = open('a').readlines()
   335   >>> lines = open('a', 'rb').readlines()
   334   >>> lines.insert(1, 'foo\n')
   336   >>> lines.insert(1, 'foo\n')
   335   >>> lines.append('bar\n')
   337   >>> lines.append('bar\n')
   336   >>> open('a', 'w').writelines(lines)
   338   >>> open('a', 'wb').writelines(lines)
   337   $ hg record -d '1 10' -m rectest a<<EOF
   339   $ hg record -d '10 1' -m rectest a<<EOF
   338   > y
   340   > y
   339   > y
   341   > y
   340   > n
   342   > n
   341   > EOF
   343   > EOF
   342   diff --git a/a b/a
   344   diff --git a/a b/a
   353    xxx $
   355    xxx $
   354   +bar
   356   +bar
   355   record change 2/2 to 'a'? [Ynesfdaq?] 
   357   record change 2/2 to 'a'? [Ynesfdaq?] 
   356 
   358 
   357   $ hg identify
   359   $ hg identify
   358   d17e03c92c97+ tip
   360   5f5eb23505c3+ tip
   359   $ hg status
   361   $ hg status
   360   M a
   362   M a
   361   A r
   363   A r
   362 
   364 
   363 Cat modified file a
   365 Cat modified file a
   364 
   366 
   365   $ cat a
   367   $ cat a
   366   expand $Id: a,v d17e03c92c97 1970/01/01 00:00:01 test $
   368   expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
   367   foo
   369   foo
   368   do not process $Id:
   370   do not process $Id:
   369   xxx $
   371   xxx $
   370   bar
   372   bar
   371 
   373 
   372 Diff remaining chunk
   374 Diff remaining chunk
   373 
   375 
   374   $ hg diff a
   376   $ hg diff a
   375   diff -r d17e03c92c97 a
   377   diff -r 5f5eb23505c3 a
   376   --- a/a	Wed Dec 31 23:59:51 1969 -0000
   378   --- a/a	Thu Jan 01 00:00:09 1970 -0000
   377   +++ b/a	* (glob)
   379   +++ b/a	* (glob)
   378   @@ -2,3 +2,4 @@
   380   @@ -2,3 +2,4 @@
   379    foo
   381    foo
   380    do not process $Id:
   382    do not process $Id:
   381    xxx $
   383    xxx $
   389 
   391 
   390   $ echo foo > msg
   392   $ echo foo > msg
   391 
   393 
   392  - do not use "hg record -m" here!
   394  - do not use "hg record -m" here!
   393 
   395 
   394   $ hg record -l msg -d '1 11' a<<EOF
   396   $ hg record -l msg -d '11 1' a<<EOF
   395   > y
   397   > y
   396   > y
   398   > y
   397   > y
   399   > y
   398   > EOF
   400   > EOF
   399   diff --git a/a b/a
   401   diff --git a/a b/a
   417   C a
   419   C a
   418 
   420 
   419 rollback and revert expansion
   421 rollback and revert expansion
   420 
   422 
   421   $ cat a
   423   $ cat a
   422   expand $Id: a,v 59f969a3b52c 1970/01/01 00:00:01 test $
   424   expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
   423   foo
   425   foo
   424   do not process $Id:
   426   do not process $Id:
   425   xxx $
   427   xxx $
   426   bar
   428   bar
   427   $ hg --verbose rollback
   429   $ hg --verbose rollback
   458   $ hg forget y z
   460   $ hg forget y z
   459   $ rm y z
   461   $ rm y z
   460 
   462 
   461 record added file alone
   463 record added file alone
   462 
   464 
   463   $ hg -v record -l msg -d '1 12' r<<EOF
   465   $ hg -v record -l msg -d '12 2' r<<EOF
   464   > y
   466   > y
   465   > EOF
   467   > EOF
   466   diff --git a/r b/r
   468   diff --git a/r b/r
   467   new file mode 100644
   469   new file mode 100644
   468   examine changes to 'r'? [Ynesfdaq?] 
   470   examine changes to 'r'? [Ynesfdaq?] 
   469   r
   471   r
   470   committed changeset 3:899491280810
   472   committed changeset 3:82a2f715724d
   471   overwriting r expanding keywords
   473   overwriting r expanding keywords
   472  - status call required for dirstate.normallookup() check
   474  - status call required for dirstate.normallookup() check
   473   $ hg status r
   475   $ hg status r
   474   $ hg --verbose rollback
   476   $ hg --verbose rollback
   475   repository tip rolled back to revision 2 (undo commit)
   477   repository tip rolled back to revision 2 (undo commit)
   482 
   484 
   483 record added keyword ignored file
   485 record added keyword ignored file
   484 
   486 
   485   $ echo '$Id$' > i
   487   $ echo '$Id$' > i
   486   $ hg add i
   488   $ hg add i
   487   $ hg --verbose record -d '1 13' -m recignored<<EOF
   489   $ hg --verbose record -d '13 1' -m recignored<<EOF
   488   > y
   490   > y
   489   > EOF
   491   > EOF
   490   diff --git a/i b/i
   492   diff --git a/i b/i
   491   new file mode 100644
   493   new file mode 100644
   492   examine changes to 'i'? [Ynesfdaq?] 
   494   examine changes to 'i'? [Ynesfdaq?] 
   493   i
   495   i
   494   committed changeset 3:5f40fe93bbdc
   496   committed changeset 3:9f40ceb5a072
   495   $ cat i
   497   $ cat i
   496   $Id$
   498   $Id$
   497   $ hg -q rollback
   499   $ hg -q rollback
   498   $ hg forget i
   500   $ hg forget i
   499   $ rm i
   501   $ rm i
   500 
   502 
   501 amend
   503 amend
   502 
   504 
   503   $ echo amend >> a
   505   $ echo amend >> a
   504   $ echo amend >> b
   506   $ echo amend >> b
   505   $ hg -q commit -d '1 14' -m 'prepare amend'
   507   $ hg -q commit -d '14 1' -m 'prepare amend'
   506 
   508 
   507   $ hg --debug commit --amend -d '1 15' -m 'amend without changes' | grep keywords
   509   $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
   508   overwriting a expanding keywords
   510   overwriting a expanding keywords
   509   $ hg -q id
   511   $ hg -q id
   510   a71343332ea9
   512   577e60613a88
   511   $ head -1 a
   513   $ head -1 a
   512   expand $Id: a,v a71343332ea9 1970/01/01 00:00:01 test $
   514   expand $Id: a,v 577e60613a88 1970/01/01 00:00:15 test $
   513 
   515 
   514   $ hg -q strip -n tip
   516   $ hg -q strip -n tip
   515 
   517 
   516 Test patch queue repo
   518 Test patch queue repo
   517 
   519 
   610   $ rm i
   612   $ rm i
   611 
   613 
   612 cp symlink file; hg cp -A symlink file (part1)
   614 cp symlink file; hg cp -A symlink file (part1)
   613 - copied symlink points to kwfile: overwrite
   615 - copied symlink points to kwfile: overwrite
   614 
   616 
       
   617 #if symlink
   615   $ cp sym i
   618   $ cp sym i
   616   $ ls -l i
   619   $ ls -l i
   617   -rw-r--r--* (glob)
   620   -rw-r--r--* (glob)
   618   $ head -1 i
   621   $ head -1 i
   619   expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
   622   expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
   622   overwriting i shrinking keywords
   625   overwriting i shrinking keywords
   623   $ head -1 i
   626   $ head -1 i
   624   expand $Id$
   627   expand $Id$
   625   $ hg forget i
   628   $ hg forget i
   626   $ rm i
   629   $ rm i
       
   630 #endif
   627 
   631 
   628 Test different options of hg kwfiles
   632 Test different options of hg kwfiles
   629 
   633 
   630   $ hg kwfiles
   634   $ hg kwfiles
   631   a
   635   a
   922 
   926 
   923   $ hg kwexpand nonexistent
   927   $ hg kwexpand nonexistent
   924   nonexistent:* (glob)
   928   nonexistent:* (glob)
   925 
   929 
   926 
   930 
       
   931 #if serve
   927 hg serve
   932 hg serve
   928  - expand with hgweb file
   933  - expand with hgweb file
   929  - no expansion with hgweb annotate/changeset/filediff
   934  - no expansion with hgweb annotate/changeset/filediff
   930  - check errors
   935  - check errors
   931 
   936 
   985   
   990   
   986   
   991   
   987   
   992   
   988   
   993   
   989   $ cat errors.log
   994   $ cat errors.log
       
   995 #endif
   990 
   996 
   991 Prepare merge and resolve tests
   997 Prepare merge and resolve tests
   992 
   998 
   993   $ echo '$Id$' > m
   999   $ echo '$Id$' > m
   994   $ hg add m
  1000   $ hg add m