##// END OF EJS Templates
revert: don't assume ignored files will be returned in the unknown list...
revert: don't assume ignored files will be returned in the unknown list That's just an artifact of the current implementation, and I'll change that soon. Bonus points: - we don't care about the unknown list at all - we don't print an extra message if we try to revert a removed file that is not present in the target revision

File last commit:

r6031:73833847 default
r6031:73833847 default
Show More
test-revert
142 lines | 2.6 KiB | text/plain | TextLexer
Benoit Boissinot
revert added and removed files to their normal state before reverting...
r1447 #!/bin/sh
Alexis S. L. Carvalho
revert: don't assume ignored files will be returned in the unknown list...
r6031 hg init repo
cd repo
Benoit Boissinot
revert added and removed files to their normal state before reverting...
r1447 echo 123 > a
echo 123 > c
Vadim Gelfer
rewrite revert command. fix issues 93, 123, 147....
r2029 echo 123 > e
hg add a c e
hg commit -m "first" -d "1000000 0" a c e
Benoit Boissinot
revert added and removed files to their normal state before reverting...
r1447 echo 123 > b
Benoit Boissinot
fix handling of files of unsupported type in the walk code...
r1487 echo %% should show b unknown
Benoit Boissinot
revert added and removed files to their normal state before reverting...
r1447 hg status
echo 12 > c
Benoit Boissinot
fix handling of files of unsupported type in the walk code...
r1487 echo %% should show b unknown and c modified
Benoit Boissinot
revert added and removed files to their normal state before reverting...
r1447 hg status
hg add b
Benoit Boissinot
fix handling of files of unsupported type in the walk code...
r1487 echo %% should show b added and c modified
Benoit Boissinot
revert added and removed files to their normal state before reverting...
r1447 hg status
hg rm a
Benoit Boissinot
fix handling of files of unsupported type in the walk code...
r1487 echo %% should show a removed, b added and c modified
Benoit Boissinot
revert added and removed files to their normal state before reverting...
r1447 hg status
hg revert a
Vadim Gelfer
rewrite revert command. fix issues 93, 123, 147....
r2029 echo %% should show b added, copy saved, and c modified
Benoit Boissinot
revert added and removed files to their normal state before reverting...
r1447 hg status
hg revert b
Thomas Arendsen Hein
Minor fix for revert: No need to make a backup when forgetting added files....
r2043 echo %% should show b unknown, and c modified
Vadim Gelfer
rewrite revert command. fix issues 93, 123, 147....
r2029 hg status
hg revert --no-backup c
Thomas Arendsen Hein
Minor fix for revert: No need to make a backup when forgetting added files....
r2043 echo %% should show unknown: b
Benoit Boissinot
revert added and removed files to their normal state before reverting...
r1447 hg status
Thomas Arendsen Hein
Minor fix for revert: No need to make a backup when forgetting added files....
r2043 echo %% should show a b c e
Benoit Boissinot
revert added and removed files to their normal state before reverting...
r1447 ls
Thomas Arendsen Hein
Don't abort when backup files already exist. Don't allow alternative names....
r2036 echo %% should verbosely save backup to e.orig
Vadim Gelfer
rewrite revert command. fix issues 93, 123, 147....
r2029 echo z > e
Vadim Gelfer
revert: require --all to revert all files.
r2982 hg revert --all -v
Vadim Gelfer
rewrite revert command. fix issues 93, 123, 147....
r2029 echo %% should say no changes needed
hg revert a
echo %% should say file not managed
echo q > q
hg revert q
Vadim Gelfer
small changes to revert command....
r2042 rm q
Vadim Gelfer
rewrite revert command. fix issues 93, 123, 147....
r2029 echo %% should say file not found
hg revert notfound
Alexis S. L. Carvalho
revert: don't assume ignored files will be returned in the unknown list...
r6031 touch d
hg add d
Vadim Gelfer
small changes to revert command....
r2042 hg rm a
hg commit -m "second" -d "1000000 0"
echo z > z
hg add z
hg st
Alexis S. L. Carvalho
revert: don't assume ignored files will be returned in the unknown list...
r6031 echo %% should add a, remove d, forget z
Vadim Gelfer
revert: require --all to revert all files.
r2982 hg revert --all -r0
Alexis S. L. Carvalho
revert: don't assume ignored files will be returned in the unknown list...
r6031 echo %% should forget a, undelete d
Vadim Gelfer
revert: require --all to revert all files.
r2982 hg revert --all -rtip
Thomas Arendsen Hein
Don't use -f for rm in tests where not needed. Drop /bin/ from /bin/rm.
r3988 rm a *.orig
Vadim Gelfer
small changes to revert command....
r2042 echo %% should silently add a
hg revert -r0 a
hg st a
Alexis S. L. Carvalho
revert: don't assume ignored files will be returned in the unknown list...
r6031 hg rm d
hg st d
echo %% should silently keep d removed
hg revert -r0 d
hg st d
Benoit Boissinot
revert added and removed files to their normal state before reverting...
r1447
Vadim Gelfer
make test-revert check executable bit.
r2157 hg update -C
chmod +x c
Vadim Gelfer
revert: require --all to revert all files.
r2982 hg revert --all
Vadim Gelfer
make test-revert check executable bit.
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
revert: require --all to revert all files.
r2982 hg revert --all
Vadim Gelfer
make test-revert check executable bit.
r2157 echo %% should print executable
test -x c && echo executable
Alexis S. L. Carvalho
revert: don't assume ignored files will be returned in the unknown list...
r6031 cd ..
Vadim Gelfer
revert: fix corner case found by faheem mitha....
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
revert: require --all to revert all files.
r2982
echo % should fail - no arguments
Vadim Gelfer
revert: fix corner case found by faheem mitha....
r2272 hg revert -rtip
Vadim Gelfer
revert: require --all to revert all files.
r2982 echo % should succeed
hg revert --all -rtip
Benoit Boissinot
fix incorrect warning when walking on a particular rev...
r3019 echo %% issue332
hg ci -A -m b -d '1000001 0'
echo foobar > b/b
Alexis S. L. Carvalho
Fix confusing message from hg revert (issue332)...
r4225 mkdir newdir
echo foo > newdir/newfile
hg add newdir/newfile
hg revert b newdir
Alexis S. L. Carvalho
util._matcher: use "." as the root of empty {rel,}path patterns...
r4233 echo foobar > b/b
hg revert .
Brendan Cully
When reverting a file which was renamed, also revert the old name
r5230
echo % reverting a rename target should revert the source
hg mv a newa
hg revert newa
hg st a newa
Alexis S. L. Carvalho
revert: don't assume ignored files will be returned in the unknown list...
r6031 cd ..
hg init ignored
cd ignored
echo '^ignored$' > .hgignore
echo '^ignoreddir$' >> .hgignore
echo '^removed$' >> .hgignore
mkdir ignoreddir
touch ignoreddir/file
touch ignoreddir/removed
touch ignored
touch removed
echo '%% 4 ignored files (we will add/commit everything)'
hg st -A -X .hgignore
hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed
echo >> ignored
echo >> ignoreddir/file
hg rm removed ignoreddir/removed
echo '%% should revert ignored* and undelete *removed'
hg revert -a --no-backup
hg st -mardi
hg up -qC
echo >> ignored
hg rm removed
echo %% should silently revert the named files
hg revert --no-backup ignored removed
hg st -mardi