comparison tests/test-revert @ 2029:d436b21b20dc

rewrite revert command. fix issues 93, 123, 147. new version does these things: - saves backup copies of modified files (issue 147) - prints output like other commands, and errors when files not found (issue 123) - marks files added/removed (issue 93)
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Fri, 31 Mar 2006 10:37:25 -0800
parents 7544700fd931
children c9226bcc288d
comparison
equal deleted inserted replaced
2028:1f1fc418a96c 2029:d436b21b20dc
1 #!/bin/sh 1 #!/bin/sh
2 2
3 hg init 3 hg init
4 echo 123 > a 4 echo 123 > a
5 echo 123 > c 5 echo 123 > c
6 hg add a c 6 echo 123 > e
7 hg commit -m "first" -d "1000000 0" a c 7 hg add a c e
8 hg commit -m "first" -d "1000000 0" a c e
8 echo 123 > b 9 echo 123 > b
9 echo %% should show b unknown 10 echo %% should show b unknown
10 hg status 11 hg status
11 echo 12 > c 12 echo 12 > c
12 echo %% should show b unknown and c modified 13 echo %% should show b unknown and c modified
16 hg status 17 hg status
17 hg rm a 18 hg rm a
18 echo %% should show a removed, b added and c modified 19 echo %% should show a removed, b added and c modified
19 hg status 20 hg status
20 hg revert a 21 hg revert a
21 echo %% should show b added and c modified 22 echo %% should show b added, copy saved, and c modified
22 hg status 23 hg status
23 hg revert b 24 hg revert b
24 echo %% should show b unknown and c modified 25 echo %% should show b unknown, b.bak unknown, and c modified
25 hg status 26 hg status
26 hg revert c 27 hg revert --no-backup c
27 echo %% should show b unknown 28 echo %% should show unknown: b b.bak
28 hg status 29 hg status
29 echo %% should show a b and c 30 echo %% should show a b b.bak c e
30 ls 31 ls
32 echo %% should save backup to e.0
33 echo z > e
34 hg revert --backup='%p.%R'
35 echo %% should say no changes needed
36 hg revert a
37 echo %% should say file not managed
38 echo q > q
39 hg revert q
40 echo %% should say file not found
41 hg revert notfound
31 42
32 true 43 true