From 586efb310d2f090ab19ad5adc1ee5b1ee19864e0 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Thu, 19 Feb 2015 15:10:41 +0000 Subject: [PATCH] Remove source_branch stuff, and refuse to create master branch to pre-existing repo --- .../templates/pkgdb_sync_git_branches.py | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/roles/distgit/templates/pkgdb_sync_git_branches.py b/roles/distgit/templates/pkgdb_sync_git_branches.py index 3c4f0568bd..0919969ea1 100644 --- a/roles/distgit/templates/pkgdb_sync_git_branches.py +++ b/roles/distgit/templates/pkgdb_sync_git_branches.py @@ -56,12 +56,6 @@ GIT_FOLDER = '/srv/git/rpms/' MKBRANCH = '/usr/local/bin/mkbranch' SETUP_PACKAGE = '/usr/local/bin/setup_git_package' -BRANCHES_FROM = { - 'epel7': 'f19', - 'olpc2': 'f7', - 'olpc3': 'f11', - 'master': None, -} VERBOSE = False @@ -114,23 +108,16 @@ def _create_branch(pkgname, branch): :arg branch: Name of the branch to create ''' - - if branch in BRANCHES_FROM: - branch_from = BRANCHES_FROM[branch] - else: - branch_from = 'master' - - # Fall back to branching from master. - frombranchpath = os.path.join( - GIT_FOLDER, '%s.git' % pkgname, 'refs/heads', branch_from) - if not os.path.exists(frombranchpath): - branch_from = 'master' + if branch == 'master': + print 'ERROR: Proudly refusing to create master branch. Invalid repo?' + print 'INFO: Please check %s repo' % pkgname + return branchpath = os.path.join( GIT_FOLDER, '%s.git' % pkgname, 'refs/heads', branch) if not os.path.exists(branchpath): try: - _invoke(MKBRANCH, ['-s', branch_from, branch, pkgname]) + _invoke(MKBRANCH, [branch, pkgname]) except ProcessError, e: if e.returnCode == 255: # This is a warning, not an error