D4588: py3: fix kwargs handling in hgext/fastannotate.py

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Fri Sep 14 18:13:05 EDT 2018


indygreg requested changes to this revision.
indygreg added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> commands.py:212-217
> +        opts[r'text'] = True
>  
>      # check if we need to do prefetch (client-side)
> -    rev = opts.get('rev')
> +    rev = opts.get(r'rev')
>      if util.safehasattr(repo, 'prefetchfastannotate') and rev is not None:
> +        paths = list(_matchpaths(repo, rev, pats, pycompat.byteskwargs(opts)))

Shouldn't we be doing the ``pycompat.byteskwargs()` at the beginning of the function and using regular string literals on the keys we set?

> commands.py:246-257
> +    rev = opts.get(r'REV') or ui.config('fastannotate', 'mainbranch')
>      if not rev:
>          raise error.Abort(_('you need to provide a revision'),
>                            hint=_('set fastannotate.mainbranch or use --rev'))
>      if ui.configbool('fastannotate', 'unfilteredrepo'):
>          repo = repo.unfiltered()
>      ctx = scmutil.revsingle(repo, rev)

Ditto.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4588

To: pulkit, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel


More information about the Mercurial-devel mailing list