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

Last change on this file since 1940 was 1937, checked in by andersk, 16 years ago

Quash the rest of the empty revisions.

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