tests/test-keyword
changeset 378 0683aaf458d8
parent 376 f44fb15a0f30
child 381 17e94f77de6a
equal deleted inserted replaced
377:ce5eb725d0c6 378:0683aaf458d8
    22  -e '/[$]Revision/ s/: [a-z0-9][a-z0-9]* /: xxxxxxxxxxxx /' \
    22  -e '/[$]Revision/ s/: [a-z0-9][a-z0-9]* /: xxxxxxxxxxxx /' \
    23  -e 's! 20[0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-6][0-9]:[0-6][0-9]! 2000/00/00 00:00:00!'
    23  -e 's! 20[0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-6][0-9]:[0-6][0-9]! 2000/00/00 00:00:00!'
    24 
    24 
    25 hg --quiet kwdemo "Branch = {branches}"
    25 hg --quiet kwdemo "Branch = {branches}"
    26 
    26 
    27 hg init t
    27 hg init Test
    28 cd t
    28 cd Test
       
    29 
    29 echo % kwshrink should exit silently in empty/invalid repo
    30 echo % kwshrink should exit silently in empty/invalid repo
    30 hg kwshrink
    31 hg kwshrink
    31 
       
    32 echo % symlink nonexisting file
       
    33 ln -s a sym
       
    34 echo % commit hook must fail with missing file
       
    35 hg --debug commit -A -msym -d '0 0' -u 'User Name <user@example.com>'
       
    36 echo % bundle null revision containing empty symlink
       
    37 hg bundle --base null ../test-keyword.hg
       
    38 cd ..
       
    39 
       
    40 hg init Test
       
    41 cd Test
       
    42 
       
    43 echo % pull from bundle
       
    44 hg pull --traceback -u ../test-keyword.hg
       
    45 
    32 
    46 echo 'expand $Id$' > a
    33 echo 'expand $Id$' > a
    47 echo 'do not process $Id:' >> a
    34 echo 'do not process $Id:' >> a
    48 echo 'xxx $' >> a
    35 echo 'xxx $' >> a
    49 echo 'ignore $Id$' > b
    36 echo 'ignore $Id$' > b
       
    37 ln -s a sym
    50 echo % cat
    38 echo % cat
    51 cat sym a b
    39 cat sym a b
    52 
    40 
    53 echo % addremove
    41 echo % addremove
    54 hg addremove
    42 hg addremove
    60 hg --debug commit
    48 hg --debug commit
    61 echo % status
    49 echo % status
    62 hg status
    50 hg status
    63 
    51 
    64 echo % commit
    52 echo % commit
    65 hg --debug commit -mabsym -d '1 0' -u 'User Name <user@example.com>'
    53 hg --debug commit -mabsym -d '0 0' -u 'User Name <user@example.com>'
    66 echo % status
    54 echo % status
    67 hg status
    55 hg status
    68 echo % identify
    56 echo % identify
    69 hg --quiet identify
    57 hg --quiet identify
    70 echo % cat
    58 echo % cat
    71 cat sym a b
    59 cat sym a b
    72 echo % hg kwcat
    60 echo % hg cat
    73 hg kwcat sym a b
    61 hg cat sym a b
    74 
    62 
    75 echo
    63 echo
    76 echo % diff a hooktest
    64 echo % diff a hooktest
    77 diff a hooktest
    65 diff a hooktest
    78 
    66 
    94 
    82 
    95 echo % check whether expansion is filewise
    83 echo % check whether expansion is filewise
    96 echo '$Id$' > c
    84 echo '$Id$' > c
    97 echo 'tests for different changenodes' >> c
    85 echo 'tests for different changenodes' >> c
    98 echo % commit c
    86 echo % commit c
    99 hg commit -A -mcndiff -d '2 0' -u 'User Name <user@example.com>'
    87 hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
   100 echo % force expansion
    88 echo % force expansion
   101 hg -v kwexpand
    89 hg -v kwexpand
   102 echo % compare changenodes in a c
    90 echo % compare changenodes in a c
   103 cat a c
    91 cat a c
   104 
    92 
   105 echo % qinit -c
       
   106 hg qinit -c
       
   107 echo % qimport
    93 echo % qimport
   108 hg qimport -r tip -n mqtest.diff
    94 hg qimport -r tip -n mqtest.diff
   109 echo % qcommit
       
   110 hg qcommit -mqtest
       
   111 echo % keywords should not be expanded in patch
    95 echo % keywords should not be expanded in patch
   112 cat .hg/patches/mqtest.diff
    96 cat .hg/patches/mqtest.diff
   113 echo % qpop
    97 echo % qpop
   114 hg qpop
    98 hg qpop
   115 echo % qgoto - should imply qpush
    99 echo % qgoto - should imply qpush
   124 
   108 
   125 echo % kwfiles added
   109 echo % kwfiles added
   126 hg kwfiles
   110 hg kwfiles
   127 
   111 
   128 echo % commit
   112 echo % commit
   129 hg --debug commit -ma2c -d '2 0' -u 'User Name <user@example.com>'
   113 hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
   130 echo % cat a c
   114 echo % cat a c
   131 cat a c
   115 cat a c
   132 echo % touch copied c after 1 second
   116 echo % touch copied c after 1 second
   133 sleep 1
   117 sleep 1
   134 touch c
   118 touch c
   137 
   121 
   138 echo % kwfiles
   122 echo % kwfiles
   139 hg kwfiles
   123 hg kwfiles
   140 
   124 
   141 echo % diff --rev
   125 echo % diff --rev
   142 hg diff --rev 1 | grep -v 'b/c'
   126 hg diff --rev 0 | grep -v 'b/c'
   143 
   127 
   144 echo % rollback
   128 echo % rollback
   145 hg rollback
   129 hg rollback
   146 echo % status
   130 echo % status
   147 hg status
   131 hg status
   158 Xinfo = {author}: {desc}
   142 Xinfo = {author}: {desc}
   159 EOF
   143 EOF
   160 
   144 
   161 echo % cat
   145 echo % cat
   162 cat sym a b
   146 cat sym a b
   163 echo % hg kwcat
   147 echo % hg cat
   164 hg kwcat sym a b
   148 hg cat sym a b
   165 
   149 
   166 echo
   150 echo
   167 echo '$Xinfo$' >> a
   151 echo '$Xinfo$' >> a
   168 cat <<EOF >> log
   152 cat <<EOF >> log
   169 firstline
   153 firstline
   174 hg commit
   158 hg commit
   175 echo % status
   159 echo % status
   176 hg status
   160 hg status
   177 
   161 
   178 echo % commit
   162 echo % commit
   179 hg --debug commit -l log -d '3 0' -u 'User Name <user@example.com>'
   163 hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
   180 rm log
   164 rm log
   181 echo % status
   165 echo % status
   182 hg status
   166 hg status
   183 
   167 
   184 echo % cat
   168 echo % cat
   185 cat sym a b
   169 cat sym a b
   186 echo % hg kwcat
   170 echo % hg cat
   187 hg kwcat sym a b
   171 hg cat sym a b
   188 echo
   172 echo
   189 
   173 
   190 echo % remove
   174 echo % remove
   191 hg remove a
   175 hg remove a
   192 hg --debug commit -m rma
   176 hg --debug commit -m rma
   201 echo % cat a
   185 echo % cat a
   202 cat a
   186 cat a
   203 
   187 
   204 echo % clone to test incoming
   188 echo % clone to test incoming
   205 cd ..
   189 cd ..
   206 hg clone -r1 Test Test-a
   190 hg clone -r0 Test Test-a
   207 cd Test-a
   191 cd Test-a
   208 cat <<EOF >> .hg/hgrc
   192 cat <<EOF >> .hg/hgrc
   209 [paths]
   193 [paths]
   210 default = ../Test
   194 default = ../Test
   211 EOF
   195 EOF
   214 hg incoming | sed -e 's/^\(comparing with \).*\(test-keyword.*\)/\1\2/'
   198 hg incoming | sed -e 's/^\(comparing with \).*\(test-keyword.*\)/\1\2/'
   215 
   199 
   216 sed -e 's/Id.*/& rejecttest/' a > a.new
   200 sed -e 's/Id.*/& rejecttest/' a > a.new
   217 mv a.new a
   201 mv a.new a
   218 echo % commit rejecttest
   202 echo % commit rejecttest
   219 hg --debug commit -m'rejects?' -d '4 0' -u 'User Name <user@example.com>'
   203 hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
   220 echo % export
   204 echo % export
   221 hg export -o ../rejecttest.diff tip
   205 hg export -o ../rejecttest.diff tip
   222 
   206 
   223 cd ../Test
   207 cd ../Test
   224 echo % import
   208 echo % import
   238 echo % kwexpand a
   222 echo % kwexpand a
   239 hg --verbose kwexpand a
   223 hg --verbose kwexpand a
   240 echo % kwexpand x/a should abort
   224 echo % kwexpand x/a should abort
   241 hg --verbose kwexpand x/a
   225 hg --verbose kwexpand x/a
   242 cd x
   226 cd x
   243 hg --debug commit -m xa -d '4 0' -u 'User Name <user@example.com>'
   227 hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
   244 echo % cat a
   228 echo % cat a
   245 cat a
   229 cat a
   246 echo % kwshrink a inside directory x
   230 echo % kwshrink a inside directory x
   247 hg --verbose kwshrink a
   231 hg --verbose kwshrink a
   248 echo % cat a
   232 echo % cat a
   250 cd ..
   234 cd ..
   251 
   235 
   252 echo % kwexpand nonexistent
   236 echo % kwexpand nonexistent
   253 hg kwexpand nonexistent
   237 hg kwexpand nonexistent
   254 
   238 
       
   239 echo % switch off expansion
   255 echo % kwshrink with unknown file u
   240 echo % kwshrink with unknown file u
   256 cp a u
   241 cp a u
   257 hg --verbose kwshrink
   242 hg --verbose kwshrink
   258 echo % cat
   243 echo % cat
   259 cat sym a b
   244 cat sym a b
   260 echo % hg kwcat
   245 echo % hg cat
   261 hg kwcat sym a b
   246 hg cat sym a b
   262 echo
   247 echo
       
   248 rm $HGRCPATH
       
   249 echo % cat
       
   250 cat sym a b
       
   251 echo % hg cat
       
   252 hg cat sym a b
       
   253 echo