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