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

fogcreek grep, thgrepo: avoid using thgrepo.repository from inside a thread

Changeset 5fa9e28d34c9

Parent 7e94dc7912d0

by David Golub

Changes to 2 files · Browse files at 5fa9e28d34c9 Showing diff from parent 7e94dc7912d0 Diff from another changeset...

 
10
11
12
13
 
14
15
16
 
438
439
440
441
 
442
443
444
 
470
471
472
 
473
474
475
476
 
477
478
479
 
10
11
12
 
13
14
15
16
 
438
439
440
 
441
442
443
444
 
470
471
472
473
474
475
476
 
477
478
479
480
@@ -10,7 +10,7 @@
   from mercurial import ui, hg, error, commands, match, util, subrepo   -from tortoisehg.hgqt import htmlui, visdiff, qtlib, htmldelegate, thgrepo, cmdui +from tortoisehg.hgqt import htmlui, visdiff, qtlib, htmldelegate, thgrepo, cmdui, settings  from tortoisehg.util import paths, hglib, thread2  from tortoisehg.hgqt.i18n import _   @@ -438,7 +438,7 @@
    def __init__(self, repo, regexp, ctx, inc, exc, once, recurse):   super(CtxSearchThread, self).__init__() - self.repo = thgrepo.repository(repo.ui, repo.root) + self.repo = hg.repository(repo.ui, repo.root)   self.regexp = regexp   self.ctx = ctx   self.inc = inc @@ -470,10 +470,11 @@
  unit = _('files')   total = len(ctx.manifest())   count = 0 + hasKbf = settings.hasExtension('kbfiles')   for wfile in ctx: # walk manifest   if self.canceled:   break - if self.repo.isKbf(wfile): + if hasKbf and thgrepo.isKbf(wfile):   continue   self.progress.emit(topic, count, wfile, unit, total)   count += 1
 
674
675
676
 
 
 
 
674
675
676
677
678
679
@@ -674,3 +674,6 @@
  raise   else:   f.close() + +def hasKbf(path): + return _kbfregex.match(path)