mercurial/match.py
changeset 26014 a5f62af29517
parent 25958 c4ccf2d394a7
parent 26000 9ac4e81b9659
child 26587 56b2bcea2529
equal deleted inserted replaced
26013:38f92d12357c 26014:a5f62af29517
   392     """
   392     """
   393 
   393 
   394     def __init__(self, root, cwd, patterns, include, exclude, default, auditor,
   394     def __init__(self, root, cwd, patterns, include, exclude, default, auditor,
   395                  ctx, listsubrepos=False, badfn=None):
   395                  ctx, listsubrepos=False, badfn=None):
   396         init = super(icasefsmatcher, self).__init__
   396         init = super(icasefsmatcher, self).__init__
   397         self._dsnormalize = ctx.repo().dirstate.normalize
   397         self._dirstate = ctx.repo().dirstate
       
   398         self._dsnormalize = self._dirstate.normalize
   398 
   399 
   399         init(root, cwd, patterns, include, exclude, default, auditor=auditor,
   400         init(root, cwd, patterns, include, exclude, default, auditor=auditor,
   400              ctx=ctx, listsubrepos=listsubrepos, badfn=badfn)
   401              ctx=ctx, listsubrepos=listsubrepos, badfn=badfn)
   401 
   402 
   402         # m.exact(file) must be based off of the actual user input, otherwise
   403         # m.exact(file) must be based off of the actual user input, otherwise
   408         self._kp = super(icasefsmatcher, self)._normalize(patterns, default,
   409         self._kp = super(icasefsmatcher, self)._normalize(patterns, default,
   409                                                           root, cwd, auditor)
   410                                                           root, cwd, auditor)
   410         kindpats = []
   411         kindpats = []
   411         for kind, pats, source in self._kp:
   412         for kind, pats, source in self._kp:
   412             if kind not in ('re', 'relre'):  # regex can't be normalized
   413             if kind not in ('re', 'relre'):  # regex can't be normalized
       
   414                 p = pats
   413                 pats = self._dsnormalize(pats)
   415                 pats = self._dsnormalize(pats)
       
   416 
       
   417                 # Preserve the original to handle a case only rename.
       
   418                 if p != pats and p in self._dirstate:
       
   419                     kindpats.append((kind, p, source))
       
   420 
   414             kindpats.append((kind, pats, source))
   421             kindpats.append((kind, pats, source))
   415         return kindpats
   422         return kindpats
   416 
   423 
   417 def patkind(pattern, default=None):
   424 def patkind(pattern, default=None):
   418     '''If pattern is 'kind:pat' with a known kind, return kind.'''
   425     '''If pattern is 'kind:pat' with a known kind, return kind.'''