tests/test-locate
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
Fri, 16 Mar 2007 22:48:22 -0300
changeset 4235 eca3277c4220
parent 4234 fe0c0a317c09
child 4304 702f48570eb3
permissions -rwxr-xr-x
add some more tests to hg locate
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1622
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     1
#!/bin/sh
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
     2
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
     3
hglocate()
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
     4
{
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
     5
    echo "hg locate $@"
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
     6
    hg locate "$@"
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
     7
    ret=$?
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
     8
    echo
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
     9
    return $ret
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    10
}
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    11
1622
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    12
mkdir t
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    13
cd t
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    14
hg init
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    15
echo 0 > a
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    16
echo 0 > b
2487
041363739ca8 Test case for #294
Brendan Cully <brendan@kublai.com>
parents: 2480
diff changeset
    17
echo 0 > t.h
2480
519a1011db91 fix -I/-X when relative paths used or in subdir
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1933
diff changeset
    18
mkdir t
519a1011db91 fix -I/-X when relative paths used or in subdir
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1933
diff changeset
    19
echo 0 > t/x
4235
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    20
echo 0 > t/b
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    21
echo 0 > t/e.h
1933
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1622
diff changeset
    22
hg ci -A -m m -d "1000000 0"
1622
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    23
touch nottracked
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    24
hglocate a && echo locate succeeded || echo locate failed
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    25
hglocate NONEXISTENT && echo locate succeeded || echo locate failed
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    26
hglocate
1622
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    27
hg rm a
1933
7544700fd931 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 1622
diff changeset
    28
hg ci -m m -d "1000000 0"
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    29
hglocate a
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    30
hglocate NONEXISTENT
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    31
hglocate
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    32
hglocate -r 0 a
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    33
hglocate -r 0 NONEXISTENT
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    34
hglocate -r 0
2480
519a1011db91 fix -I/-X when relative paths used or in subdir
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1933
diff changeset
    35
echo % -I/-X with relative path should work
519a1011db91 fix -I/-X when relative paths used or in subdir
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1933
diff changeset
    36
cd t
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    37
hglocate
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    38
hglocate -I ../t
2487
041363739ca8 Test case for #294
Brendan Cully <brendan@kublai.com>
parents: 2480
diff changeset
    39
# test issue294
041363739ca8 Test case for #294
Brendan Cully <brendan@kublai.com>
parents: 2480
diff changeset
    40
cd ..
3988
9dcf9d45cab8 Don't use -f for rm in tests where not needed. Drop /bin/ from /bin/rm.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2487
diff changeset
    41
rm -r t
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    42
hglocate t
4235
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    43
mkdir otherdir
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    44
cd otherdir
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    45
hglocate b
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    46
hglocate '*.h'
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    47
hglocate path:t/x
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    48
hglocate 're:.*\.h'
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    49
hglocate -r 0 b
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    50
hglocate -r 0 '*.h'
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    51
hglocate -r 0 path:t/x
eca3277c4220 add some more tests to hg locate
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4234
diff changeset
    52
hglocate -r 0 're:.*\.h'