Patchwork [10,of,11] test-revert: add case with untracked files with unique content

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 12, 2014, 7:43 p.m.
Message ID <4585e663cd1012a00cdc.1407872630@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5365/
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 1403886319 -7200
#      Fri Jun 27 18:25:19 2014 +0200
# Node ID 4585e663cd1012a00cdcdc91666fdb6f0ad09b95
# Parent  78002ff5ed4c3f223041f989c98d80b0c8fd05c8
test-revert: add case with untracked files with unique content

This test highlights similar misbehavior that its parent changesets.

Patch

diff --git a/tests/test-revert.t b/tests/test-revert.t
--- a/tests/test-revert.t
+++ b/tests/test-revert.t
@@ -459,10 +459,11 @@  Write the python script to disk
   >     'removed': lambda cc: None,
   > }
   > # untracked-X is a version of X where the file is not tracked (? unknown)
   > wccontent['untracked-clean'] = wccontent['clean']
   > wccontent['untracked-revert'] = wccontent['revert']
+  > wccontent['untracked-wc'] = wccontent['wc']
   > 
   > # build the combination of possible state
   > combination = []
   > for ctxkey in ctxcontent:
   >     for wckey in wccontent:
@@ -507,34 +508,39 @@  check list of planned files
   added_clean
   added_removed
   added_revert
   added_untracked-clean
   added_untracked-revert
+  added_untracked-wc
   added_wc
   clean_clean
   clean_removed
   clean_revert
   clean_untracked-clean
   clean_untracked-revert
+  clean_untracked-wc
   clean_wc
   missing_clean
   missing_removed
   missing_revert
   missing_untracked-clean
   missing_untracked-revert
+  missing_untracked-wc
   missing_wc
   modified_clean
   modified_removed
   modified_revert
   modified_untracked-clean
   modified_untracked-revert
+  modified_untracked-wc
   modified_wc
   removed_clean
   removed_removed
   removed_revert
   removed_untracked-clean
   removed_untracked-revert
+  removed_untracked-wc
   removed_wc
 
 Script to make a simple text version of the content
 ---------------------------------------------------
 
@@ -563,41 +569,47 @@  Generate base changeset
   adding clean_clean
   adding clean_removed
   adding clean_revert
   adding clean_untracked-clean
   adding clean_untracked-revert
+  adding clean_untracked-wc
   adding clean_wc
   adding modified_clean
   adding modified_removed
   adding modified_revert
   adding modified_untracked-clean
   adding modified_untracked-revert
+  adding modified_untracked-wc
   adding modified_wc
   adding removed_clean
   adding removed_removed
   adding removed_revert
   adding removed_untracked-clean
   adding removed_untracked-revert
+  adding removed_untracked-wc
   adding removed_wc
   $ hg status
   A clean_clean
   A clean_removed
   A clean_revert
   A clean_untracked-clean
   A clean_untracked-revert
+  A clean_untracked-wc
   A clean_wc
   A modified_clean
   A modified_removed
   A modified_revert
   A modified_untracked-clean
   A modified_untracked-revert
+  A modified_untracked-wc
   A modified_wc
   A removed_clean
   A removed_removed
   A removed_revert
   A removed_untracked-clean
   A removed_untracked-revert
+  A removed_untracked-wc
   A removed_wc
   $ hg commit -m 'base'
 
 (create a simple text version of the content)
 
@@ -606,22 +618,25 @@  Generate base changeset
   base   clean_clean
   base   clean_removed
   base   clean_revert
   base   clean_untracked-clean
   base   clean_untracked-revert
+  base   clean_untracked-wc
   base   clean_wc
   base   modified_clean
   base   modified_removed
   base   modified_revert
   base   modified_untracked-clean
   base   modified_untracked-revert
+  base   modified_untracked-wc
   base   modified_wc
   base   removed_clean
   base   removed_removed
   base   removed_revert
   base   removed_untracked-clean
   base   removed_untracked-revert
+  base   removed_untracked-wc
   base   removed_wc
 
 Create parent changeset
 
   $ python ../gen-revert-cases.py parent
@@ -629,35 +644,40 @@  Create parent changeset
   adding added_clean
   adding added_removed
   adding added_revert
   adding added_untracked-clean
   adding added_untracked-revert
+  adding added_untracked-wc
   adding added_wc
   removing removed_clean
   removing removed_removed
   removing removed_revert
   removing removed_untracked-clean
   removing removed_untracked-revert
+  removing removed_untracked-wc
   removing removed_wc
   $ hg status
   M modified_clean
   M modified_removed
   M modified_revert
   M modified_untracked-clean
   M modified_untracked-revert
+  M modified_untracked-wc
   M modified_wc
   A added_clean
   A added_removed
   A added_revert
   A added_untracked-clean
   A added_untracked-revert
+  A added_untracked-wc
   A added_wc
   R removed_clean
   R removed_removed
   R removed_revert
   R removed_untracked-clean
   R removed_untracked-revert
+  R removed_untracked-wc
   R removed_wc
   $ hg commit -m 'parent'
 
 (create a simple text version of the content)
 
@@ -666,36 +686,41 @@  Create parent changeset
   parent added_clean
   parent added_removed
   parent added_revert
   parent added_untracked-clean
   parent added_untracked-revert
+  parent added_untracked-wc
   parent added_wc
   base   clean_clean
   base   clean_removed
   base   clean_revert
   base   clean_untracked-clean
   base   clean_untracked-revert
+  base   clean_untracked-wc
   base   clean_wc
   parent modified_clean
   parent modified_removed
   parent modified_revert
   parent modified_untracked-clean
   parent modified_untracked-revert
+  parent modified_untracked-wc
   parent modified_wc
 
 Setup working directory
 
   $ python ../gen-revert-cases.py wc | cat
   $ hg addremove --similarity 0
   removing added_removed
   removing added_revert
   removing added_untracked-revert
   removing clean_removed
+  adding missing_untracked-wc
   adding missing_wc
   removing modified_removed
   adding removed_revert
   adding removed_untracked-revert
+  adding removed_untracked-wc
   adding removed_wc
   $ hg forget *untracked*
   $ hg status
   M added_wc
   M clean_wc
@@ -706,17 +731,22 @@  Setup working directory
   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
   R clean_untracked-revert
+  R clean_untracked-wc
   R modified_removed
   R modified_untracked-clean
   R modified_untracked-revert
+  R modified_untracked-wc
+  ? missing_untracked-wc
   ? removed_untracked-revert
+  ? removed_untracked-wc
 
   $ hg status --rev 'desc("base")'
   M clean_wc
   M modified_clean
   M modified_wc
@@ -725,38 +755,47 @@  Setup working directory
   A added_wc
   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
   R modified_untracked-revert
+  R modified_untracked-wc
   R removed_clean
   R removed_removed
   R removed_untracked-clean
   R removed_untracked-revert
+  R removed_untracked-wc
+  ? missing_untracked-wc
 
 (create a simple text version of the content)
 
   $ python ../dircontent.py > ../content-wc.txt
   $ cat ../content-wc.txt
   parent added_clean
   parent added_untracked-clean
+  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
   wc     missing_wc
   parent modified_clean
   base   modified_revert
   parent modified_untracked-clean
   base   modified_untracked-revert
+  wc     modified_untracked-wc
   wc     modified_wc
   base   removed_revert
   base   removed_untracked-revert
+  wc     removed_untracked-wc
   wc     removed_wc
 
   $ cd ..
 
 Test revert --all to parent content
@@ -772,20 +811,23 @@  check revert output
   $ hg revert --all
   undeleting added_removed
   undeleting added_revert
   undeleting added_untracked-clean
   undeleting added_untracked-revert
+  undeleting added_untracked-wc
   reverting added_wc
   undeleting clean_removed
   undeleting clean_untracked-clean
   undeleting clean_untracked-revert
+  undeleting clean_untracked-wc
   reverting clean_wc
   forgetting missing_wc
   undeleting modified_removed
   reverting modified_revert
   undeleting modified_untracked-clean
   undeleting modified_untracked-revert
+  undeleting modified_untracked-wc
   reverting modified_wc
   forgetting removed_revert
   forgetting removed_wc
 
 Compare resulting directory with revert target.
@@ -794,18 +836,23 @@  The diff is filtered to include change o
 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 _
+  +wc     added_untracked-wc.orig
   +wc     added_wc.orig
+  +wc     clean_untracked-wc.orig
   +wc     clean_wc.orig
+  +wc     missing_untracked-wc
   +wc     missing_wc
   +base   modified_revert.orig
   +base   modified_untracked-revert.orig
+  +wc     modified_untracked-wc.orig
   +wc     modified_wc.orig
   +base   removed_revert
   +base   removed_untracked-revert
+  +wc     removed_untracked-wc
   +wc     removed_wc
 
 Test revert --all to "base" content
 -----------------------------------
 
@@ -827,23 +874,26 @@  Misbehavior:
   removing added_clean
   removing added_wc
   undeleting clean_removed
   undeleting clean_untracked-clean
   undeleting clean_untracked-revert
+  undeleting clean_untracked-wc
   reverting clean_wc
   forgetting missing_wc
   reverting modified_clean
   undeleting modified_removed
   reverting modified_revert
   undeleting modified_untracked-clean
   undeleting modified_untracked-revert
+  undeleting modified_untracked-wc
   reverting modified_wc
   adding removed_clean
   adding removed_removed
   reverting removed_revert
   adding removed_untracked-clean
   adding removed_untracked-revert
+  adding removed_untracked-wc
   reverting removed_wc
 
 Compare resulting directory with revert target.
 
 The diff is filtered to include change only. The only difference should be
@@ -856,14 +906,19 @@  Misbehavior:
 
   $ python ../dircontent.py > ../content-base-all.txt
   $ cd ..
   $ diff -U 0 -- content-base.txt content-base-all.txt | grep _
   +parent added_untracked-clean
+  +wc     added_untracked-wc
+  +wc     clean_untracked-wc.orig
   +wc     clean_wc.orig
+  +wc     missing_untracked-wc
   +wc     missing_wc
   +parent modified_untracked-clean.orig
+  +wc     modified_untracked-wc.orig
   +wc     modified_wc.orig
+  +wc     removed_untracked-wc.orig
   +wc     removed_wc.orig
 
 Test revert to parent content with explicit file name
 -----------------------------------------------------
 
@@ -889,10 +944,12 @@  revert all files individually and check 
   
   ### revert for: added_untracked-clean
   
   ### revert for: added_untracked-revert
   
+  ### revert for: added_untracked-wc
+  
   ### revert for: added_wc
   
   ### revert for: clean_clean
   no changes needed to clean_clean
   
@@ -903,10 +960,12 @@  revert all files individually and check 
   
   ### revert for: clean_untracked-clean
   
   ### revert for: clean_untracked-revert
   
+  ### revert for: clean_untracked-wc
+  
   ### revert for: clean_wc
   
   ### revert for: missing_clean
   missing_clean: no such file in rev * (glob)
   
@@ -920,10 +979,13 @@  revert all files individually and check 
   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
+  
   ### revert for: missing_wc
   
   ### revert for: modified_clean
   no changes needed to modified_clean
   
@@ -933,10 +995,12 @@  revert all files individually and check 
   
   ### revert for: modified_untracked-clean
   
   ### revert for: modified_untracked-revert
   
+  ### revert for: modified_untracked-wc
+  
   ### revert for: modified_wc
   
   ### revert for: removed_clean
   removed_clean: no such file in rev * (glob)
   
@@ -949,10 +1013,13 @@  revert all files individually and check 
   removed_untracked-clean: no such file in rev * (glob)
   
   ### revert for: removed_untracked-revert
   file not managed: removed_untracked-revert
   
+  ### revert for: removed_untracked-wc
+  file not managed: removed_untracked-wc
+  
   ### revert for: removed_wc
   
 
 check resulting directory againt the --all run
 (There should be no difference)
@@ -983,10 +1050,11 @@  Misbehavior:
 | - modified_revert
 | - removed_revert
 | - added_removed
 | - added_untracked-clean
 | - added_untracked-revert
+| - added_untracked-wc
 
   $ for file in `python ../gen-revert-cases.py filelist`; do
   >   echo '### revert for:' $file;
   >   hg revert $file --rev 'desc(base)';
   >   echo
@@ -999,10 +1067,12 @@  Misbehavior:
   
   ### revert for: added_untracked-clean
   
   ### revert for: added_untracked-revert
   
+  ### revert for: added_untracked-wc
+  
   ### revert for: added_wc
   
   ### revert for: clean_clean
   
   ### revert for: clean_removed
@@ -1011,10 +1081,12 @@  Misbehavior:
   
   ### revert for: clean_untracked-clean
   
   ### revert for: clean_untracked-revert
   
+  ### revert for: clean_untracked-wc
+  
   ### revert for: clean_wc
   
   ### revert for: missing_clean
   missing_clean: no such file in rev * (glob)
   
@@ -1028,10 +1100,13 @@  Misbehavior:
   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
+  
   ### revert for: missing_wc
   
   ### revert for: modified_clean
   
   ### revert for: modified_removed
@@ -1040,10 +1115,12 @@  Misbehavior:
   
   ### revert for: modified_untracked-clean
   
   ### revert for: modified_untracked-revert
   
+  ### revert for: modified_untracked-wc
+  
   ### revert for: modified_wc
   
   ### revert for: removed_clean
   
   ### revert for: removed_removed
@@ -1052,10 +1129,12 @@  Misbehavior:
   
   ### revert for: removed_untracked-clean
   
   ### revert for: removed_untracked-revert
   
+  ### revert for: removed_untracked-wc
+  
   ### revert for: removed_wc
   
 
 check resulting directory againt the --all run
 (There should be no difference)