tests/test-locate
changeset 12206 844d25bf65a3
parent 12205 b4d0d646b3f7
child 12207 97e37994a6c3
equal deleted inserted replaced
12205:b4d0d646b3f7 12206:844d25bf65a3
     1 #!/bin/sh
       
     2 
       
     3 hglocate()
       
     4 {
       
     5     echo "hg locate $@"
       
     6     hg locate "$@"
       
     7     ret=$?
       
     8     echo
       
     9     return $ret
       
    10 }
       
    11 
       
    12 mkdir t
       
    13 cd t
       
    14 hg init
       
    15 echo 0 > a
       
    16 echo 0 > b
       
    17 echo 0 > t.h
       
    18 mkdir t
       
    19 echo 0 > t/x
       
    20 echo 0 > t/b
       
    21 echo 0 > t/e.h
       
    22 mkdir dir.h
       
    23 echo 0 > dir.h/foo
       
    24 hg ci -A -m m
       
    25 touch nottracked
       
    26 hglocate a && echo locate succeeded || echo locate failed
       
    27 hglocate NONEXISTENT && echo locate succeeded || echo locate failed
       
    28 hglocate
       
    29 hg rm a
       
    30 hg ci -m m
       
    31 hglocate a
       
    32 hglocate NONEXISTENT
       
    33 hglocate relpath:NONEXISTENT
       
    34 hglocate
       
    35 hglocate -r 0 a
       
    36 hglocate -r 0 NONEXISTENT
       
    37 hglocate -r 0 relpath:NONEXISTENT
       
    38 hglocate -r 0
       
    39 echo % -I/-X with relative path should work
       
    40 cd t
       
    41 hglocate
       
    42 hglocate -I ../t
       
    43 # test issue294
       
    44 cd ..
       
    45 rm -r t
       
    46 hglocate 't/**'
       
    47 mkdir otherdir
       
    48 cd otherdir
       
    49 hglocate b
       
    50 hglocate '*.h'
       
    51 hglocate path:t/x
       
    52 hglocate 're:.*\.h$'
       
    53 hglocate -r 0 b
       
    54 hglocate -r 0 '*.h'
       
    55 hglocate -r 0 path:t/x
       
    56 hglocate -r 0 're:.*\.h$'