# HG changeset patch # User Greg Ward # Date 1241445708 14400 # Node ID e1128a2f8bd16db9721abd5c0d730c5b9a13c6d5 # Parent 218840e367549f03c68a9754b07be6fec56e5ff9 Add test for dumps generated by cvs2git. diff -r 218840e36754 -r e1128a2f8bd1 tests/test-fastimport-cvs2git --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-fastimport-cvs2git Mon May 04 10:01:48 2009 -0400 @@ -0,0 +1,93 @@ +#!/bin/sh + +# Test a dump of the style created by cvs2git. Notable features: +# - the dump is in two files: all the file data (blobs) in one, +# and everything else (i.e. commit metadata) in the other + +# The initial CVS repository was created like this: +# mkdir t && cd t +# export CVSROOT=$PWD/repo +# cvs init +# mkdir repo/proj +# cvs co proj +# cd proj +# echo "hello there" > foo.txt +# echo "ooga booga" > ooga +# cvs add foo.txt ooga +# cvs ci -m"initial revision" +# echo "woof woof\nooga booga\nblah blah" > ooga +# cvs ci -m"modify" +# +# Then I generated the dumps with +# cvs2git --options cvs2git.options +# +# where cvs2git.options was a copy of cvs2git-example.options +# from the trunk of cvs2svn, modified to point the CVS repo +# I just created. + +. $TESTDIR/fastimport-common + +cat > git-blob.dat < git-dump.dat < 1200000000 +0000 +data 17 +initial revision + +M 100644 :1 foo.txt +M 100644 :3 ooga + +commit refs/heads/master +mark :1000000001 +committer example 1200000060 +0000 +data 7 +modify + +M 100644 :2 ooga + +EOF + +echo "% import cvs2git dumps" +hg init simplecvs +hg -R simplecvs fastimport git-blob.dat git-dump.dat + +# Inspecting the hg repository is identical to test-fastimport-git. +echo "% log" +cd simplecvs +hg glog -v + +echo "% manifest at rev 0" +hg manifest -r0 + +echo "% manifest at rev 1" +hg manifest -r1 + +echo "% cat foo.txt at rev 0" +hg cat -r0 foo.txt +echo "% cat foo.txt at rev 1" +hg cat -r1 foo.txt + +echo "% cat ooga at rev 0" +hg cat -r0 ooga +echo "% cat ooga at rev 1" +hg cat -r1 ooga diff -r 218840e36754 -r e1128a2f8bd1 tests/test-fastimport-cvs2git.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-fastimport-cvs2git.out Mon May 04 10:01:48 2009 -0400 @@ -0,0 +1,42 @@ +% import cvs2git dumps +Reading source: git-blob.dat +Reading source: git-dump.dat +0 files updated, 0 files merged, 0 files removed, 0 files unresolved +Done commit of rev 0 +2 files updated, 0 files merged, 0 files removed, 0 files unresolved +Done commit of rev 1 +Removing blob dir '/home/greg/src/hg-fastimport/tests/tmp/simplecvs/.hg/blobs' ... +% log +@ changeset: 1:be20ff2863a5 +| tag: tip +| user: example +| date: Thu Jan 10 21:21:00 2008 +0000 +| files: ooga +| description: +| modify +| +| +o changeset: 0:5bb45e163687 + user: example + date: Thu Jan 10 21:20:00 2008 +0000 + files: foo.txt ooga + description: + initial revision + + +% manifest at rev 0 +foo.txt +ooga +% manifest at rev 1 +foo.txt +ooga +% cat foo.txt at rev 0 +hello there +% cat foo.txt at rev 1 +hello there +% cat ooga at rev 0 +ooga booga +% cat ooga at rev 1 +woof woof +ooga booga +blah blah