Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph

commit, settings: added back support for the linkmandatory setting

This configuration setting was available in the old GTK version of TortoiseHg
but up to this point had never been ported to PyQt.

Changeset 57fa0272f191

Parent 5a53dee81d1a

by David Golub

Changes to 2 files · Browse files at 57fa0272f191 Showing diff from parent 5a53dee81d1a Diff from another changeset...

 
6
7
8
 
9
10
11
 
676
677
678
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
679
680
681
 
6
7
8
9
10
11
12
 
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
@@ -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
763
764
 
 
 
 
765
766
767
 
762
763
764
765
766
767
768
769
770
771
@@ -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 '