# HG changeset patch # User Pierre-Yves David # Date 2014-06-25 16:03:55 # Node ID db23fb4e210d942c3da82507c595a4b2b6b4522c # Parent 3163b8f8ff264ea1a83f6bfd4ba727fa73985155 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. diff --git a/tests/test-revert.t b/tests/test-revert.t --- a/tests/test-revert.t +++ b/tests/test-revert.t @@ -551,3 +551,24 @@ Setup working directory $ 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]