Remove source_branch stuff, and refuse to create master branch to pre-existing repo
This commit is contained in:
parent
9b5b3b531d
commit
586efb310d
1 changed files with 5 additions and 18 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue