fastannotate: fix perfhack with the new annotate wrapper

The new wrapper may pass aopts=None, which could be troublesome if perfhack
is enabled. Fix it by using the default aopts instead.
This commit is contained in:
Jun Wu 2016-11-30 21:22:52 +00:00
parent d93c9f9d97
commit fdfba9b17d

View File

@ -29,7 +29,7 @@ from . import (
cmdtable = {}
command = cmdutil.command(cmdtable)
def _matchpaths(repo, rev, pats, opts, aopts):
def _matchpaths(repo, rev, pats, opts, aopts=facontext.defaultopts):
"""generate paths matching given patterns"""
perfhack = repo.ui.configbool('fastannotate', 'perfhack')
@ -204,7 +204,7 @@ def _annotatewrapper(orig, ui, repo, *pats, **opts):
# check if we need to do prefetch (client-side)
rev = opts.get('rev')
if util.safehasattr(repo, 'prefetchfastannotate') and rev is not None:
paths = list(_matchpaths(repo, rev, pats, opts, aopts=None))
paths = list(_matchpaths(repo, rev, pats, opts))
repo.prefetchfastannotate(paths)
return orig(ui, repo, *pats, **opts)