This is an archive of the discontinued Mercurial Phabricator instance.

histedit: don't assign to _ for unused values
ClosedPublic

Authored by durin42 on Jan 22 2021, 3:46 PM.

Details

Summary

I don't know what this ignored value is, but we need to not clobber
the _() function from gettext, or we get mysterious crashes instead of
internationalizing some strings in my upcoming patches.

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

durin42 created this revision.Jan 22 2021, 3:46 PM

I half-expected this to fail some linter, but I see tests/test-check-pylint.t only enables very few checks. Still, it might be good to call unused variables _unused with the _ prefix for intentionally unused?

The repo has some other uses of _ in deconstructing tuples that might similarly conflict with gettext. I wouldn’t try to go after them all without an automated check but this file has 4 other uses of mode, _ = state[b'mode']

pulkit accepted this revision.Jan 26 2021, 3:03 PM
This revision is now accepted and ready to land.Jan 26 2021, 3:03 PM
This revision was automatically updated to reflect the committed changes.