More fixes to make the mass-branching script work (was done yesterday)
This commit is contained in:
parent
6c476f82e7
commit
5fda2de1f6
1 changed files with 11 additions and 11 deletions
|
@ -60,7 +60,7 @@ fedmsg.init(name='relay_inbound', cert_prefix='shell', **config)
|
||||||
GIT_FOLDER = '/srv/git/repositories/'
|
GIT_FOLDER = '/srv/git/repositories/'
|
||||||
NEW_BRANCH = 'f27'
|
NEW_BRANCH = 'f27'
|
||||||
|
|
||||||
MKBRANCH = '/usr/share/dist-git/mkbranch'
|
MKBRANCH = '/usr/share/dist-git/mkbranch_branching'
|
||||||
SETUP_PACKAGE = '/usr/share/dist-git/setup_git_package'
|
SETUP_PACKAGE = '/usr/share/dist-git/setup_git_package'
|
||||||
|
|
||||||
THREADS = 20
|
THREADS = 20
|
||||||
|
@ -132,7 +132,7 @@ def _create_branch(ns, pkgname, branch, existing_branches):
|
||||||
branch, os.path.join(ns, pkgname))
|
branch, os.path.join(ns, pkgname))
|
||||||
|
|
||||||
if not TEST_ONLY:
|
if not TEST_ONLY:
|
||||||
_invoke(MKBRANCH, [branch, os.path.join(ns, pkgname)])
|
_invoke(MKBRANCH, [branch, pkgname])# os.path.join(ns, pkgname)])
|
||||||
fedmsg.publish(
|
fedmsg.publish(
|
||||||
topic='branch',
|
topic='branch',
|
||||||
modname='git',
|
modname='git',
|
||||||
|
@ -215,9 +215,9 @@ def main():
|
||||||
branches and fix inconsistencies.
|
branches and fix inconsistencies.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
for ns in ['rpms', 'modules', 'container']:
|
for ns in ['rpms']:#, 'modules', 'container']:
|
||||||
|
|
||||||
local_pkgs = set(os.listdir(os.path.join(GIT_FOLDER, namespace)))
|
local_pkgs = set(os.listdir(os.path.join(GIT_FOLDER, ns)))
|
||||||
local_pkgs = set([it.replace('.git', '') for it in local_pkgs])
|
local_pkgs = set([it.replace('.git', '') for it in local_pkgs])
|
||||||
if VERBOSE:
|
if VERBOSE:
|
||||||
print "Found %i local packages (namespace: %s)" % (
|
print "Found %i local packages (namespace: %s)" % (
|
||||||
|
@ -229,26 +229,26 @@ def main():
|
||||||
start = time.time()
|
start = time.time()
|
||||||
if THREADS == 1:
|
if THREADS == 1:
|
||||||
git_branch_lookup = map(get_git_branch,
|
git_branch_lookup = map(get_git_branch,
|
||||||
itertools.product([namespace], sorted(local_pkgs)))
|
itertools.product([ns], sorted(local_pkgs)))
|
||||||
else:
|
else:
|
||||||
threadpool = multiprocessing.pool.ThreadPool(processes=THREADS)
|
threadpool = multiprocessing.pool.ThreadPool(processes=THREADS)
|
||||||
git_branch_lookup = threadpool.map(get_git_branch,
|
git_branch_lookup = threadpool.map(get_git_branch,
|
||||||
itertools.product([namespace], sorted(local_pkgs)))
|
itertools.product([ns], sorted(local_pkgs)))
|
||||||
|
|
||||||
# Zip that list of results up into a lookup dict.
|
# Zip that list of results up into a lookup dict.
|
||||||
git_branch_lookup = dict(zip(sorted(local_pkgs), git_branch_lookup))
|
git_branch_lookup = dict(zip(sorted(local_pkgs), git_branch_lookup))
|
||||||
|
|
||||||
if VERBOSE:
|
if VERBOSE:
|
||||||
print "Found all local git branches in %0.2fs" % (time.time() - start)
|
print "Found all local git branches in %0.2fs" % (
|
||||||
|
time.time() - start)
|
||||||
|
|
||||||
tofix = set()
|
tofix = set()
|
||||||
for pkg in sorted(local_pkgs):
|
for pkg in sorted(local_pkgs):
|
||||||
git_branches = git_branch_lookup[pkg]
|
git_branches = git_branch_lookup[pkg]
|
||||||
diff = (git_branches - set([NEW_BRANCH]))
|
if NEW_BRANCH not in git_branches:
|
||||||
if diff:
|
print 'Add %s to : %s' % (NEW_BRANCH, pkg)
|
||||||
print '%s missing: %s' % (pkg, ','.join(sorted(diff)))
|
|
||||||
tofix.add(pkg)
|
tofix.add(pkg)
|
||||||
#branch_package(namespace, pkg, diff, git_branches)
|
branch_package(ns, pkg, [NEW_BRANCH], git_branches)
|
||||||
|
|
||||||
if tofix:
|
if tofix:
|
||||||
print 'Packages fixed (%s): %s' % (
|
print 'Packages fixed (%s): %s' % (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue