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: |
---|
45 | create repository ${repo}.git |
---|
46 | end repository |
---|
47 | |
---|
48 | % endfor |
---|
49 | |
---|
50 | % for package in packages: |
---|
51 | match /trunk/packages/${package}/${package}/ |
---|
52 | repository ${get_repo(package)} |
---|
53 | branch ${get_branch(package)} |
---|
54 | end match |
---|
55 | |
---|
56 | match /package_tags/${package}/([^/~]+)/${package}/ |
---|
57 | repository ${get_repo(package)} |
---|
58 | branch tags/${get_tag_prefix(package)}\1 |
---|
59 | end match |
---|
60 | |
---|
61 | match /trunk/packages/${package}/ |
---|
62 | repository ${get_repo(package)} |
---|
63 | branch ${get_branch(package)} |
---|
64 | end match |
---|
65 | |
---|
66 | match /package_tags/${package}/([^/~]+)/ |
---|
67 | repository ${get_repo(package)} |
---|
68 | branch tags/${get_tag_prefix(package)}\1 |
---|
69 | end match |
---|
70 | |
---|
71 | match /package_tags/${package}/([^/~]+)~([^/~]+)/ |
---|
72 | repository ${get_repo(package)} |
---|
73 | branch tags/${get_tag_prefix(package)}\1_\2 |
---|
74 | end match |
---|
75 | |
---|
76 | % endfor |
---|
77 | |
---|
78 | match /trunk/packages/(xen-common|xen-3.1)/ |
---|
79 | end match |
---|
80 | |
---|
81 | match /package_tags/(xen-common|xen-3.1)/ |
---|
82 | end match |
---|
83 | |
---|
84 | match /trunk/packages/tmp/ |
---|
85 | repository ${get_repo('sipb-xen-database')} |
---|
86 | branch ${get_branch('sipb-xen-database')} |
---|
87 | end match |
---|
88 | |
---|
89 | match /trunk/(dhcp|dns|scripts|vnc|web|vmctl)/ |
---|
90 | end match |
---|
91 | |
---|
92 | match /trunk/(COPYING|xvm-host-setup-notes) |
---|
93 | end match |
---|
94 | |
---|
95 | match /branches/wsgi/ |
---|
96 | end match |
---|