test-revert: add methodical revert to parent for working directory
Now that we can automatically generate states, we need to actually run
revert on them and check the result. While running such tests we are
checking multiple elements. The output of the `hg revert` command, the
resulting content of file, and the creation of backup file.
The first practical test is using the simple case `hg revert --all`, reverting
all files to working directory parent content.
--- a/tests/test-revert.t Wed Jun 25 17:24:18 2014 +0100
+++ b/tests/test-revert.t Wed Jun 25 17:03:55 2014 +0100
@@ -551,3 +551,24 @@
$ cd ..
+Test revert --all to parent content
+-----------------------------------
+
+(setup from reference repo)
+
+ $ cp -r revert-ref revert-parent-all
+ $ cd revert-parent-all
+
+check revert output
+
+ $ hg revert --all
+
+Compare resulting directory with revert target.
+
+The diff is filtered to include change only. The only difference should be
+additional `.orig` backup file when applicable.
+
+ $ python ../dircontent.py > ../content-parent-all.txt
+ $ cd ..
+ $ diff -U 0 -- content-parent.txt content-parent-all.txt | grep _
+ [1]