( )⚙ D10528 git: initialize `extra` to have at least the branch name for nullid

This is an archive of the discontinued Mercurial Phabricator instance.

git: initialize `extra` to have at least the branch name for nullid
ClosedPublic

Authored by mharbison72 on Apr 27 2021, 7:53 PM.

Details

Summary

Otherwise, this crashes trying to convert to local encoding:

...
  File "/mnt/c/Users/Matt/hg/mercurial/logcmdutil.py", line 333, in _show
    branch = ctx.branch()
  File "/mnt/c/Users/Matt/hg/mercurial/context.py", line 675, in branch
    return encoding.tolocal(self._changeset.extra.get(b"branch"))
  File "/mnt/c/Users/Matt/hg/mercurial/encoding.py", line 181, in tolocal
    if isasciistr(s):
TypeError: a bytes-like object is required, not 'NoneType'

This was originally reported to the thg bug tracker.

https://foss.heptapod.net/mercurial/tortoisehg/thg/-/issues/5629

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mharbison72 created this revision.Apr 27 2021, 7:53 PM
pulkit accepted this revision.Apr 28 2021, 6:29 AM
This revision is now accepted and ready to land.Apr 28 2021, 6:29 AM