Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 34100:08346a8fa65f
cleanup: rename "matchfn" to "match" where obviously a matcher
We usually call matchers either "match" or "m" and reserve "matchfn"
for functions.
Differential Revision: https://phab.mercurial-scm.org/D641
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 05 Sep 2017 15:06:45 -0700 |
parents | abf91c4f9608 |
children | a39dce4a76b8 |
comparison
equal
deleted
inserted
replaced
34099:ba6e14f9a2d8 | 34100:08346a8fa65f |
---|---|
475 dest = cmdutil.makefileobj(repo, dest) | 475 dest = cmdutil.makefileobj(repo, dest) |
476 if not prefix: | 476 if not prefix: |
477 prefix = os.path.basename(repo.root) + '-%h' | 477 prefix = os.path.basename(repo.root) + '-%h' |
478 | 478 |
479 prefix = cmdutil.makefilename(repo, prefix, node) | 479 prefix = cmdutil.makefilename(repo, prefix, node) |
480 matchfn = scmutil.match(ctx, [], opts) | 480 match = scmutil.match(ctx, [], opts) |
481 archival.archive(repo, dest, node, kind, not opts.get('no_decode'), | 481 archival.archive(repo, dest, node, kind, not opts.get('no_decode'), |
482 matchfn, prefix, subrepos=opts.get('subrepos')) | 482 match, prefix, subrepos=opts.get('subrepos')) |
483 | 483 |
484 @command('backout', | 484 @command('backout', |
485 [('', 'merge', None, _('merge with old dirstate parent after backout')), | 485 [('', 'merge', None, _('merge with old dirstate parent after backout')), |
486 ('', 'commit', None, | 486 ('', 'commit', None, |
487 _('commit if no conflicts were encountered (DEPRECATED)')), | 487 _('commit if no conflicts were encountered (DEPRECATED)')), |
2487 fm.data(matched=False) | 2487 fm.data(matched=False) |
2488 fm.end() | 2488 fm.end() |
2489 | 2489 |
2490 skip = {} | 2490 skip = {} |
2491 revfiles = {} | 2491 revfiles = {} |
2492 matchfn = scmutil.match(repo[None], pats, opts) | 2492 match = scmutil.match(repo[None], pats, opts) |
2493 found = False | 2493 found = False |
2494 follow = opts.get('follow') | 2494 follow = opts.get('follow') |
2495 | 2495 |
2496 def prep(ctx, fns): | 2496 def prep(ctx, fns): |
2497 rev = ctx.rev() | 2497 rev = ctx.rev() |
2528 except error.LookupError: | 2528 except error.LookupError: |
2529 pass | 2529 pass |
2530 | 2530 |
2531 ui.pager('grep') | 2531 ui.pager('grep') |
2532 fm = ui.formatter('grep', opts) | 2532 fm = ui.formatter('grep', opts) |
2533 for ctx in cmdutil.walkchangerevs(repo, matchfn, opts, prep): | 2533 for ctx in cmdutil.walkchangerevs(repo, match, opts, prep): |
2534 rev = ctx.rev() | 2534 rev = ctx.rev() |
2535 parent = ctx.p1().rev() | 2535 parent = ctx.p1().rev() |
2536 for fn in sorted(revfiles.get(rev, [])): | 2536 for fn in sorted(revfiles.get(rev, [])): |
2537 states = matches[rev][fn] | 2537 states = matches[rev][fn] |
2538 copy = copies.get(rev, {}).get(fn) | 2538 copy = copies.get(rev, {}).get(fn) |