Mercurial > hg > hg-fastimport
changeset 45:783890f8a6fb
Test that my idealized version of cvs2git's output produces identical output.
| author | Greg Ward <greg-hg@gerg.ca> |
|---|---|
| date | Mon, 11 May 2009 17:55:57 -0400 |
| parents | 61ff7b929cea |
| children | 93c2b1e832bd |
| files | tests/test-fastimport-cvs2git-fixup tests/test-fastimport-cvs2git-fixup.out |
| diffstat | 2 files changed, 96 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-fastimport-cvs2git-fixup Mon May 11 17:46:19 2009 -0400 +++ b/tests/test-fastimport-cvs2git-fixup Mon May 11 17:55:57 2009 -0400 @@ -116,24 +116,32 @@ M 100644 :11363 main.cpp EOF -echo "% import cvs2git with branch/tag" -set -e -hg init realcvs -hg -R realcvs fastimport git-blob.dat git-dump-1.dat \ - | sed "s|$HGTMP|HGTMP|g" - -echo "% hg glog" -cd realcvs -template="rev: {rev}\nauthor: {author}\nbranch: '{branches}' tags: {tags}\nfiles: {files}\ndesc: {desc}\n\n" -hg glog -v --template="$template" +# Test that both dumps work (they should produce identical output). +#for dump in git-dump-1.dat git-dump-2.dat; do +for i in 1 2 ; do + dump=git-dump-$i.dat + echo "----------------------------------------" + echo "% import $dump" + set -e + repo=realcvs.$i + hg init $repo + hg -R $repo fastimport git-blob.dat $dump \ + | sed "s|$HGTMP|HGTMP|g" -echo "% hg branches" -# Exclude default since its changeset ID is different with every run. -# (Same thing with tags and tip below.) -hg branches | grep -v "^default" + echo "% hg glog ($dump)" + cd $repo + template="rev: {rev}\nauthor: {author}\nbranch: '{branches}' tags: {tags}\nfiles: {files}\ndesc: {desc}\n\n" + hg glog -v --template="$template" -echo "% hg heads -v" -hg heads --template="$template" + echo "% hg branches ($dump)" + # Exclude default since its changeset ID is different with every run. + # (Same thing with tags and tip below.) + hg branches | grep -v "^default" -echo "% hg tags -v" -hg tags | grep -v "^tip" + echo "% hg heads -v ($dump)" + hg heads --template="$template" + + echo "% hg tags -v ($dump)" + hg tags | grep -v "^tip" + cd .. +done
--- a/tests/test-fastimport-cvs2git-fixup.out Mon May 11 17:46:19 2009 -0400 +++ b/tests/test-fastimport-cvs2git-fixup.out Mon May 11 17:55:57 2009 -0400 @@ -1,4 +1,5 @@ -% import cvs2git with branch/tag +---------------------------------------- +% import git-dump-1.dat Reading source: git-blob.dat Reading source: git-dump-1.dat 0 files updated, 0 files merged, 0 files removed, 0 files unresolved @@ -11,8 +12,8 @@ Done commit of rev 3 updating tags 1 files updated, 0 files merged, 0 files removed, 0 files unresolved -Removing blob dir 'HGTMP/test-fastimport-cvs2git-fixup/realcvs/.hg/blobs' ... -% hg glog +Removing blob dir 'HGTMP/test-fastimport-cvs2git-fixup/realcvs.1/.hg/blobs' ... +% hg glog (git-dump-1.dat) @ rev: 4 | author: convert-repo | branch: '' tags: tip @@ -43,9 +44,9 @@ files: Makefile desc: added Makefile -% hg branches +% hg branches (git-dump-1.dat) REL-2-2-3 2:9c706dffba0e -% hg heads -v +% hg heads -v (git-dump-1.dat) rev: 4 author: convert-repo branch: '' tags: tip @@ -58,5 +59,68 @@ files: Tools/Debug/C++/DebugCpp.doxygen desc: create tag 'REL-2-2-3-P1' (manufactured commit) -% hg tags -v +% hg tags -v (git-dump-1.dat) REL-2-2-3-P1 2:9c706dffba0e +---------------------------------------- +% import git-dump-2.dat +Reading source: git-blob.dat +Reading source: git-dump-2.dat +0 files updated, 0 files merged, 0 files removed, 0 files unresolved +Done commit of rev 0 +1 files updated, 0 files merged, 0 files removed, 0 files unresolved +Done commit of rev 1 +0 files updated, 0 files merged, 0 files removed, 0 files unresolved +Done commit of rev 2 +0 files updated, 0 files merged, 0 files removed, 0 files unresolved +Done commit of rev 3 +updating tags +1 files updated, 0 files merged, 0 files removed, 0 files unresolved +Removing blob dir 'HGTMP/test-fastimport-cvs2git-fixup/realcvs.2/.hg/blobs' ... +% hg glog (git-dump-2.dat) +@ rev: 4 +| author: convert-repo +| branch: '' tags: tip +| files: .hgtags +| desc: update tags +| +o rev: 3 +| author: Other <other@example.com> +| branch: '' tags: +| files: main.cpp +| desc: added iostream.h +| +| o rev: 2 +| | author: cvs2git <cvs2git> +| | branch: 'REL-2-2-3' tags: REL-2-2-3-P1 +| | files: Tools/Debug/C++/DebugCpp.doxygen +| | desc: create tag 'REL-2-2-3-P1' (manufactured commit) +| | +| o rev: 1 +|/ author: cvs2git <cvs2git> +| branch: 'REL-2-2-3' tags: +| files: +| desc: create branch 'REL-2-2-3' (manufactured commit) +| +o rev: 0 + author: Example <example> + branch: '' tags: + files: Makefile + desc: added Makefile + +% hg branches (git-dump-2.dat) +REL-2-2-3 2:9c706dffba0e +% hg heads -v (git-dump-2.dat) +rev: 4 +author: convert-repo +branch: '' tags: tip +files: .hgtags +desc: update tags + +rev: 2 +author: cvs2git <cvs2git> +branch: 'REL-2-2-3' tags: REL-2-2-3-P1 +files: Tools/Debug/C++/DebugCpp.doxygen +desc: create tag 'REL-2-2-3-P1' (manufactured commit) + +% hg tags -v (git-dump-2.dat) +REL-2-2-3-P1 2:9c706dffba0e
