tests/test-locate
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
Fri, 16 Mar 2007 22:48:21 -0300
changeset 4234 fe0c0a317c09
parent 4191 1c69c73d85d9
child 4235 eca3277c4220
permissions -rwxr-xr-x
make the output of test-locate more readable
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
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
    20
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
    21
touch nottracked
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    22
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
    23
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
    24
hglocate
1622
5e9168401a68 fix locate broken since 63799b01985c
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    25
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
    26
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
    27
hglocate a
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    28
hglocate NONEXISTENT
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    29
hglocate
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    30
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
    31
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
    32
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
    33
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
    34
cd t
4234
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    35
hglocate
fe0c0a317c09 make the output of test-locate more readable
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4191
diff changeset
    36
hglocate -I ../t
2487
041363739ca8 Test case for #294
Brendan Cully <brendan@kublai.com>
parents: 2480
diff changeset
    37
# test issue294
041363739ca8 Test case for #294
Brendan Cully <brendan@kublai.com>
parents: 2480
diff changeset
    38
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
    39
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
    40
hglocate t