changeset 5413:719fd175181f

Test darcs converter
author Patrick Mezard <pmezard@gmail.com>
date Sun, 07 Oct 2007 19:03:32 +0200
parents fbf40ad5a8c2
children eb58722d282f
files tests/test-convert-darcs tests/test-convert-darcs.out
diffstat 2 files changed, 83 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-darcs	Sun Oct 07 19:03:32 2007 +0200
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+"$TESTDIR/hghave" darcs || exit 80
+
+echo "[extensions]" >> $HGRCPATH
+echo "convert=" >> $HGRCPATH
+echo 'hgext.graphlog =' >> $HGRCPATH
+
+DARCS_EMAIL='test@example.org'; export DARCS_EMAIL
+
+echo % initialize darcs repo
+mkdir darcs-repo
+cd darcs-repo
+darcs init
+echo a > a
+darcs record -a -l -m p0
+cd ..
+
+echo % branch and update
+darcs get darcs-repo darcs-clone
+cd darcs-clone
+echo c >> a
+echo c > c
+darcs record -a -l -m p1.1
+cd ..
+
+echo % update source
+cd darcs-repo
+echo b >> a
+echo b > b
+darcs record -a -l -m p1.2
+
+echo % merge branch
+darcs pull -a ../darcs-clone
+echo e > a
+darcs record -a -l -m p2
+cd ..
+
+glog()
+{
+    hg glog --template '#rev# "#desc|firstline#" files: #files#\n' "$@"
+}
+
+hg convert darcs-repo darcs-repo-hg
+# The converter does not currently handle patch conflicts very well.
+# When they occur, it reverts *all* changes and moves forward,
+# letting the conflict resolving patch fix collisions.
+# Unfortunately, non-conflicting changes, like the addition of the
+# "c" file in p1.1 patch are reverted too.
+# Just to say that manifest not listing "c" here is a bug.
+glog -R darcs-repo-hg
+hg -R darcs-repo-hg manifest --debug
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-darcs.out	Sun Oct 07 19:03:32 2007 +0200
@@ -0,0 +1,31 @@
+% initialize darcs repo
+Finished recording patch 'p0'
+% branch and update
+
Copying patch 1 of 1...
Copying patch 1 of 1... done.
+Finished getting.
+Finished recording patch 'p1.1'
+% update source
+Finished recording patch 'p1.2'
+% merge branch
+We have conflicts in the following files:
+./a
+Finished pulling and applying.
+Finished recording patch 'p2'
+initializing destination darcs-repo-hg repository
+scanning source...
+sorting...
+converting...
+3 p0
+2 p1.2
+1 p1.1
+0 p2
+o  3 "p2" files: a
+|
+o  2 "p1.1" files:
+|
+o  1 "p1.2" files: a b
+|
+o  0 "p0" files: a
+
+7225b30cdf38257d5cc7780772c051b6f33e6d6b 644   a
+1e88685f5ddec574a34c70af492f95b6debc8741 644   b