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

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 12, 2014, 7:43 p.m.
Message ID <8d1d22316d6e18ad40aa.1407872623@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5359/
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 1403884876 -7200
#      Fri Jun 27 18:01:16 2014 +0200
# Node ID 8d1d22316d6e18ad40aa1c467c364670f7d623ab
# Parent  03f2b5753e93e126d143e8cfacc31c193299d7b9
test-revert: add case where the file is removed between "base" and "parent"

Patch

diff --git a/tests/test-revert.t b/tests/test-revert.t
--- a/tests/test-revert.t
+++ b/tests/test-revert.t
@@ -439,10 +439,12 @@  Write the python script to disk
   >     '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'],
+  >     # removed: file exist in base but is removed from parent
+  >     'removed': ['base', None],
   > }
   > 
   > # content of file in working copy
   > wccontent = {
   >     # clean: wc content is the same as parent
@@ -492,10 +494,11 @@  check list of planned files
 
   $ python gen-revert-cases.py filelist
   added_clean
   clean_clean
   modified_clean
+  removed_clean
 
 Script to make a simple text version of the content
 ---------------------------------------------------
 
   $ cat << EOF >> dircontent.py
@@ -520,30 +523,35 @@  Generate base changeset
 
   $ python ../gen-revert-cases.py base
   $ hg addremove --similarity 0
   adding clean_clean
   adding modified_clean
+  adding removed_clean
   $ hg status
   A clean_clean
   A modified_clean
+  A removed_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
+  base   removed_clean
 
 Create parent changeset
 
   $ python ../gen-revert-cases.py parent
   $ hg addremove --similarity 0
   adding added_clean
+  removing removed_clean
   $ hg status
   M modified_clean
   A added_clean
+  R removed_clean
   $ hg commit -m 'parent'
 
 (create a simple text version of the content)
 
   $ python ../dircontent.py > ../content-parent.txt
@@ -559,10 +567,11 @@  Setup working directory
   $ hg status
 
   $ hg status --rev 'desc("base")'
   M modified_clean
   A added_clean
+  R removed_clean
 
 (create a simple text version of the content)
 
   $ python ../dircontent.py > ../content-wc.txt
   $ cat ../content-wc.txt
@@ -605,10 +614,11 @@  Test revert --all to "base" content
 check revert output
 
   $ hg revert --all --rev 'desc(base)'
   removing added_clean
   reverting modified_clean
+  adding removed_clean
 
 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.
@@ -641,10 +651,13 @@  revert all files individually and check 
   no changes needed to clean_clean
   
   ### revert for: modified_clean
   no changes needed to modified_clean
   
+  ### revert for: removed_clean
+  removed_clean: no such file in rev * (glob)
+  
 
 check resulting directory againt the --all run
 (There should be no difference)
 
   $ python ../dircontent.py > ../content-parent-explicit.txt
@@ -678,10 +691,12 @@  Misbehavior:
   
   ### revert for: clean_clean
   
   ### revert for: modified_clean
   
+  ### revert for: removed_clean
+  
 
 check resulting directory againt the --all run
 (There should be no difference)
 
   $ python ../dircontent.py > ../content-base-explicit.txt