Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8.1, 0.8.2, and 0.8.3

datamine: validate regexp expressions before use

Refs #383

Prevents these messages on stderr:
grep: invalid match pattern: nothing to repeat

Changeset 801cc31baabb

Parent 1c508fce19e5

by Steve Borho

Changes to one file · Browse files at 801cc31baabb Showing diff from parent 1c508fce19e5 Diff from another changeset...

Change 1 of 2 Show Entire File hggtk/​datamine.py Stacked
 
9
10
11
 
12
13
14
 
333
334
335
 
 
 
 
 
 
 
336
337
338
 
9
10
11
12
13
14
15
 
334
335
336
337
338
339
340
341
342
343
344
345
346
@@ -9,6 +9,7 @@
 import pango  import Queue  import threading +import re    from mercurial import util   @@ -333,6 +334,13 @@
  _('You must provide a search expression'), self).run()   regexp.grab_focus()   return + try: + re.compile(retext) + except re.error, e: + gdialog.Prompt(_('Invalid regular expression'), + _('Error: %s') % str(e), self).run() + regexp.grab_focus() + return     q = Queue.Queue()   args = [self.repo.root, q, 'grep']