D1556: py3: use pycompat.bytestr() in place of str()

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Thu Nov 30 07:25:53 EST 2017


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

INLINE COMMENTS

> cmdutil.py:828
>          'H': lambda: hex(node),
> -        'R': lambda: str(repo.changelog.rev(node)),
> +        'R': lambda: pycompat.bytestr(repo.changelog.rev(node)),
>          'h': lambda: short(node),

'%d' is preferred if the value type is known.

(applies to the other integer values.)

> cmdutil.py:830
>          'h': lambda: short(node),
> -        'm': lambda: re.sub('[^\w]', '_', str(desc))
> +        'm': lambda: re.sub('[^\w]', '_', pycompat.bytestr(desc))
>          }

Perhaps this can be `desc or ''`.

`hg archive '%m'` creates a directory "None", but which is probably
a bug.

REPOSITORY
  rHG Mercurial

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

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


More information about the Mercurial-devel mailing list