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

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

Use authors file.

File size: 2.4 KB
Line 
1<%
2    packages = [line.strip() for line in open('package-list')]
3    packages.append('packages/xvm-console-devconfig')
4    repos = packages
5    packages = [package[len('packages/'):] for package in packages]
6
7    merges = []
8    for line in open('merges'):
9        line = line.strip()
10        if line == '' or line[0] == '#':
11            continue
12
13        merges.append(line.split())
14
15    merge_map = {}
16    merge_count = {}
17    merge_n = {}
18    for merge in merges:
19        repos.remove('packages/%s' % merge[0])
20        merge_map[merge[0]] = merge[1]
21        if int(merge[2]) == 0:
22            merge_count[merge[1]] = merge_count.get(merge[1], 0) + 1
23        else:
24            merge_n[merge[0]] = int(merge[2])
25
26    def get_repo(package):
27        if package in merge_map:
28            return get_repo(merge_map[package])
29        return 'packages/%s.git' % package
30
31    def get_branch(package):
32        if package in merge_map:
33            if package in merge_n or merge_count[merge_map[package]] > 1:
34                return package
35            return get_branch(merge_map[package])
36        return 'master'
37
38    def get_tag_prefix(package):
39        if package in merge_map:
40            return '%s/' % package
41        return ''
42%>
43
44% for repo in repos:
45create repository ${repo}.git
46end repository
47
48% endfor
49
50match /package_tags/sipb-xen-dev/sipb-xen-dev/
51end match
52
53% for package in packages:
54match /trunk/packages/${package}/${package}/
55  repository ${get_repo(package)}
56  branch ${get_branch(package)}
57end match
58
59match /package_tags/${package}/([^/~]+)/${package}/
60  repository ${get_repo(package)}
61  branch tags/${get_tag_prefix(package)}\1
62end match
63
64match /trunk/packages/${package}/
65  repository ${get_repo(package)}
66  branch ${get_branch(package)}
67end match
68
69match /package_tags/${package}/([^/~]+)/
70  repository ${get_repo(package)}
71  branch tags/${get_tag_prefix(package)}\1
72end match
73
74match /package_tags/${package}/([^/~]+)~([^/~]+)/
75  repository ${get_repo(package)}
76  branch tags/${get_tag_prefix(package)}\1_\2
77end match
78
79% endfor
80
81match /trunk/packages/(xen-common|xen-3.1)/
82end match
83
84match /package_tags/(xen-common|xen-3.1)/
85end match
86
87match /trunk/packages/tmp/
88  repository ${get_repo('sipb-xen-database')}
89  branch ${get_branch('sipb-xen-database')}
90end match
91
92match /trunk/(dhcp|dns|scripts|vnc|web|vmctl)/
93end match
94
95match /trunk/(COPYING|xvm-host-setup-notes)
96end match
97
98match /branches/wsgi/
99end match
Note: See TracBrowser for help on using the repository browser.