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-dev.git |
---|
26 | git tag sipb-xen-dev/13 sipb-xen-dev/14~2 |
---|
27 | popd |
---|
28 | |
---|
29 | pushd packages/invirt-remote.git |
---|
30 | echo $(git rev-parse 0.2.0 invirt-remote-server invirt-remote-host) >> info/grafts |
---|
31 | git filter-branch --tag-name-filter cat -- ^invirt-remote-server ^invirt-remote-host --all |
---|
32 | rm -rf info/grafts refs/original refs/heads/invirt-remote-server refs/heads/invirt-remote-host |
---|
33 | popd |
---|
34 | |
---|
35 | pushd packages/invirt-console.git |
---|
36 | echo $(git rev-parse 0.2.0 0.2.0^ invirt-console-host) >> info/grafts |
---|
37 | git filter-branch --tag-name-filter cat -- ^0.2.0^ ^invirt-console-host --all |
---|
38 | rm -rf info/grafts refs/original refs/heads/invirt-console-host |
---|
39 | popd |
---|
40 | |
---|
41 | pushd packages/invirt-dns.git |
---|
42 | echo $(git rev-parse sipb-xen-dns/1~10 sipb-xen-dns/1~11 dns) >> info/grafts |
---|
43 | git filter-branch --tag-name-filter cat -- ^sipb-xen-dns/1~11 ^dns --all |
---|
44 | rm -rf info/grafts refs/original refs/heads/dns |
---|
45 | popd |
---|
46 | |
---|
47 | pushd packages/invirt-database.git |
---|
48 | echo $(git rev-parse invirt-database-server/0.0.1 0.0.1^) >> info/grafts |
---|
49 | echo $(git rev-parse 0.2.0 0.2.0^ invirt-database-server) >> info/grafts |
---|
50 | git filter-branch --tag-name-filter cat -- ^0.2.0^ --all |
---|
51 | rm -rf info/grafts refs/original refs/heads/invirt-database-server |
---|
52 | popd |
---|
53 | |
---|
54 | pushd packages/python-routefs.git |
---|
55 | git fetch -t git://github.com/ebroder/python-routefs.git |
---|
56 | git branch -f upstream 1.0.1 |
---|
57 | git branch -f master 1.0.1-1 |
---|
58 | popd |
---|
59 | |
---|
60 | echo |
---|
61 | echo 'The Git migration was successful.' |
---|