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

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

In the git import, deal with r316, r318 and the corresponding tag by
hand instead of through s-a-f-e.

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