Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

history: enable file patterns

Strings entered in the 'File Patterns' field can be prefixed with one of the
mercurial match types (glob, re, path, relglob, relpath, relre). If not prefixed,
the default will either glob or path depending on the presense of one or more of
the characters '[{*?'.

File history mode is enabled when there is only one pattern item, it is of type
path or defaults to path and it is not an existing directory.

Changeset d7b6868a7161

Parent a5e0e8f5bce9

by Sune Foldager

Changes to 3 files · Browse files at d7b6868a7161 Showing diff from parent a5e0e8f5bce9 Diff from another changeset...

 
12
13
14
15
 
16
17
18
 
428
429
430
431
432
433
434
435
 
 
 
 
 
 
 
 
436
437
438
 
12
13
14
 
15
16
17
18
 
428
429
430
 
 
 
 
 
431
432
433
434
435
436
437
438
439
440
441
@@ -12,7 +12,7 @@
 import pango  import StringIO   -from mercurial import ui, hg, cmdutil, commands, extensions, util +from mercurial import ui, hg, cmdutil, commands, extensions, util, match    from tortoisehg.util.i18n import _  from tortoisehg.util import hglib, paths @@ -428,11 +428,14 @@
  ftitle(_('%s branch') % branch)   elif self.filter == 'custom':   ftitle(_('custom filter')) - if len(pats) == 1 and not os.path.isdir(pats[0]): - opts['filehist'] = pats[0] - self.graphview.refresh(self.graphcol, pats, opts) - else: - self.graphview.refresh(False, pats, opts) + npats = hglib.normpats(pats) + if len(npats) == 1: + kind, name = match._patsplit(npats[0], None) + if kind == 'path' and not os.path.isdir(name): + opts['filehist'] = name + self.graphview.refresh(self.graphcol, [name], opts) + if not opts.get('filehist'): + self.graphview.refresh(False, npats, opts)   elif self.filter == 'all':   ftitle(None)   self.graphview.refresh(self.graphcol, None, opts)
 
418
419
420
421
422
423
424
425
 
418
419
420
 
 
421
422
423
@@ -418,8 +418,6 @@
    stack = []   get = util.cachefunc(lambda r: repo.changectx(r).changeset()) - if pats != None: - pats = ['path:'+p for p in pats]   changeiter, matchfn = cmdutil.walkchangerevs(repo.ui, repo, pats, get, opts)   for st, rev, fns in changeiter:   if st == 'iter':
 
10
11
12
13
 
14
15
16
 
136
137
138
139
140
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
142
143
 
10
11
12
 
13
14
15
16
 
136
137
138
 
 
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
@@ -10,7 +10,7 @@
 import traceback  import shlib  import time -from mercurial import hg, ui, util, extensions, commands, hook +from mercurial import hg, ui, util, extensions, commands, hook, match    from i18n import _  import paths @@ -136,8 +136,22 @@
  # May already be canonical   canonpats.append(f)   return canonpats - - + +def normpats(pats): + 'Normalize file patterns' + normpats = [] + for pat in pats: + kind, p = match._patsplit(pat, None) + if kind: + normpats.append(pat) + else: + if '[' in p or '{' in p or '*' in p or '?' in p: + normpats.append('glob:' + p) + else: + normpats.append('path:' + p) + return normpats + +  def mergetools(ui, values=None):   'returns the configured merge tools and the internal ones'   if values == None: