source: trunk/scripts/git-migration/rules.mako @ 1909

Last change on this file since 1909 was 1906, checked in by andersk, 16 years ago

I think I'm starting to get a hang of this whole svn thing, now.

File size: 4.7 KB
Line 
1<%
2    packages = [line.strip() for line in open('package-list')]
3    packages.append('packages/xvm-console-devconfig')
4    repos = packages
5    packages = [package[len('packages/'):] for package in packages]
6
7    doubled_packages = {
8        'sipb-xen-base': (314, 315),
9        'sipb-xen-database': (311, 313),
10        'sipb-xen-dev': (314, 315),
11        'sipb-xen-dom0': (314, 315),
12        'sipb-xen-remctl-auto': (314, 315),
13    }
14
15    punt = {
16        'sipb-xen-guest-installer': 742,
17        'sipb-xen-dns': 1184,
18        'sipb-xen-base': 1350,
19        'sipb-xen-chrony-config': 1351,
20        'sipb-xen-database': 1352,
21        'sipb-xen-dev': 1353,
22        'sipb-xen-dom0': 1354,
23        'sipb-xen-host-master': 1355,
24        'sipb-xen-iptables': 1356,
25        'sipb-xen-python-pydhcplib': 1357,
26        'sipb-xen-remctl-auto': 1358,
27        'sipb-xen-vnc-client': 1359,
28        'sipb-xen-www': 1360,
29        'sipb-xen-vnc-server': 1387,
30        'sipb-xen-dhcp': 1436,
31        'sipb-xen-autoinstaller': 1569,
32        'sipb-xen-clvm-config': 1569,
33        'invirt-console-host': 1816,
34        'invirt-console-server': 1816,
35    }
36
37    merges = []
38    for line in open('merges'):
39        line = line.strip()
40        if line == '' or line[0] == '#':
41            continue
42
43        merges.append(line.split())
44
45    merge_map = {}
46    merge_count = {}
47    merge_n = {}
48    for merge in merges:
49        repos.remove('packages/%s' % merge[0])
50        merge_map[merge[0]] = merge[1]
51        if int(merge[2]) == 0:
52            merge_count[merge[1]] = merge_count.get(merge[1], 0) + 1
53        else:
54            merge_n[merge[0]] = int(merge[2])
55
56    def get_repo(package):
57        if package in merge_map:
58            return get_repo(merge_map[package])
59        return 'packages/%s.git' % package
60
61    def get_branch(package):
62        if package in merge_map:
63            if package in merge_n or merge_count[merge_map[package]] > 1:
64                return package
65            return get_branch(merge_map[package])
66        return 'master'
67
68    def get_tag_prefix(package):
69        if package in merge_map:
70            return '%s/' % package
71        return ''
72%>
73
74% for repo in repos:
75create repository ${repo}.git
76end repository
77
78% endfor
79
80match /package_tags/sipb-xen-dev/sipb-xen-dev(/|$)
81end match
82
83match /trunk/packages/sipb-xen-autoinstaller(/|$)
84  min revision 742
85  max revision 742
86end match
87
88% for package in packages:
89
90% if package == 'sipb-xen-database':
91match /trunk/packages/${package}/${package}-0(/|$)
92  repository ${get_repo(package)}
93  branch ${get_branch(package)}
94  max revision 8
95end match
96% endif
97
98% if package in doubled_packages:
99match /trunk/packages/${package}/${package}(/|$)
100  repository ${get_repo(package)}
101  branch ${get_branch(package)}
102  max revision ${doubled_packages[package][0] - 1}
103end match
104
105match /package_tags/${package}/([^/~]+)/${package}(/|$)
106  repository ${get_repo(package)}
107  branch tags/${get_tag_prefix(package)}\1
108  max revision ${doubled_packages[package][0] - 1}
109end match
110
111match /trunk/packages/tmp/${package}(/|$)
112  repository ${get_repo(package)}
113  branch ${get_branch(package)}
114  max revision ${doubled_packages[package][1] - 1}
115end match
116% endif
117
118match /trunk/packages/${package}(/|$)
119  repository ${get_repo(package)}
120  branch ${get_branch(package)}
121% if package in doubled_packages:
122  min revision ${doubled_packages[package][1]}
123% endif
124% if package in punt:
125  max revision ${punt[package] - 1}
126% endif
127end match
128
129match /package_tags/${package}/([^/~]+)(/|$)
130  repository ${get_repo(package)}
131  branch tags/${get_tag_prefix(package)}\1
132% if package in doubled_packages:
133  min revision ${doubled_packages[package][1]}
134% endif
135end match
136
137match /package_tags/${package}/([^/~]+)~([^/~]+)(/|$)
138  repository ${get_repo(package)}
139  branch tags/${get_tag_prefix(package)}\1_\2
140% if package in doubled_packages:
141  min revision ${doubled_packages[package][1]}
142% endif
143end match
144
145% endfor
146
147match /trunk/packages/(xen-common|xen-3.1)(/|$)
148end match
149
150match /package_tags/(xen-common|xen-3.1)(/|$)
151end match
152
153match /trunk/dhcp(/|$)
154  repository ${get_repo('sipb-xen-dhcp')}
155  branch ${get_branch('sipb-xen-dhcp')}
156  max revision 281
157end match
158
159match /trunk/web(/|$)
160  repository ${get_repo('sipb-xen-www')}
161  branch ${get_branch('sipb-xen-www')}
162  max revision 302
163end match
164
165match /trunk/vnc/tightvnc-1.3.9_javasrc.zip
166end match
167
168match /trunk/vnc/vnc_javasrc(/|$)
169  repository ${get_repo('sipb-xen-vnc-client')}
170  branch ${get_branch('sipb-xen-vnc-client')}
171end match
172
173match /trunk/vnc/vnc_server(/|$)
174  repository ${get_repo('sipb-xen-vnc-server')}
175  branch ${get_branch('sipb-xen-vnc-server')}
176end match
177
178match /trunk/(dns|scripts|vmctl)(/|$)
179end match
180
181match /trunk/(COPYING|xvm-host-setup-notes)
182end match
183
184match /branches/wsgi(/|$)
185end match
Note: See TracBrowser for help on using the repository browser.