Mercurial > hg > hg-fastimport
comparison tests/test-fastimport-cvs2git-fixup @ 44:61ff7b929cea
Handle fixup commits and branch creation as produced by cvs2git.
Update test script to test real cvs2git output, not my idealized
version of it.
| author | Greg Ward <greg-hg@gerg.ca> |
|---|---|
| date | Mon, 11 May 2009 17:46:19 -0400 |
| parents | 71f1e5ed6213 |
| children | 783890f8a6fb |
comparison
equal
deleted
inserted
replaced
| 43:000d4174071c | 44:61ff7b929cea |
|---|---|
| 25 data 6 | 25 data 6 |
| 26 hello | 26 hello |
| 27 | 27 |
| 28 EOF | 28 EOF |
| 29 | 29 |
| 30 # XXX this is the dump that cvs2git actually produces. Subtle | 30 # This is the dump that cvs2git actually produces. There are some |
| 31 # bogosities: | 31 # oddities to it: |
| 32 # - commit 1619 has no first parent, but the "merge" directive | 32 # - commit 1619 has no first parent, but the "merge" directive |
| 33 # (second parent) points to the commit that should be its first parent | 33 # (second parent) points to the commit that should be its first parent |
| 34 # - commit 1620 should have 1619 as its first parent, but 1619 is | 34 # - commit 1620 should have 1619 as its first parent, but 1619 is |
| 35 # set to the second parent... and there is no first parent | 35 # set to the second parent... and there is no first parent |
| 36 # | 36 # |
| 37 # I'm not using this one; I'm just recording it here to vent about | 37 # but git-fast-import accepts it, and the spec allows it. Therefore, |
| 38 # cvs2git. See below for the dump that I want cvs2git to produce, | 38 # hg-fastimport must accept it and handle it correctly. |
| 39 # and the one that is correctly handled by hg-fastimport. | 39 |
| 40 #cat > git-dump.dat <<EOF | 40 #cat > /dev/null <<EOF |
| 41 cat > /dev/null <<EOF | 41 cat > git-dump-1.dat <<EOF |
| 42 commit refs/heads/master | 42 commit refs/heads/master |
| 43 mark :1000000373 | 43 mark :1000000373 |
| 44 committer Example <example> 991793180 +0000 | 44 committer Example <example> 991793180 +0000 |
| 45 data 15 | 45 data 15 |
| 46 added Makefile | 46 added Makefile |
| 74 added iostream.h | 74 added iostream.h |
| 75 | 75 |
| 76 M 100644 :11363 main.cpp | 76 M 100644 :11363 main.cpp |
| 77 EOF | 77 EOF |
| 78 | 78 |
| 79 # XXX this is the dump that I think cvs2git *should* produce, not what | 79 # This is another way of expressing the same thing. git-fast-import |
| 80 # it actually does produce (hmmm) | 80 # treats them the same, therefore hg-fastimport should too. |
| 81 cat > git-dump.dat <<EOF | 81 cat > git-dump-2.dat <<EOF |
| 82 commit refs/heads/master | 82 commit refs/heads/master |
| 83 mark :1000000373 | 83 mark :1000000373 |
| 84 committer Example <example> 991793180 +0000 | 84 committer Example <example> 991793180 +0000 |
| 85 data 15 | 85 data 15 |
| 86 added Makefile | 86 added Makefile |
| 117 EOF | 117 EOF |
| 118 | 118 |
| 119 echo "% import cvs2git with branch/tag" | 119 echo "% import cvs2git with branch/tag" |
| 120 set -e | 120 set -e |
| 121 hg init realcvs | 121 hg init realcvs |
| 122 hg -R realcvs fastimport git-blob.dat git-dump.dat \ | 122 hg -R realcvs fastimport git-blob.dat git-dump-1.dat \ |
| 123 | sed "s|$HGTMP|HGTMP|g" | 123 | sed "s|$HGTMP|HGTMP|g" |
| 124 | 124 |
| 125 echo "% hg glog" | 125 echo "% hg glog" |
| 126 cd realcvs | 126 cd realcvs |
| 127 template="rev: {rev}\nauthor: {author}\nbranch: '{branches}' tags: {tags}\nfiles: {files}\ndesc: {desc}\n\n" | 127 template="rev: {rev}\nauthor: {author}\nbranch: '{branches}' tags: {tags}\nfiles: {files}\ndesc: {desc}\n\n" |
