Patchwork [02,of,11] test-revert: add case where file is unchanged between "base" and "parent"

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 12, 2014, 7:43 p.m.
Message ID <03f2b5753e93e126d143.1407872622@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5356/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 12, 2014, 7:43 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1403884849 -7200
#      Fri Jun 27 18:00:49 2014 +0200
# Node ID 03f2b5753e93e126d143e8cfacc31c193299d7b9
# Parent  f1bdca5b44a2ff5597cf28686e7e524fbd1900f5
test-revert: add case where file is unchanged between "base" and "parent"

This test highlights a minor misbehavior in the message displayed during explicit
revert with a target revision.

Patch

diff --git a/tests/test-revert.t b/tests/test-revert.t
--- a/tests/test-revert.t
+++ b/tests/test-revert.t
@@ -433,10 +433,12 @@  Write the python script to disk
   > import os
   > 
   > # content of the file in "base" and "parent"
   > # None means no file at all
   > ctxcontent = {
+  >     # clean: no change from base to parent
+  >     'clean': ['base', 'base'],
   >     # modified: file content change from base to parent
   >     'modified': ['base', 'parent'],
   >     # added: file is missing from base and added in parent
   >     'added': [None, 'parent'],
   > }
@@ -488,10 +490,11 @@  Write the python script to disk
 
 check list of planned files
 
   $ python gen-revert-cases.py filelist
   added_clean
+  clean_clean
   modified_clean
 
 Script to make a simple text version of the content
 ---------------------------------------------------
 
@@ -515,19 +518,22 @@  Generate appropriate repo state
 
 Generate base changeset
 
   $ python ../gen-revert-cases.py base
   $ hg addremove --similarity 0
+  adding clean_clean
   adding modified_clean
   $ hg status
+  A clean_clean
   A modified_clean
   $ hg commit -m 'base'
 
 (create a simple text version of the content)
 
   $ python ../dircontent.py > ../content-base.txt
   $ cat ../content-base.txt
+  base   clean_clean
   base   modified_clean
 
 Create parent changeset
 
   $ python ../gen-revert-cases.py parent
@@ -541,10 +547,11 @@  Create parent changeset
 (create a simple text version of the content)
 
   $ python ../dircontent.py > ../content-parent.txt
   $ cat ../content-parent.txt
   parent added_clean
+  base   clean_clean
   parent modified_clean
 
 Setup working directory
 
   $ python ../gen-revert-cases.py wc | cat
@@ -558,10 +565,11 @@  Setup working directory
 (create a simple text version of the content)
 
   $ python ../dircontent.py > ../content-wc.txt
   $ cat ../content-wc.txt
   parent added_clean
+  base   clean_clean
   parent modified_clean
 
   $ cd ..
 
 Test revert --all to parent content
@@ -627,10 +635,13 @@  revert all files individually and check 
   >   echo
   > done
   ### revert for: added_clean
   no changes needed to added_clean
   
+  ### revert for: clean_clean
+  no changes needed to clean_clean
+  
   ### revert for: modified_clean
   no changes needed to modified_clean
   
 
 check resulting directory againt the --all run
@@ -650,17 +661,25 @@  Test revert to "base" content with expli
   $ cd revert-base-explicit
 
 revert all files individually and check the output
 (output is expected to be different than in the --all case)
 
+Misbehavior:
+
+- fails to report no change to revert for
+|
+| - clean_clean
+
   $ for file in `python ../gen-revert-cases.py filelist`; do
   >   echo '### revert for:' $file;
   >   hg revert $file --rev 'desc(base)';
   >   echo
   > done
   ### revert for: added_clean
   
+  ### revert for: clean_clean
+  
   ### revert for: modified_clean
   
 
 check resulting directory againt the --all run
 (There should be no difference)