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

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

Add rules to include invirtified packages in the git migration.

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