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
RevLine 
[1901]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
[1906]7    doubled_packages = {
[1914]8        'sipb-xen-guest-installer': (310, 310),
[1906]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
[1905]16    punt = {
[1914]17        'xvm-console-devconfig': 700,
[1906]18        'sipb-xen-guest-installer': 742,
[1914]19        'sipb-xen-remote-server': 1176,
[1906]20        'sipb-xen-dns': 1184,
[1914]21        'sipb-xen-console-server': 1187,
22        'sipb-xen-console': 1201,
[1905]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,
[1914]40        'invirt-remote-host': 1822,
41        'invirt-remote-server': 1822,
[1905]42    }
43
[1901]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
[1905]87match /package_tags/sipb-xen-dev/sipb-xen-dev(/|$)
[1903]88end match
89
[1914]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
[1906]110match /trunk/packages/sipb-xen-autoinstaller(/|$)
111  min revision 742
112  max revision 742
113end match
114
[1901]115% for package in packages:
[1906]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:
[1905]126match /trunk/packages/${package}/${package}(/|$)
[1901]127  repository ${get_repo(package)}
128  branch ${get_branch(package)}
[1906]129  max revision ${doubled_packages[package][0] - 1}
[1901]130end match
131
[1905]132match /package_tags/${package}/([^/~]+)/${package}(/|$)
[1901]133  repository ${get_repo(package)}
134  branch tags/${get_tag_prefix(package)}\1
[1906]135  max revision ${doubled_packages[package][0] - 1}
[1901]136end match
137
[1906]138match /trunk/packages/tmp/${package}(/|$)
[1914]139  min revision ${doubled_packages[package][0]}
140  max revision ${doubled_packages[package][0]}
[1906]141end match
[1914]142
143match /trunk/packages/${package}(/|$)
144  min revision ${doubled_packages[package][1]}
145  max revision ${doubled_packages[package][1]}
146end match
[1906]147% endif
148
[1905]149match /trunk/packages/${package}(/|$)
[1901]150  repository ${get_repo(package)}
151  branch ${get_branch(package)}
[1906]152% if package in doubled_packages:
[1914]153  min revision ${doubled_packages[package][1] + 1}
[1906]154% endif
[1905]155% if package in punt:
156  max revision ${punt[package] - 1}
157% endif
[1901]158end match
159
[1905]160match /package_tags/${package}/([^/~]+)(/|$)
[1901]161  repository ${get_repo(package)}
162  branch tags/${get_tag_prefix(package)}\1
[1906]163% if package in doubled_packages:
164  min revision ${doubled_packages[package][1]}
165% endif
[1901]166end match
167
[1905]168match /package_tags/${package}/([^/~]+)~([^/~]+)(/|$)
[1901]169  repository ${get_repo(package)}
170  branch tags/${get_tag_prefix(package)}\1_\2
[1906]171% if package in doubled_packages:
172  min revision ${doubled_packages[package][1]}
173% endif
[1901]174end match
175
176% endfor
177
[1905]178match /trunk/packages/(xen-common|xen-3.1)(/|$)
[1901]179end match
180
[1905]181match /package_tags/(xen-common|xen-3.1)(/|$)
[1901]182end match
183
[1905]184match /trunk/dhcp(/|$)
185  repository ${get_repo('sipb-xen-dhcp')}
186  branch ${get_branch('sipb-xen-dhcp')}
187  max revision 281
[1901]188end match
189
[1905]190match /trunk/web(/|$)
191  repository ${get_repo('sipb-xen-www')}
192  branch ${get_branch('sipb-xen-www')}
[1914]193  max revision 303
[1905]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')}
[1914]202  max revision 304
[1905]203end match
204
205match /trunk/vnc/vnc_server(/|$)
206  repository ${get_repo('sipb-xen-vnc-server')}
207  branch ${get_branch('sipb-xen-vnc-server')}
[1914]208  max revision 286
[1905]209end match
210
211match /trunk/(dns|scripts|vmctl)(/|$)
212end match
213
[1901]214match /trunk/(COPYING|xvm-host-setup-notes)
215end match
216
[1905]217match /branches/wsgi(/|$)
[1901]218end match
Note: See TracBrowser for help on using the repository browser.