[PATCH 4 of 4 STABLE] icasefs: enhance test to prevent regression by changes in the future

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Mon Apr 29 16:01:52 CDT 2013


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1367265692 -32400
#      Tue Apr 30 05:01:32 2013 +0900
# Branch stable
# Node ID 0f2a179cdb0c18e30fd5556a5316c370cb02a8f1
# Parent  01f3680a8dcad4da62259c6521a3855759c7e909
icasefs: enhance test to prevent regression by changes in the future

This patch adds steps to test case-folding collision detection on the
revision tree built up in the order different from the one reproducing
issue3452.

This may prevent regression by changes around "copy detection" and/or
"case-folding collision detection" logic in the future.

diff --git a/tests/test-casecollision-merge.t b/tests/test-casecollision-merge.t
--- a/tests/test-casecollision-merge.t
+++ b/tests/test-casecollision-merge.t
@@ -16,6 +16,8 @@
 
   $ echo a > a
   $ hg add a
+  $ echo b > b
+  $ hg add b
   $ hg commit -m '#0'
   $ hg tag -l A
   $ hg rename a tmp
@@ -33,6 +35,7 @@
   $ hg status -A
   M A
   R a
+  C b
   C x
 
   $ hg update -q --clean 1
@@ -40,6 +43,7 @@
   $ hg status -A
   M x
   C A
+  C b
   $ hg commit -m '(D)'
   $ hg tag -l D
 
@@ -64,6 +68,7 @@
 
   $ hg update -q --clean C
   $ echo "modify 'a' at (E)" > a
+  $ echo "modify 'b' at (E)" > b
   $ hg commit -m '(E)'
   created new head
   $ hg tag -l E
@@ -77,10 +82,45 @@
   $ hg status -A
   M A
     a
+  M b
   C x
   $ cat A
   modify 'a' at (E)
 
+test also the case that (B) is recorded after (C), to prevent
+regression by changes in the future.
+
+to avoid unexpected (successful) behavior by filelog unification,
+target file is not 'a'/'A' but 'b'/'B' in this case.
+
+  $ hg update -q --clean A
+  $ hg rename b tmp
+  $ hg rename tmp B
+  $ hg commit -m '(B1)'
+  created new head
+  $ hg tag -l B1
+
+  $ hg merge -q C
+  $ hg status -A
+  M x
+  C B
+  C a
+  $ hg commit -m '(D1)'
+  $ hg tag -l D1
+
+  $ echo "modify 'B' at (F1)" > B
+  $ hg commit -m '(F1)'
+  $ hg tag -l F1
+
+  $ hg merge -q --tool internal:other E
+  $ hg status -A
+  M B
+    b
+  M a
+  C x
+  $ cat B
+  modify 'b' at (E)
+
   $ cd ..
 
 (2) colliding file is not related to collided file


More information about the Mercurial-devel mailing list