[PATCH 7 of 8] test-revert: add methodical revert with explicit file path

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Aug 11 13:39:53 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1403713367 -3600
#      Wed Jun 25 17:22:47 2014 +0100
# Node ID f2f9f3965e9e0cd22473e5159e00b42fdd357645
# Parent  6288c0ecc8ac7d6d4e15edd241f6e15893ef18ea
test-revert: add methodical revert with explicit file path

We now also test reverting file to the working directory parent content. However
this differ from previously introduced test by using the explicit path of each
"case file" when calling revert. This should result in the same result regarding
file content and backup creation, but the output of the `hg revert` call should
differ.

diff --git a/tests/test-revert.t b/tests/test-revert.t
--- a/tests/test-revert.t
+++ b/tests/test-revert.t
@@ -593,5 +593,33 @@ additional `.orig` backup file when appl
 
   $ python ../dircontent.py > ../content-base-all.txt
   $ cd ..
   $ diff -U 0 -- content-base.txt content-base-all.txt | grep _
   [1]
+
+Test revert to parent content with explicit file name
+-----------------------------------------------------
+
+(setup from reference repo)
+
+  $ cp -r revert-ref revert-parent-explicit
+  $ cd revert-parent-explicit
+
+revert all files individually and check the output
+(output is expected to be different than in the --all case)
+
+  $ for file in `python ../gen-revert-cases.py filelist`; do
+  >   echo '### revert for:' $file;
+  >   hg revert $file;
+  >   echo
+  > done
+  ### revert for: modified_clean
+  no changes needed to modified_clean
+  
+
+check resulting directory againt the --all run
+(There should be no difference)
+
+  $ python ../dircontent.py > ../content-parent-explicit.txt
+  $ cd ..
+  $ diff -U 0 -- content-parent-all.txt content-parent-explicit.txt | grep _
+  [1]


More information about the Mercurial-devel mailing list