| 1 | #!/bin/bash |
|---|
| 2 | set -e |
|---|
| 3 | |
|---|
| 4 | SVN=${1:-/mit/xvm/svn} |
|---|
| 5 | |
|---|
| 6 | mako-render rules.mako > rules |
|---|
| 7 | |
|---|
| 8 | rm git -rf |
|---|
| 9 | mkdir git |
|---|
| 10 | cd git |
|---|
| 11 | |
|---|
| 12 | sed -n 's/^create repository // p' ../rules | while read repo; do |
|---|
| 13 | mkdir -p "$repo" && GIT_DIR="$repo" git init --bare |
|---|
| 14 | done |
|---|
| 15 | |
|---|
| 16 | svn-all-fast-export --identity-map ../authors ../rules "$SVN" |
|---|
| 17 | |
|---|
| 18 | sed -n 's/^create repository // p' ../rules | while read repo; do |
|---|
| 19 | if [ -e "$repo/refs/heads/tags" ]; then |
|---|
| 20 | cp -a "$repo/refs/heads/tags/." "$repo/refs/tags" |
|---|
| 21 | rm -rf "$repo/refs/heads/tags" |
|---|
| 22 | fi |
|---|
| 23 | done |
|---|
| 24 | |
|---|
| 25 | pushd packages/invirt-remote.git |
|---|
| 26 | echo $(git rev-parse 0.2.0 invirt-remote-server invirt-remote-host) >> info/grafts |
|---|
| 27 | git filter-branch --tag-name-filter cat -- ^invirt-remote-server ^invirt-remote-host --all |
|---|
| 28 | rm -rf info/grafts refs/original refs/heads/invirt-remote-server refs/heads/invirt-remote-host |
|---|
| 29 | popd |
|---|
| 30 | |
|---|
| 31 | pushd packages/invirt-console.git |
|---|
| 32 | echo $(git rev-parse 0.2.0 0.2.0^ invirt-console-host) >> info/grafts |
|---|
| 33 | git filter-branch --tag-name-filter cat -- ^0.2.0^ ^invirt-console-host --all |
|---|
| 34 | rm -rf info/grafts refs/original refs/heads/invirt-console-host |
|---|
| 35 | popd |
|---|
| 36 | |
|---|
| 37 | pushd packages/invirt-dns.git |
|---|
| 38 | echo $(git rev-parse sipb-xen-dns/1~10 sipb-xen-dns/1~11 dns) >> info/grafts |
|---|
| 39 | git filter-branch --tag-name-filter cat -- ^sipb-xen-dns/1~11 ^dns --all |
|---|
| 40 | rm -rf info/grafts refs/original refs/heads/dns |
|---|
| 41 | popd |
|---|
| 42 | |
|---|
| 43 | pushd packages/invirt-database-server.git |
|---|
| 44 | git fetch ../invirt-database.git refs/tags/0.0.1:refs/heads/tmp |
|---|
| 45 | echo $(git rev-parse 0.0.1 refs/heads/tmp^) >> info/grafts |
|---|
| 46 | git filter-branch --tag-name-filter cat -- ^refs/heads/tmp --all |
|---|
| 47 | rm -rf info/grafts refs/original refs/heads/tmp |
|---|
| 48 | popd |
|---|
| 49 | |
|---|
| 50 | pushd packages/libyaml.git |
|---|
| 51 | git fetch git://andersk.mit.edu/libyaml.git refs/tags/upstream/0.1.1:refs/tags/upstream/0.1.1 refs/tags/debian/0.1.1-1:refs/tags/debian/0.1.1-1 |
|---|
| 52 | git branch upstream upstream/0.1.1 |
|---|
| 53 | echo $(git rev-parse 0.1.1-1_andersk1 debian/0.1.1-1^0) >> info/grafts |
|---|
| 54 | git filter-branch --tag-name-filter cat -- ^debian/0.1.1-1 --all |
|---|
| 55 | rm -rf info/grafts refs/original |
|---|
| 56 | popd |
|---|
| 57 | |
|---|
| 58 | pushd packages/python-routefs.git |
|---|
| 59 | git fetch -t git://github.com/ebroder/python-routefs.git |
|---|
| 60 | git branch -f upstream 1.0.1 |
|---|
| 61 | git branch -f master 1.0.1-1 |
|---|
| 62 | popd |
|---|
| 63 | |
|---|
| 64 | echo |
|---|
| 65 | echo 'The Git migration was successful.' |
|---|