Patchwork [4,of,5] test-status-rev: use common script for generating file history

login
register
mail settings
Submitter Martin von Zweigbergk
Date Nov. 5, 2014, 5:39 a.m.
Message ID <c537f54c03a3681b3ab8.1415165972@handduk2.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6570/
State Accepted
Headers show

Comments

Martin von Zweigbergk - Nov. 5, 2014, 5:39 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1415146192 28800
#      Tue Nov 04 16:09:52 2014 -0800
# Node ID c537f54c03a3681b3ab8473563db593d04aa1997
# Parent  7129e77eb6a906c504a947d5a13a8952222975b6
test-status-rev: use common script for generating file history

Start using the generate-working-copy-states.py script that's shared
with test-revert.t, instead of creating the states manually in the
test. This adds several states that are currently missing. We will
start checking those states later.

Patch

diff --git a/tests/test-status-rev.t b/tests/test-status-rev.t
--- a/tests/test-status-rev.t
+++ b/tests/test-status-rev.t
@@ -8,55 +8,64 @@ 
 
 First commit
 
-  $ echo a >content1_content1_content1-tracked
-  $ echo a >content1_content1_missing-tracked
-  $ echo a >content1_content1_content1-untracked
-  $ echo a >content1_content1_content3-tracked
-  $ echo a >content1_content1_missing-untracked
-  $ echo a >content1_content2_content2-tracked
-  $ echo a >content1_content2_missing-tracked
-  $ echo a >content1_content2_content2-untracked
-  $ echo a >content1_content2_content3-tracked
-  $ echo a >content1_content2_missing-untracked
-  $ echo a >content1_missing_content3-tracked
-  $ echo a >content1_missing_missing-tracked
-  $ echo a >content1_missing_content3-untracked
-  $ hg commit -Aqm first
+  $ python $TESTDIR/generate-working-copy-states.py base
+  $ hg addremove --similarity 0
+  adding content1_content1_content1-tracked
+  adding content1_content1_content1-untracked
+  adding content1_content1_content3-tracked
+  adding content1_content1_content3-untracked
+  adding content1_content1_missing-tracked
+  adding content1_content1_missing-untracked
+  adding content1_content2_content1-tracked
+  adding content1_content2_content1-untracked
+  adding content1_content2_content2-tracked
+  adding content1_content2_content2-untracked
+  adding content1_content2_content3-tracked
+  adding content1_content2_content3-untracked
+  adding content1_content2_missing-tracked
+  adding content1_content2_missing-untracked
+  adding content1_missing_content1-tracked
+  adding content1_missing_content1-untracked
+  adding content1_missing_content3-tracked
+  adding content1_missing_content3-untracked
+  adding content1_missing_missing-tracked
+  adding content1_missing_missing-untracked
+  $ hg commit -m first
 
 Second commit
 
-  $ echo b >missing_content2_missing-tracked
-  $ echo b >missing_content2_content2-untracked
-  $ echo b >missing_content2_content3-tracked
-  $ echo b >missing_content2_missing-untracked
-  $ echo b >content1_content2_content2-tracked
-  $ echo b >content1_content2_content3-tracked
-  $ echo b >content1_content2_content2-untracked
-  $ echo b >content1_content2_content3-tracked
-  $ echo b >content1_content2_missing-untracked
-  $ hg rm content1_missing_content3-tracked
-  $ hg rm content1_missing_missing-tracked
-  $ hg rm content1_missing_content3-untracked
-  $ hg commit -Aqm second
+  $ python $TESTDIR/generate-working-copy-states.py parent
+  $ hg addremove --similarity 0
+  removing content1_missing_content1-tracked
+  removing content1_missing_content1-untracked
+  removing content1_missing_content3-tracked
+  removing content1_missing_content3-untracked
+  removing content1_missing_missing-tracked
+  removing content1_missing_missing-untracked
+  adding missing_content2_content2-tracked
+  adding missing_content2_content2-untracked
+  adding missing_content2_content3-tracked
+  adding missing_content2_content3-untracked
+  adding missing_content2_missing-tracked
+  adding missing_content2_missing-untracked
+  $ hg commit -m second
 
 Working copy
 
-  $ echo c >content1_content1_content3-tracked
-  $ echo c >content1_content2_content3-tracked
-  $ echo c >missing_content2_content3-tracked
-  $ echo c >content1_missing_content3-tracked && hg add content1_missing_content3-tracked
-  $ echo c >content1_missing_missing-tracked && hg add content1_missing_missing-tracked && rm content1_missing_missing-tracked
-  $ echo c >content1_missing_content3-untracked
-  $ hg rm content1_content2_missing-untracked
-  $ hg rm content1_content1_missing-untracked
-  $ hg rm missing_content2_missing-untracked
-  $ rm content1_content1_missing-tracked
-  $ rm content1_content2_missing-tracked
-  $ rm missing_content2_missing-tracked
-  $ hg forget content1_content1_content1-untracked
-  $ hg forget content1_content2_content2-untracked
-  $ hg forget missing_content2_content2-untracked
-  $ touch missing_missing_content3-untracked
+  $ python $TESTDIR/generate-working-copy-states.py wc
+  $ hg addremove --similarity 0
+  adding content1_missing_content1-tracked
+  adding content1_missing_content1-untracked
+  adding content1_missing_content3-tracked
+  adding content1_missing_content3-untracked
+  adding content1_missing_missing-tracked
+  adding content1_missing_missing-untracked
+  adding missing_missing_content3-tracked
+  adding missing_missing_content3-untracked
+  adding missing_missing_missing-tracked
+  adding missing_missing_missing-untracked
+  $ hg forget *_*_*-untracked
+  $ rm *_*_missing-*
 
 Status compared to one revision back