Patchwork [4,of,5] test-revert: reverting an addition is the same as removing

login
register
mail settings
Submitter Martin von Zweigbergk
Date Nov. 2, 2014, 10:19 p.m.
Message ID <30e5bc8a6c066e65fca7.1414966772@handduk2.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6547/
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 1413531566 25200
#      Fri Oct 17 00:39:26 2014 -0700
# Branch stable
# Node ID 30e5bc8a6c066e65fca7f9384ab9d8669109969b
# Parent  29b7d0411f3853be4419916d4d96609aca3dc9f9
test-revert: reverting an addition is the same as removing

The tests for added_revert and added_untracked-revert test the same
state as added_deleted and added_removed, respectively. Drop the
duplicate tests.

Patch

diff --git a/tests/test-revert.t b/tests/test-revert.t
--- a/tests/test-revert.t
+++ b/tests/test-revert.t
@@ -470,6 +470,8 @@ 
   >     for wckey in wccontent:
   >         if (ctxvalue[0] == ctxvalue[1] and 'revert' in wckey):
   >             continue
+  >         if not ctxvalue[0] and 'revert' in wckey:
+  >             continue
   >         filename = "%s_%s" % (ctxkey, wckey)
   >         combination.append((filename, ctxkey, wckey))
   > 
@@ -511,9 +513,7 @@ 
   added_clean
   added_deleted
   added_removed
-  added_revert
   added_untracked-clean
-  added_untracked-revert
   added_untracked-wc
   added_wc
   clean_clean
@@ -651,9 +651,7 @@ 
   adding added_clean
   adding added_deleted
   adding added_removed
-  adding added_revert
   adding added_untracked-clean
-  adding added_untracked-revert
   adding added_untracked-wc
   adding added_wc
   removing removed_clean
@@ -676,9 +674,7 @@ 
   A added_clean
   A added_deleted
   A added_removed
-  A added_revert
   A added_untracked-clean
-  A added_untracked-revert
   A added_untracked-wc
   A added_wc
   R removed_clean
@@ -698,9 +694,7 @@ 
   parent added_clean
   parent added_deleted
   parent added_removed
-  parent added_revert
   parent added_untracked-clean
-  parent added_untracked-revert
   parent added_untracked-wc
   parent added_wc
   base   clean_clean
@@ -723,8 +717,6 @@ 
   $ python ../gen-revert-cases.py wc
   $ hg addremove --similarity 0
   removing added_removed
-  removing added_revert
-  removing added_untracked-revert
   removing clean_removed
   adding missing_deleted
   adding missing_untracked-wc
@@ -746,9 +738,7 @@ 
   A removed_revert
   A removed_wc
   R added_removed
-  R added_revert
   R added_untracked-clean
-  R added_untracked-revert
   R added_untracked-wc
   R clean_removed
   R clean_untracked-clean
@@ -834,9 +824,7 @@ 
   $ hg revert --all
   reverting added_deleted
   undeleting added_removed
-  undeleting added_revert
   undeleting added_untracked-clean
-  undeleting added_untracked-revert
   undeleting added_untracked-wc
   reverting added_wc
   reverting clean_deleted
@@ -960,12 +948,8 @@ 
   
   ### revert for: added_removed
   
-  ### revert for: added_revert
-  
   ### revert for: added_untracked-clean
   
-  ### revert for: added_untracked-revert
-  
   ### revert for: added_untracked-wc
   
   ### revert for: added_wc
@@ -1069,15 +1053,9 @@ 
   ### revert for: added_removed
   no changes needed to added_removed
   
-  ### revert for: added_revert
-  no changes needed to added_revert
-  
   ### revert for: added_untracked-clean
   no changes needed to added_untracked-clean
   
-  ### revert for: added_untracked-revert
-  no changes needed to added_untracked-revert
-  
   ### revert for: added_untracked-wc
   no changes needed to added_untracked-wc