Changeset 57fa0272f191…
Parent 5a53dee81d1a…
by
Changes to 2 files · Browse files at 57fa0272f191 Showing diff from parent 5a53dee81d1a Diff from another changeset...
@@ -6,6 +6,7 @@ # GNU General Public License version 2, incorporated herein by reference.
import os
+import re
from mercurial import ui, util, error
@@ -676,6 +677,22 @@ self.msgte.setFocus()
return
+ linkmandatory = self.repo.ui.config('tortoisehg',
+ 'issue.linkmandatory', False)
+ if linkmandatory:
+ issueregex = self.repo.ui.config('tortoisehg', 'issue.regex')
+ if issueregex:
+ m = re.search(issueregex, msg)
+ if not m:
+ qtlib.WarningMsgBox(_('Nothing Commited'),
+ _('No issue link was found in the commit message. '
+ 'The commit message should contain an issue '
+ 'link. Configure this in the \'Issue Tracking\' '
+ 'section of the settings.'),
+ parent=self)
+ self.msgte.setFocus()
+ return False
+
commandlines = []
brcmd = []
|
@@ -762,6 +762,10 @@ 'while {1} refers to the first group and so on. If no {n} tokens'
'are found in issue.link, the entire matched string is appended '
'instead.')),
+ _fi(_('Mandatory Issue Reference'), 'tortoisehg.issue.linkmandatory', genBoolRBGroup,
+ _('When committing, require that a reference to an issue be specified. '
+ 'If enabled, the regex configured in \'Issue Regex\' must find a match '
+ 'in the commit message.')),
_fi(_('Issue Tracker Plugin'), 'tortoisehg.issue.bugtraqplugin',
(genDeferredCombo, findIssueTrackerPlugins),
_('Configures a COM IBugTraqProvider or IBugTrackProvider2 issue '
|
Loading...