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

hgignore: improve regexp checks

Fixes #374

I'm not going to do any more for this issue in 0.8. The existing notification
dialogs all lockup our tools if you run them from GTK idle callbacks, where most
of the refresh functions run. So for this release users will get bug reports
when they have bad hgignore patterns.

Changeset 1c508fce19e5

Parent 3ab8198766cf

by Steve Borho

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

Change 1 of 2 Show Entire File hggtk/​hgignore.py Stacked
 
7
8
9
 
10
11
12
 
186
187
188
189
190
191
192
 
 
 
193
194
195
196
 
197
198
199
 
7
8
9
10
11
12
13
 
187
188
189
 
190
 
 
191
192
193
194
195
196
 
197
198
199
200
@@ -7,6 +7,7 @@
 import os  import gtk  import gobject +import re    from mercurial import hg, ui, match, util   @@ -186,14 +187,14 @@
  newregexp = hglib.fromutf(regexp_entry.get_text())   if newregexp == '':   return - newregexp = 're:' + newregexp   try: - match.match(self.root, '', [], [newregexp]) - except util.Abort, inst: + match.match(self.root, '', [], ['relre:' + newregexp]) + re.compile(newregexp) + except (util.Abort, re.error), inst:   gdialog.Prompt(_('Invalid regexp expression'), str(inst),   self).run()   return - self.ignorelines.append(newregexp) + self.ignorelines.append('relre:' + newregexp)   self.write_ignore_lines()   regexp_entry.set_text('')   self.refresh()