tests/test-walk
changeset 11799 ddebb6a690b4
parent 11798 1ab3d8977bdf
child 11800 88c3ff051270
equal deleted inserted replaced
11798:1ab3d8977bdf 11799:ddebb6a690b4
     1 #!/bin/sh
       
     2 
       
     3 debugwalk()
       
     4 {
       
     5     echo "hg debugwalk $@"
       
     6     hg debugwalk "$@"
       
     7     echo
       
     8 }
       
     9 
       
    10 chdir()
       
    11 {
       
    12     echo "cd $@"
       
    13     cd "$@"
       
    14     echo
       
    15 }
       
    16 
       
    17 mkdir t
       
    18 cd t
       
    19 hg init
       
    20 mkdir -p beans
       
    21 for b in kidney navy turtle borlotti black pinto; do
       
    22     echo $b > beans/$b
       
    23 done
       
    24 mkdir -p mammals/Procyonidae
       
    25 for m in cacomistle coatimundi raccoon; do
       
    26     echo $m > mammals/Procyonidae/$m
       
    27 done
       
    28 echo skunk > mammals/skunk
       
    29 echo fennel > fennel
       
    30 echo fenugreek > fenugreek
       
    31 echo fiddlehead > fiddlehead
       
    32 echo glob:glob > glob:glob
       
    33 hg addremove
       
    34 hg commit -m "commit #0" -d "1000000 0"
       
    35 debugwalk
       
    36 debugwalk -I.
       
    37 chdir mammals
       
    38 debugwalk
       
    39 debugwalk -X ../beans
       
    40 debugwalk -I '*k'
       
    41 debugwalk -I 'glob:*k'
       
    42 debugwalk -I 'relglob:*k'
       
    43 debugwalk -I 'relglob:*k' .
       
    44 debugwalk -I 're:.*k$'
       
    45 debugwalk -I 'relre:.*k$'
       
    46 debugwalk -I 'path:beans'
       
    47 debugwalk -I 'relpath:../beans'
       
    48 debugwalk .
       
    49 debugwalk -I.
       
    50 debugwalk Procyonidae
       
    51 chdir Procyonidae
       
    52 debugwalk .
       
    53 debugwalk ..
       
    54 chdir ..
       
    55 debugwalk ../beans
       
    56 debugwalk .
       
    57 debugwalk .hg
       
    58 debugwalk ../.hg
       
    59 chdir ..
       
    60 debugwalk -Ibeans
       
    61 debugwalk -I '{*,{b,m}*/*}k'
       
    62 debugwalk 'glob:mammals/../beans/b*'
       
    63 debugwalk '-X*/Procyonidae' mammals
       
    64 debugwalk path:mammals
       
    65 debugwalk ..
       
    66 debugwalk beans/../..
       
    67 debugwalk .hg
       
    68 debugwalk beans/../.hg
       
    69 debugwalk beans/../.hg/data
       
    70 debugwalk beans/.hg
       
    71 # Don't know how to test absolute paths without always getting a false
       
    72 # error.
       
    73 #debugwalk `pwd`/beans
       
    74 #debugwalk `pwd`/..
       
    75 debugwalk glob:\*
       
    76 debugwalk 'glob:**e'
       
    77 debugwalk 're:.*[kb]$'
       
    78 debugwalk path:beans/black
       
    79 debugwalk path:beans//black
       
    80 debugwalk relglob:Procyonidae
       
    81 debugwalk 'relglob:Procyonidae/**'
       
    82 debugwalk 'relglob:Procyonidae/**' fennel
       
    83 debugwalk beans 'glob:beans/*'
       
    84 debugwalk 'glob:mamm**'
       
    85 debugwalk 'glob:mamm**' fennel
       
    86 debugwalk 'glob:j*'
       
    87 debugwalk NOEXIST
       
    88 mkfifo fifo
       
    89 debugwalk fifo
       
    90 rm fenugreek
       
    91 debugwalk fenugreek
       
    92 hg rm fenugreek
       
    93 debugwalk fenugreek
       
    94 touch new
       
    95 debugwalk new
       
    96 
       
    97 mkdir ignored
       
    98 touch ignored/file
       
    99 echo '^ignored$' > .hgignore
       
   100 debugwalk ignored
       
   101 debugwalk ignored/file
       
   102 
       
   103 chdir ..
       
   104 debugwalk -R t t/mammals/skunk
       
   105 mkdir t2
       
   106 chdir t2
       
   107 debugwalk -R ../t ../t/mammals/skunk
       
   108 debugwalk --cwd ../t mammals/skunk