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

Last change on this file since 1917 was 1914, checked in by andersk, 16 years ago

More fixups.

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