Mercurial > hg > hg-fastimport
comparison tests/test-fastimport-cvs2git-fixup @ 39:177a133519bc
Handle fixup branches for tag/branch creation better.
- ensure that fixup commits actually become Mercurial changesets
(rather than dropping them on the floor)
- pretend that fixup commits happen on the same branch as the
previous commit
- don't track fixup commits as branch heads
- add test-fastimport-cvs2git-fixup (currently failing because
tags are not converted)
| author | Greg Ward <greg-hg@gerg.ca> |
|---|---|
| date | Sat, 09 May 2009 18:52:33 -0400 |
| parents | |
| children | 71f1e5ed6213 |
comparison
equal
deleted
inserted
replaced
| 38:3048a2dcf68a | 39:177a133519bc |
|---|---|
| 1 #!/bin/sh | |
| 2 | |
| 3 # Test a dump created by cvs2git from a CVS repository with branches and | |
| 4 # tags. Specifically, we're looking at the creation of a new branch | |
| 5 # REL-2-2-3 where the branch point is tagged REL-2-2-3-P1. | |
| 6 | |
| 7 # Rather than create an artificial example, this is derived from | |
| 8 # a real-life CVS repository. | |
| 9 | |
| 10 . $TESTDIR/fastimport-common | |
| 11 | |
| 12 cat > git-blob.dat <<EOF | |
| 13 blob | |
| 14 mark :2308 | |
| 15 data 5 | |
| 16 boo! | |
| 17 | |
| 18 blob | |
| 19 mark :14693 | |
| 20 data 18 | |
| 21 # Doxyfile 1.2.14 | |
| 22 | |
| 23 blob | |
| 24 mark :11363 | |
| 25 data 6 | |
| 26 hello | |
| 27 | |
| 28 EOF | |
| 29 | |
| 30 # XXX this is the dump that cvs2git actually produces. Subtle | |
| 31 # bogosities: | |
| 32 # - commit 1619 has no first parent, but the "merge" directive | |
| 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 | |
| 35 # set to the second parent... and there is no first parent | |
| 36 # | |
| 37 # I'm not using this one; I'm just recording it here to vent about | |
| 38 # cvs2git. See below for the dump that I want cvs2git to produce, | |
| 39 # and the one that is correctly handled by hg-fastimport. | |
| 40 #cat > git-dump.dat <<EOF | |
| 41 cat > /dev/null <<EOF | |
| 42 commit refs/heads/master | |
| 43 mark :1000000373 | |
| 44 committer Example <example> 991793180 +0000 | |
| 45 data 15 | |
| 46 added Makefile | |
| 47 | |
| 48 M 100644 :2308 Makefile | |
| 49 | |
| 50 commit refs/heads/REL-2-2-3 | |
| 51 mark :1000001619 | |
| 52 committer cvs2git <cvs2git> 1022533494 +0000 | |
| 53 data 47 | |
| 54 create branch 'REL-2-2-3' (manufactured commit) | |
| 55 merge :1000000373 | |
| 56 M 100644 :2308 Makefile | |
| 57 | |
| 58 commit refs/heads/TAG.FIXUP | |
| 59 mark :1000001620 | |
| 60 committer cvs2git <cvs2git> 1022533495 +0000 | |
| 61 data 47 | |
| 62 create tag 'REL-2-2-3-P1' (manufactured commit) | |
| 63 merge :1000001619 | |
| 64 M 100644 :14693 Tools/Debug/C++/DebugCpp.doxygen | |
| 65 | |
| 66 reset refs/tags/REL-2-2-3-P1 | |
| 67 from :1000001620 | |
| 68 reset refs/heads/TAG.FIXUP | |
| 69 | |
| 70 commit refs/heads/master | |
| 71 mark :1000001621 | |
| 72 committer Other <other@example.com> 1022536868 +0000 | |
| 73 data 18 | |
| 74 added iostream.h | |
| 75 | |
| 76 M 100644 :11363 main.cpp | |
| 77 EOF | |
| 78 | |
| 79 # XXX this is the dump that I think cvs2git *should* produce, not what | |
| 80 # it actually does produce (hmmm) | |
| 81 cat > git-dump.dat <<EOF | |
| 82 commit refs/heads/master | |
| 83 mark :1000000373 | |
| 84 committer Example <example> 991793180 +0000 | |
| 85 data 15 | |
| 86 added Makefile | |
| 87 | |
| 88 M 100644 :2308 Makefile | |
| 89 | |
| 90 commit refs/heads/REL-2-2-3 | |
| 91 mark :1000001619 | |
| 92 committer cvs2git <cvs2git> 1022533494 +0000 | |
| 93 data 47 | |
| 94 create branch 'REL-2-2-3' (manufactured commit) | |
| 95 from :1000000373 | |
| 96 M 100644 :2308 Makefile | |
| 97 | |
| 98 commit refs/heads/TAG.FIXUP | |
| 99 mark :1000001620 | |
| 100 committer cvs2git <cvs2git> 1022533495 +0000 | |
| 101 data 47 | |
| 102 create tag 'REL-2-2-3-P1' (manufactured commit) | |
| 103 from :1000001619 | |
| 104 M 100644 :14693 Tools/Debug/C++/DebugCpp.doxygen | |
| 105 | |
| 106 reset refs/tags/REL-2-2-3-P1 | |
| 107 from :1000001620 | |
| 108 reset refs/heads/TAG.FIXUP | |
| 109 | |
| 110 commit refs/heads/master | |
| 111 mark :1000001621 | |
| 112 committer Other <other@example.com> 1022536868 +0000 | |
| 113 data 18 | |
| 114 added iostream.h | |
| 115 | |
| 116 M 100644 :11363 main.cpp | |
| 117 EOF | |
| 118 | |
| 119 echo "% import cvs2git with branch/tag" | |
| 120 set -e | |
| 121 hg init realcvs | |
| 122 hg -R realcvs fastimport git-blob.dat git-dump.dat \ | |
| 123 | sed "s|$HGTMP|HGTMP|g" | |
| 124 | |
| 125 echo "% hg glog" | |
| 126 cd realcvs | |
| 127 hg glog -v | |
| 128 | |
| 129 echo "% hg branches" | |
| 130 hg branches | |
| 131 | |
| 132 echo "% hg heads -v" | |
| 133 hg heads | |
| 134 | |
| 135 echo "% hg tags -v" | |
| 136 hg tags |
