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

Last change on this file since 1988 was 1946, checked in by andersk, 16 years ago

Put some more stuff in YAML.

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