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