Commit 301b277d authored by MEESSEN Christophe's avatar MEESSEN Christophe
Browse files

create select_identifier function

parent 9f989b28
......@@ -165,38 +165,54 @@ def change_log():
git("commit -m", msg)
def close_feature():
"""Close the feature cycle.
def select_identifier(branchType):
"""Select the identifier to close.
Args:
branchType (str): one of "feature", "hotfix", "release" or "bugfix"
Return (str): the selected identifier or an empty string if none is selected
"""
print "Close the feature cycle..."
identifiers = get_identifiers("feature")
identifiers = get_identifiers(branchType)
if not identifiers:
print "Couldn't find any feature branche to close"
sys.exit(0)
print "Couldn't find any %s branch" % branchType
return ""
if len(identifiers) == 1:
rep = raw_input("Close feature '%s' [y/N]:" % identifiers[0])
rep = raw_input("Close %s '%s' [y/N]:" % [branchType, identifiers[0]])
if rep == 'y':
identifier = identifiers[0]
else:
sys.exit(0)
return ""
else:
print 'List of features in development:'
print '%s identifiers:' % branchType
print ' ', '\n '.join(identifiers)
identifier = raw_input("Select the feature identifier:")
if not identifier:
sys.exit(0)
identifier = raw_input("Select the %s identifier:" % branchType)
if not identifier in identifiers:
return ""
branch = "feature-%s" % identifier
return identifier
def close_feature():
"""Close the feature cycle.
"""
print "Close the feature cycle..."
identifier = select_identifier("feature")
if not identifier:
sys.exit(0)
branchName = "feature-%s" % identifier
git("checkout develop")
git("merge --no-ff", branch)
git("merge --no-ff", branchName)
rep = raw_input("Delete the locale branch %s [y/N]" % branch)
rep = raw_input("Delete the locale branch %s [y/N]" % branchName)
if rep == 'y':
git("branch -d", branch)
git("branch -d", branchName)
def close_hotfix():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment