# HG changeset patch # User Martin von Zweigbergk # Date 1454735372 28800 # Node ID d3f1b7ee5e7091afa7bf8059013ddfb3b385a37c # Parent a2be6f0f58fb0f79fa1b92fb76eb537ffe59039a match: rename "narrowmatcher" to "subdirmatcher" (API) I keep mistaking "narrowmatcher" for narrowhg's narrowmatcher. "subdirmatcher" seems more to the point anyway. diff -r a2be6f0f58fb -r d3f1b7ee5e70 hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py Wed Feb 03 18:59:35 2016 +0000 +++ b/hgext/largefiles/overrides.py Fri Feb 05 21:09:32 2016 -0800 @@ -963,7 +963,7 @@ if subrepos: for subpath in sorted(ctx.substate): sub = ctx.workingsub(subpath) - submatch = match_.narrowmatcher(subpath, matchfn) + submatch = match_.subdirmatcher(subpath, matchfn) sub._repo.lfstatus = True sub.archive(archiver, prefix, submatch) @@ -1011,7 +1011,7 @@ for subpath in sorted(ctx.substate): sub = ctx.workingsub(subpath) - submatch = match_.narrowmatcher(subpath, match) + submatch = match_.subdirmatcher(subpath, match) sub._repo.lfstatus = True sub.archive(archiver, prefix + repo._path + '/', submatch) diff -r a2be6f0f58fb -r d3f1b7ee5e70 mercurial/archival.py --- a/mercurial/archival.py Wed Feb 03 18:59:35 2016 +0000 +++ b/mercurial/archival.py Fri Feb 05 21:09:32 2016 -0800 @@ -331,7 +331,7 @@ if subrepos: for subpath in sorted(ctx.substate): sub = ctx.workingsub(subpath) - submatch = matchmod.narrowmatcher(subpath, matchfn) + submatch = matchmod.subdirmatcher(subpath, matchfn) total += sub.archive(archiver, prefix, submatch) if total == 0: diff -r a2be6f0f58fb -r d3f1b7ee5e70 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Wed Feb 03 18:59:35 2016 +0000 +++ b/mercurial/cmdutil.py Fri Feb 05 21:09:32 2016 -0800 @@ -1142,7 +1142,7 @@ # node2 (inclusive). Thus, ctx2's substate won't contain that # subpath. The best we can do is to ignore it. tempnode2 = None - submatch = matchmod.narrowmatcher(subpath, match) + submatch = matchmod.subdirmatcher(subpath, match) sub.diff(ui, diffopts, tempnode2, submatch, changes=changes, stat=stat, fp=fp, prefix=prefix) @@ -2254,7 +2254,7 @@ for subpath in sorted(wctx.substate): sub = wctx.sub(subpath) try: - submatch = matchmod.narrowmatcher(subpath, match) + submatch = matchmod.subdirmatcher(subpath, match) if opts.get('subrepos'): bad.extend(sub.add(ui, submatch, prefix, False, **opts)) else: @@ -2283,7 +2283,7 @@ for subpath in sorted(wctx.substate): sub = wctx.sub(subpath) try: - submatch = matchmod.narrowmatcher(subpath, match) + submatch = matchmod.subdirmatcher(subpath, match) subbad, subforgot = sub.forget(submatch, prefix) bad.extend([subpath + '/' + f for f in subbad]) forgot.extend([subpath + '/' + f for f in subforgot]) @@ -2340,7 +2340,7 @@ if subrepos or matchessubrepo(subpath): sub = ctx.sub(subpath) try: - submatch = matchmod.narrowmatcher(subpath, m) + submatch = matchmod.subdirmatcher(subpath, m) if sub.printfiles(ui, submatch, fm, fmt, subrepos) == 0: ret = 0 except error.LookupError: @@ -2369,7 +2369,7 @@ if subrepos or matchessubrepo(m, subpath): sub = wctx.sub(subpath) try: - submatch = matchmod.narrowmatcher(subpath, m) + submatch = matchmod.subdirmatcher(subpath, m) if sub.removefiles(submatch, prefix, after, force, subrepos): ret = 1 except error.LookupError: @@ -2467,7 +2467,7 @@ for subpath in sorted(ctx.substate): sub = ctx.sub(subpath) try: - submatch = matchmod.narrowmatcher(subpath, matcher) + submatch = matchmod.subdirmatcher(subpath, matcher) if not sub.cat(submatch, os.path.join(prefix, sub._path), **opts): diff -r a2be6f0f58fb -r d3f1b7ee5e70 mercurial/context.py --- a/mercurial/context.py Wed Feb 03 18:59:35 2016 +0000 +++ b/mercurial/context.py Fri Feb 05 21:09:32 2016 -0800 @@ -365,7 +365,7 @@ # node1 and node2 (inclusive). Thus, ctx2's substate # won't contain that subpath. The best we can do ignore it. rev2 = None - submatch = matchmod.narrowmatcher(subpath, match) + submatch = matchmod.subdirmatcher(subpath, match) s = sub.status(rev2, match=submatch, ignored=listignored, clean=listclean, unknown=listunknown, listsubrepos=True) diff -r a2be6f0f58fb -r d3f1b7ee5e70 mercurial/match.py --- a/mercurial/match.py Wed Feb 03 18:59:35 2016 +0000 +++ b/mercurial/match.py Fri Feb 05 21:09:32 2016 -0800 @@ -334,13 +334,13 @@ m.bad = badfn return m -class narrowmatcher(match): +class subdirmatcher(match): """Adapt a matcher to work on a subdirectory only. The paths are remapped to remove/insert the path as needed: >>> m1 = match('root', '', ['a.txt', 'sub/b.txt']) - >>> m2 = narrowmatcher('sub', m1) + >>> m2 = subdirmatcher('sub', m1) >>> bool(m2('a.txt')) False >>> bool(m2('b.txt')) diff -r a2be6f0f58fb -r d3f1b7ee5e70 mercurial/scmutil.py --- a/mercurial/scmutil.py Wed Feb 03 18:59:35 2016 +0000 +++ b/mercurial/scmutil.py Fri Feb 05 21:09:32 2016 -0800 @@ -913,7 +913,7 @@ if opts.get('subrepos') or matchessubrepo(m, subpath): sub = wctx.sub(subpath) try: - submatch = matchmod.narrowmatcher(subpath, m) + submatch = matchmod.subdirmatcher(subpath, m) if sub.addremove(submatch, prefix, opts, dry_run, similarity): ret = 1 except error.LookupError: diff -r a2be6f0f58fb -r d3f1b7ee5e70 mercurial/subrepo.py --- a/mercurial/subrepo.py Wed Feb 03 18:59:35 2016 +0000 +++ b/mercurial/subrepo.py Fri Feb 05 21:09:32 2016 -0800 @@ -774,7 +774,7 @@ ctx = self._repo[rev] for subpath in ctx.substate: s = subrepo(ctx, subpath, True) - submatch = matchmod.narrowmatcher(subpath, match) + submatch = matchmod.subdirmatcher(subpath, match) total += s.archive(archiver, prefix + self._path + '/', submatch) return total