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

Last change on this file since 2308 was 2306, checked in by broder, 16 years ago

Add rules to include invirtified packages in the git migration.

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