Mercurial > public > mercurial-scm > hg
diff mercurial/match.py @ 26014:a5f62af29517
merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 12 Aug 2015 17:01:50 -0500 |
parents | c4ccf2d394a7 9ac4e81b9659 |
children | 56b2bcea2529 |
line wrap: on
line diff
--- a/mercurial/match.py Tue Jan 27 11:26:27 2015 -0800 +++ b/mercurial/match.py Wed Aug 12 17:01:50 2015 -0500 @@ -394,7 +394,8 @@ def __init__(self, root, cwd, patterns, include, exclude, default, auditor, ctx, listsubrepos=False, badfn=None): init = super(icasefsmatcher, self).__init__ - self._dsnormalize = ctx.repo().dirstate.normalize + self._dirstate = ctx.repo().dirstate + self._dsnormalize = self._dirstate.normalize init(root, cwd, patterns, include, exclude, default, auditor=auditor, ctx=ctx, listsubrepos=listsubrepos, badfn=badfn) @@ -410,7 +411,13 @@ kindpats = [] for kind, pats, source in self._kp: if kind not in ('re', 'relre'): # regex can't be normalized + p = pats pats = self._dsnormalize(pats) + + # Preserve the original to handle a case only rename. + if p != pats and p in self._dirstate: + kindpats.append((kind, p, source)) + kindpats.append((kind, pats, source)) return kindpats