tests/test-grep.t
changeset 44848 7e7080ab8ba8
parent 43304 8cb5f96db235
child 44849 f90957c947f4
equal deleted inserted replaced
44847:11592ce6a711 44848:7e7080ab8ba8
   643 Test for showing working of allfiles flag
   643 Test for showing working of allfiles flag
   644 
   644 
   645   $ hg init sng
   645   $ hg init sng
   646   $ cd sng
   646   $ cd sng
   647   $ echo "unmod" >> um
   647   $ echo "unmod" >> um
   648   $ hg ci -A -m "adds unmod to um"
   648   $ echo old > old
   649   adding um
   649   $ hg ci -q -A -m "adds unmod to um"
   650   $ echo "something else" >> new
   650   $ echo "something else" >> new
   651   $ hg ci -A -m "second commit"
   651   $ hg ci -A -m "second commit"
   652   adding new
   652   adding new
   653   $ hg grep -r "." "unmod"
   653   $ hg grep -r "." "unmod"
   654   um:1:unmod
   654   um:1:unmod
   655 
   655 
   656 Working directory is searched by default
   656 Existing tracked files in the working directory are searched by default
   657 
   657 
   658   $ echo modified >> new
   658   $ echo modified >> new
   659   $ hg grep mod
   659   $ echo 'added' > added; hg add added
       
   660   $ echo 'added, missing' > added-missing; hg add added-missing; rm added-missing
       
   661   $ echo 'untracked' > untracked
       
   662   $ hg rm old
       
   663   $ hg grep '[^Z]'
       
   664   added:added
       
   665   new:something else
   660   new:modified
   666   new:modified
   661   um:unmod
   667   um:unmod
   662 
   668 
   663  which can be overridden by -rREV
   669  which can be overridden by -rREV
   664 
   670 
   665   $ hg grep -r. mod
   671   $ hg grep -r. mod
   666   um:1:unmod
   672   um:1:unmod
   667 
   673 
   668   $ hg grep --diff mod
   674   $ hg grep --diff mod
   669   um:0:+:unmod
   675   um:0:+:unmod
   670 
       
   671   $ cd ..
       
   672 
       
   673 Fix_Wdir(): test that passing wdir() t -r flag does greps on the
       
   674 files modified in the working directory
       
   675 
       
   676   $ cd a
       
   677   $ echo "abracadara" >> a
       
   678   $ hg add a
       
   679   $ hg grep -r "wdir()" "abra"
       
   680   a:2147483647:abracadara
       
   681 
   676 
   682   $ cd ..
   677   $ cd ..
   683 
   678 
   684 Change Default of grep by ui.tweakdefaults, that is, the files not in current
   679 Change Default of grep by ui.tweakdefaults, that is, the files not in current
   685 working directory should not be grepp-ed on
   680 working directory should not be grepp-ed on