branch = M.currentBranch()
# Parsing the branch
- parsedbranch = tools.parseBranch(branch, self.C.get('wording.branchRegex'))
+ parsedbranch = tools.parseBranch(branch)
if not parsedbranch:
raise Exception('Could not extract issue number from %s' % branch)
issue = parsedbranch['issue']
# Tracker issue number.
issuenb = args.issue
if not issuenb:
- parsedbranch = tools.parseBranch(M.currentBranch(), self.C.get('wording.branchRegex'))
+ parsedbranch = tools.parseBranch(M.currentBranch())
if not parsedbranch:
raise Exception('Could not extract issue number from %s' % M.currentBranch())
issuenb = parsedbranch['issue']
branch = args.branch
# Extra test to see if the commit message is correct. This prevents easy typos in branch or commit messages.
- parsedbranch = tools.parseBranch(branch, self.C.get('wording.branchRegex'))
+ parsedbranch = tools.parseBranch(branch)
if parsedbranch or branch != M.get('stablebranch'):
message = M.git().messages(count=1)[0]
if not args.issue:
M = self.Wp.resolve()
if M:
- parsedbranch = parseBranch(M.currentBranch(), self.C.get('wording.branchRegex'))
+ parsedbranch = parseBranch(M.currentBranch())
if parsedbranch:
issue = parsedbranch['issue']
else:
smartSearch = C.get('smartHeadCommitSearch')
# Parsing the branch
- parsedbranch = parseBranch(branch, C.get('wording.branchRegex'))
+ parsedbranch = parseBranch(branch)
if parsedbranch:
issue = 'MDL-%s' % (parsedbranch['issue'])
else:
raise Exception('Cannot create a patch from a detached branch')
# Parsing the branch
- parsedbranch = parseBranch(branch, C.get('wording.branchRegex'))
+ parsedbranch = parseBranch(branch)
if not parsedbranch:
raise Exception('Could not extract issue number from %s' % branch)
issue = 'MDL-%s' % (parsedbranch['issue'])
raise Exception('Cannot update the tracker when on detached branch')
# Parsing the branch
- parsedbranch = parseBranch(branch, C.get('wording.branchRegex'))
+ parsedbranch = parseBranch(branch)
if not parsedbranch:
raise Exception('Could not extract issue number from %s' % branch)
issue = 'MDL-%s' % (parsedbranch['issue'])
os.umask(oldumask)
-def parseBranch(branch, pattern):
- pattern = re.compile(pattern, flags=re.I)
+def parseBranch(branch):
+ pattern = re.compile(C.get('wording.branchRegex'), flags=re.I)
result = pattern.search(branch)
if not result:
return False