test-revert
97 lines
| 1.7 KiB
| text/plain
|
TextLexer
/ tests / test-revert
Benoit Boissinot
|
r1447 | #!/bin/sh | ||
hg init | ||||
echo 123 > a | ||||
echo 123 > c | ||||
Vadim Gelfer
|
r2029 | echo 123 > e | ||
hg add a c e | ||||
hg commit -m "first" -d "1000000 0" a c e | ||||
Benoit Boissinot
|
r1447 | echo 123 > b | ||
Benoit Boissinot
|
r1487 | echo %% should show b unknown | ||
Benoit Boissinot
|
r1447 | hg status | ||
echo 12 > c | ||||
Benoit Boissinot
|
r1487 | echo %% should show b unknown and c modified | ||
Benoit Boissinot
|
r1447 | hg status | ||
hg add b | ||||
Benoit Boissinot
|
r1487 | echo %% should show b added and c modified | ||
Benoit Boissinot
|
r1447 | hg status | ||
hg rm a | ||||
Benoit Boissinot
|
r1487 | echo %% should show a removed, b added and c modified | ||
Benoit Boissinot
|
r1447 | hg status | ||
hg revert a | ||||
Vadim Gelfer
|
r2029 | echo %% should show b added, copy saved, and c modified | ||
Benoit Boissinot
|
r1447 | hg status | ||
hg revert b | ||||
Thomas Arendsen Hein
|
r2043 | echo %% should show b unknown, and c modified | ||
Vadim Gelfer
|
r2029 | hg status | ||
hg revert --no-backup c | ||||
Thomas Arendsen Hein
|
r2043 | echo %% should show unknown: b | ||
Benoit Boissinot
|
r1447 | hg status | ||
Thomas Arendsen Hein
|
r2043 | echo %% should show a b c e | ||
Benoit Boissinot
|
r1447 | ls | ||
Thomas Arendsen Hein
|
r2036 | echo %% should verbosely save backup to e.orig | ||
Vadim Gelfer
|
r2029 | echo z > e | ||
Vadim Gelfer
|
r2982 | hg revert --all -v | ||
Vadim Gelfer
|
r2029 | echo %% should say no changes needed | ||
hg revert a | ||||
echo %% should say file not managed | ||||
echo q > q | ||||
hg revert q | ||||
Vadim Gelfer
|
r2042 | rm q | ||
Vadim Gelfer
|
r2029 | echo %% should say file not found | ||
hg revert notfound | ||||
Vadim Gelfer
|
r2042 | hg rm a | ||
hg commit -m "second" -d "1000000 0" | ||||
echo z > z | ||||
hg add z | ||||
hg st | ||||
echo %% should add a, forget z | ||||
Vadim Gelfer
|
r2982 | hg revert --all -r0 | ||
Vadim Gelfer
|
r2042 | echo %% should forget a | ||
Vadim Gelfer
|
r2982 | hg revert --all -rtip | ||
Thomas Arendsen Hein
|
r3988 | rm a *.orig | ||
Vadim Gelfer
|
r2042 | echo %% should silently add a | ||
hg revert -r0 a | ||||
hg st a | ||||
Benoit Boissinot
|
r1447 | |||
Vadim Gelfer
|
r2157 | hg update -C | ||
chmod +x c | ||||
Vadim Gelfer
|
r2982 | hg revert --all | ||
Vadim Gelfer
|
r2157 | echo %% should print non-executable | ||
test -x c || echo non-executable | ||||
chmod +x c | ||||
hg commit -d '1000001 0' -m exe | ||||
chmod -x c | ||||
Vadim Gelfer
|
r2982 | hg revert --all | ||
Vadim Gelfer
|
r2157 | echo %% should print executable | ||
test -x c && echo executable | ||||
Vadim Gelfer
|
r2272 | echo %% issue 241 | ||
hg init a | ||||
cd a | ||||
echo a >> a | ||||
hg commit -A -d '1 0' -m a | ||||
echo a >> a | ||||
hg commit -d '2 0' -m a | ||||
hg update 0 | ||||
mkdir b | ||||
echo b > b/b | ||||
Vadim Gelfer
|
r2982 | |||
echo % should fail - no arguments | ||||
Vadim Gelfer
|
r2272 | hg revert -rtip | ||
Vadim Gelfer
|
r2982 | echo % should succeed | ||
hg revert --all -rtip | ||||
Benoit Boissinot
|
r3019 | echo %% issue332 | ||
hg ci -A -m b -d '1000001 0' | ||||
echo foobar > b/b | ||||
Alexis S. L. Carvalho
|
r4225 | mkdir newdir | ||
echo foo > newdir/newfile | ||||
hg add newdir/newfile | ||||
hg revert b newdir | ||||
Alexis S. L. Carvalho
|
r4233 | echo foobar > b/b | ||
hg revert . | ||||
Benoit Boissinot
|
r1447 | true | ||