Patchwork [3,of,5] test-revert: reverting no change means it's clean

login
register
mail settings
Submitter Martin von Zweigbergk
Date Nov. 2, 2014, 10:19 p.m.
Message ID <29b7d0411f3853be4419.1414966771@handduk2.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6548/
State Accepted
Headers show

Comments

Martin von Zweigbergk - Nov. 2, 2014, 10:19 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@gmail.com>
# Date 1413527800 25200
#      Thu Oct 16 23:36:40 2014 -0700
# Branch stable
# Node ID 29b7d0411f3853be4419916d4d96609aca3dc9f9
# Parent  9439327a222474b6af32ed9f717bfce81f90e53b
test-revert: reverting no change means it's clean

In the script that generates revision and working copy state, 'revert'
means to take the content from the grandparent. If the parent is the
same as the grandparent, there is no change compared to the parent,
which is exactly what 'clean' means. Avoid testing the same state
twice.

Patch

diff --git a/tests/test-revert.t b/tests/test-revert.t
--- a/tests/test-revert.t
+++ b/tests/test-revert.t
@@ -466,8 +466,10 @@ 
   > 
   > # build the combination of possible states
   > combination = []
-  > for ctxkey in ctxcontent:
+  > for ctxkey, ctxvalue in ctxcontent.iteritems():
   >     for wckey in wccontent:
+  >         if (ctxvalue[0] == ctxvalue[1] and 'revert' in wckey):
+  >             continue
   >         filename = "%s_%s" % (ctxkey, wckey)
   >         combination.append((filename, ctxkey, wckey))
   > 
@@ -517,17 +519,13 @@ 
   clean_clean
   clean_deleted
   clean_removed
-  clean_revert
   clean_untracked-clean
-  clean_untracked-revert
   clean_untracked-wc
   clean_wc
   missing_clean
   missing_deleted
   missing_removed
-  missing_revert
   missing_untracked-clean
-  missing_untracked-revert
   missing_untracked-wc
   missing_wc
   modified_clean
@@ -575,9 +573,7 @@ 
   adding clean_clean
   adding clean_deleted
   adding clean_removed
-  adding clean_revert
   adding clean_untracked-clean
-  adding clean_untracked-revert
   adding clean_untracked-wc
   adding clean_wc
   adding modified_clean
@@ -600,9 +596,7 @@ 
   A clean_clean
   A clean_deleted
   A clean_removed
-  A clean_revert
   A clean_untracked-clean
-  A clean_untracked-revert
   A clean_untracked-wc
   A clean_wc
   A modified_clean
@@ -630,9 +624,7 @@ 
   base   clean_clean
   base   clean_deleted
   base   clean_removed
-  base   clean_revert
   base   clean_untracked-clean
-  base   clean_untracked-revert
   base   clean_untracked-wc
   base   clean_wc
   base   modified_clean
@@ -714,9 +706,7 @@ 
   base   clean_clean
   base   clean_deleted
   base   clean_removed
-  base   clean_revert
   base   clean_untracked-clean
-  base   clean_untracked-revert
   base   clean_untracked-wc
   base   clean_wc
   parent modified_clean
@@ -762,7 +752,6 @@ 
   R added_untracked-wc
   R clean_removed
   R clean_untracked-clean
-  R clean_untracked-revert
   R clean_untracked-wc
   R modified_removed
   R modified_untracked-clean
@@ -787,7 +776,6 @@ 
   A missing_wc
   R clean_removed
   R clean_untracked-clean
-  R clean_untracked-revert
   R clean_untracked-wc
   R modified_removed
   R modified_untracked-clean
@@ -815,9 +803,7 @@ 
   wc     added_untracked-wc
   wc     added_wc
   base   clean_clean
-  base   clean_revert
   base   clean_untracked-clean
-  base   clean_untracked-revert
   wc     clean_untracked-wc
   wc     clean_wc
   wc     missing_untracked-wc
@@ -856,7 +842,6 @@ 
   reverting clean_deleted
   undeleting clean_removed
   undeleting clean_untracked-clean
-  undeleting clean_untracked-revert
   undeleting clean_untracked-wc
   reverting clean_wc
   forgetting missing_deleted
@@ -912,7 +897,6 @@ 
   reverting clean_deleted
   undeleting clean_removed
   undeleting clean_untracked-clean
-  undeleting clean_untracked-revert
   undeleting clean_untracked-wc
   reverting clean_wc
   forgetting missing_deleted
@@ -993,13 +977,8 @@ 
   
   ### revert for: clean_removed
   
-  ### revert for: clean_revert
-  no changes needed to clean_revert
-  
   ### revert for: clean_untracked-clean
   
-  ### revert for: clean_untracked-revert
-  
   ### revert for: clean_untracked-wc
   
   ### revert for: clean_wc
@@ -1012,15 +991,9 @@ 
   ### revert for: missing_removed
   missing_removed: no such file in rev * (glob)
   
-  ### revert for: missing_revert
-  missing_revert: no such file in rev * (glob)
-  
   ### revert for: missing_untracked-clean
   missing_untracked-clean: no such file in rev * (glob)
   
-  ### revert for: missing_untracked-revert
-  missing_untracked-revert: no such file in rev * (glob)
-  
   ### revert for: missing_untracked-wc
   file not managed: missing_untracked-wc
   
@@ -1117,13 +1090,8 @@ 
   
   ### revert for: clean_removed
   
-  ### revert for: clean_revert
-  no changes needed to clean_revert
-  
   ### revert for: clean_untracked-clean
   
-  ### revert for: clean_untracked-revert
-  
   ### revert for: clean_untracked-wc
   
   ### revert for: clean_wc
@@ -1136,15 +1104,9 @@ 
   ### revert for: missing_removed
   missing_removed: no such file in rev * (glob)
   
-  ### revert for: missing_revert
-  missing_revert: no such file in rev * (glob)
-  
   ### revert for: missing_untracked-clean
   missing_untracked-clean: no such file in rev * (glob)
   
-  ### revert for: missing_untracked-revert
-  missing_untracked-revert: no such file in rev * (glob)
-  
   ### revert for: missing_untracked-wc
   file not managed: missing_untracked-wc