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

Last change on this file since 1945 was 1945, checked in by andersk, 15 years ago

Move lots of information to a YAML database.

File size: 4.4 KB
Line 
1<%
2    import yaml
3    svn = yaml.load(open('svn.yml'))
4    packages = svn['packages']
5    scripts = svn['scripts']
6    quashes = svn['quashes']
7
8    repos = ['packages/%s' % package for package in packages]
9    repos += ['scripts/%s' % script for script in scripts]
10    repos += ['doc/xvm', 'scripts/osx-update']
11
12    for package in packages:
13        if 'merge' in packages[package]:
14            repos.remove('packages/%s' % package)
15
16    def get_repo(package):
17        if 'merge' in packages[package]:
18            return get_repo(packages[package]['merge'])
19        return 'packages/%s.git' % package
20
21    def get_branch(package):
22        if 'branch' in packages[package]:
23            return packages[package]['branch']
24        if 'merge' in packages[package]:
25            return get_branch(packages[package]['merge'])
26        return 'master'
27
28    def get_tag_prefix(package):
29        if 'merge' in packages[package]:
30            return '%s/' % package
31        return ''
32%>
33
34% for repo in repos:
35create repository ${repo}.git
36end repository
37
38% endfor
39
40% for quash in quashes:
41match ${quash['path']}
42  min revision ${quash['rev']}
43  max revision ${quash['rev']}
44end match
45% endfor
46
47% for package in packages:
48
49%   if package == 'sipb-xen-database':
50match /trunk/packages/${package}/${package}-0/
51  repository ${get_repo(package)}
52  branch ${get_branch(package)}
53  max revision 8
54end match
55%   endif
56
57%   if 'undouble' in packages[package]:
58match /trunk/packages/${package}/${package}/
59  repository ${get_repo(package)}
60  branch ${get_branch(package)}
61  max revision ${packages[package]['undouble'][0] - 1}
62end match
63
64match /package_tags/${package}/([^/~]+)/${package}/
65  repository ${get_repo(package)}
66  branch tags/${get_tag_prefix(package)}\1
67%     if package == 'sipb-xen-dev':
68  max revision 318
69%     else:
70  max revision ${packages[package]['undouble'][0] - 1}
71%     endif
72end match
73
74match /trunk/packages/tmp/${package}/
75  min revision ${packages[package]['undouble'][0]}
76  max revision ${packages[package]['undouble'][0]}
77end match
78
79match /trunk/packages/${package}/
80  min revision ${packages[package]['undouble'][1]}
81  max revision ${packages[package]['undouble'][1]}
82end match
83%   endif
84
85match /trunk/packages/${package}/
86  repository ${get_repo(package)}
87  branch ${get_branch(package)}
88%   if 'undouble' in packages[package]:
89  min revision ${packages[package]['undouble'][1] + 1}
90%   endif
91%   if 'punt' in packages[package]:
92  max revision ${packages[package]['punt'] - 1}
93%   endif
94end match
95
96match /package_tags/${package}/([^/~]+)/
97  repository ${get_repo(package)}
98  branch tags/${get_tag_prefix(package)}\1
99%   if 'undouble' in packages[package]:
100  min revision ${packages[package]['undouble'][1]}
101%   endif
102end match
103
104match /package_tags/${package}/([^/~]+)~([^/~]+)/
105  repository ${get_repo(package)}
106  branch tags/${get_tag_prefix(package)}\1_\2
107%   if 'undouble' in packages[package]:
108  min revision ${packages[package]['undouble'][1]}
109%   endif
110end match
111
112% endfor
113
114match /trunk/packages/(xen-common|xen-3.1)/
115end match
116
117match /package_tags/(xen-common|xen-3.1)/
118end match
119
120match /trunk/dhcp/
121  repository ${get_repo('sipb-xen-dhcp')}
122  branch ${get_branch('sipb-xen-dhcp')}
123  max revision 281
124end match
125
126match /trunk/web(/|$)
127  repository ${get_repo('sipb-xen-www')}
128  branch ${get_branch('sipb-xen-www')}
129  max revision 303
130end match
131
132match /trunk/vnc/tightvnc-1.3.9_javasrc.zip
133end match
134
135match /trunk/vnc/vnc_javasrc/
136  repository ${get_repo('sipb-xen-vnc-client')}
137  branch ${get_branch('sipb-xen-vnc-client')}
138  max revision 304
139end match
140
141match /trunk/vnc/vnc_server(/|$)
142  repository ${get_repo('sipb-xen-vnc-server')}
143  branch ${get_branch('sipb-xen-vnc-server')}
144  max revision 286
145end match
146
147match /trunk/dns/
148  repository ${get_repo('sipb-xen-dns')}
149  branch dns
150  max revision 268
151end match
152
153% for script in scripts:
154match /trunk/scripts/${script}/
155  repository scripts/${script}.git
156  branch master
157end match
158% endfor
159
160match /trunk/scripts/
161  repository scripts/osx-update.git
162  branch master
163  min revision 1785
164  max revision 1785
165end match
166
167match /trunk/scripts/
168  repository scripts/prod-migration.git
169  branch master
170  max revision 1863
171end match
172
173% for rev in [803, 804, 925, 926, 928, 1537, 1566]:
174match /trunk/
175  repository doc/xvm.git
176  branch master
177  min revision ${rev}
178  max revision ${rev}
179end match
180% endfor
181
182match /trunk/vmctl/
183end match
184
185match /trunk/COPYING$
186end match
187
188match /branches/wsgi/
189end match
Note: See TracBrowser for help on using the repository browser.