diff tests/test-convert-cvs-synthetic @ 8249:2c7c973c2abd

Reproduce crash where synthetic revs break merge detection (issue1578). (The fix for this was committed as 9bbcfa898cd3.) Slightly edited by Patrick Mezard <pmezard@gmail.com>
author Greg Ward <greg-hg@gerg.ca>
date Sat, 18 Apr 2009 13:29:48 -0400
parents 6c3b8132078e
children 1f0f01bc86a5
line wrap: on
line diff
--- a/tests/test-convert-cvs-synthetic	Wed Apr 29 21:48:59 2009 +0200
+++ b/tests/test-convert-cvs-synthetic	Sat Apr 18 13:29:48 2009 -0400
@@ -7,6 +7,7 @@
 
 echo "[extensions]" >> $HGRCPATH
 echo "convert = " >> $HGRCPATH
+echo "graphlog = " >> $HGRCPATH
 echo "[convert]" >> $HGRCPATH
 echo "cvsps=builtin" >> $HGRCPATH
 
@@ -51,10 +52,10 @@
 cvscall -q tag -b v1_1
 
 echo % create file2 on branch v1_0
-cvscall -q up -rv1_0
+cvscall -Q up -rv1_0
 touch file2
 cvscall -Q add file2
-cvsci -m"add file2 on branch v1_0" file2
+cvsci -m"add file2" file2
 
 echo % create file3, file4 on branch v1_1
 cvscall -Q up -rv1_1
@@ -64,15 +65,54 @@
 cvsci -m"add file3, file4 on branch v1_1" file3 file4
 
 echo % merge file2 from v1_0 to v1_1
-cvscall -q up -jv1_0
-cvsci -m"merge file2 from v1_0 to v1_1"
+cvscall -Q up -jv1_0
+cvsci -m"MERGE from v1_0: add file2"
+
+# Step things up a notch: now we make the history really hairy, with
+# changes bouncing back and forth between trunk and v1_2 and merges
+# going both ways.  (I.e., try to model the real world.)
+
+echo "% create branch v1_2"
+cvscall -Q up -A
+cvscall -q tag -b v1_2
+
+echo "% create file5 on branch v1_2"
+cvscall -Q up -rv1_2
+touch file5
+cvs -Q add file5
+cvsci -m"add file5 on v1_2"
+
+echo "% create file6 on trunk post-v1_2"
+cvscall -Q up -A
+touch file6
+cvscall -Q add file6
+cvsci -m"add file6 on trunk post-v1_2"
+
+echo "% merge file5 from v1_2 to trunk"
+cvscall -Q up -A
+cvscall -Q up -jv1_2 file5
+cvsci -m"MERGE from v1_2: add file5"
+
+echo "% merge file6 from trunk to v1_2"
+cvscall -Q up -rv1_2
+cvscall up -jHEAD file6
+cvsci -m"MERGE from HEAD: add file6"
 
 echo % cvs rlog output
 filterpath cvscall -q rlog proj | egrep '^(RCS file|revision)'
 
-echo % convert to hg
+echo "% convert to hg (#1)"
 cd ..
-filterpath hg convert proj proj.hg
+filterpath hg convert --datesort proj proj.hg
+
+echo "% hg glog output (#1)"
+hg -R proj.hg glog --template "{rev} {desc}\n"
 
-echo % hg log output
-hg -R proj.hg log --template "{rev} {desc}\n"
+echo "% convert to hg (#2: with merge detection)"
+filterpath hg convert \
+  --config convert.cvsps.mergefrom="\"^MERGE from (\S+):\"" \
+  --datesort \
+  proj proj.hg2
+
+echo "% hg glog output (#2)"
+hg -R proj.hg2 glog --template "{rev} {desc}\n"