diff tests/test-revert.t @ 22128:db23fb4e210d

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 25 Jun 2014 17:03:55 +0100
parents 3163b8f8ff26
children f0147ff1109f
line wrap: on
line diff
--- 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]