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

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

For the git migration, one repository per invertified package, and
grab the tags while we're at it.

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