Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

hgignore: send insertion requests through a common function

Changeset 55efeddd70ba

Parent a7d29ff8d01f

by Steve Borho

Changes to one file · Browse files at 55efeddd70ba Showing diff from parent a7d29ff8d01f Diff from another changeset...

 
142
143
144
145
146
147
148
149
150
151
 
164
165
166
167
 
168
169
170
 
 
 
 
 
 
 
 
171
172
173
 
187
188
189
190
 
191
192
 
 
193
194
195
196
197
198
 
199
200
201
 
 
 
202
203
204
205
206
207
208
209
210
211
212
 
142
143
144
 
 
 
 
145
146
147
 
160
161
162
 
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
 
191
192
193
 
194
195
 
196
197
198
199
200
201
202
 
203
204
 
 
205
206
207
208
209
210
211
 
 
212
 
213
214
215
@@ -142,10 +142,6 @@
    def customContextMenuRequested(self, point):   'context menu request for unknown list' - def trigger(text): - self.ignorelines.append('glob:'+text) - self.writeIgnoreFile() - self.refresh()   point = self.unknownlist.mapToGlobal(point)   row = self.unknownlist.currentRow()   if row < 0: @@ -164,10 +160,18 @@
  for f in filters:   action = menu.addAction(_('Ignore ') + hglib.tounicode(f))   action.localtext = f - action.wrapper = lambda f=f: trigger(f) + action.wrapper = lambda f=f: self.insertFilter(f, False)   self.connect(action, SIGNAL('triggered()'), action.wrapper)   menu.exec_(point)   + def insertFilter(self, pat, isregexp): + if isregexp: + self.ignorelines.append('relre:' + pat) + else: + self.ignorelines.append('glob:' + pat) + self.writeIgnoreFile() + self.refresh() +   def setGlobFilter(self, qstr):   'user selected an unknown file; prep a glob filter'   self.recombo.setCurrentIndex(0) @@ -187,26 +191,25 @@
  if newfilter == '':   return   if self.recombo.currentIndex() == 0: - newfilter = 'glob:' + newfilter + test = 'glob:' + newfilter   try: - match.match(self.repo.root, '', [], [newfilter]) + match.match(self.repo.root, '', [], [test]) + self.insertFilter(newfilter, False)   except util.Abort, inst:   qtlib.WarningMsgBox(_('Invalid glob expression'), str(inst),   parent=self)   return   else: - newfilter = 'relre:' + newfilter + test = 'relre:' + newfilter   try: - match.match(self.repo.root, '', [], [newfilter]) - re.compile(newfilter) + match.match(self.repo.root, '', [], [test]) + re.compile(test) + self.insertFilter(newfilter, True)   except (util.Abort, re.error), inst:   qtlib.WarningMsgBox(_('Invalid regexp expression'), str(inst),   parent=self)   return - self.ignorelines.append(newfilter) - self.writeIgnoreFile()   self.le.clear() - self.refresh()     def refresh(self):   uni = hglib.tounicode