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

Last change on this file since 2438 was 2356, checked in by andersk, 15 years ago

svn-all-fast-export can create annotated tags now.

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