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