This is an archive of the discontinued Mercurial Phabricator instance.

py3: change default priority and length used for sorting hooks to be compatible with python 3
AbandonedPublic

Authored by charlesetc on May 14 2020, 11:18 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

The call to sorted(hooks.values()) can on line 213 of hooks.py can raise when using
python 3. For instance, when hooks.values is `[(0, 2, b'post-commit.check-status', b''),
(None, None, b'changegroup.app-hooks', <object object at 0x7f5279885590>)]`, the error is
TypeError: '<' not supported between instances of 'NoneType' and 'int'

This fix keeps the same order that was used in python 2 without relying on comparison with
None.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

charlesetc created this revision.May 14 2020, 11:18 PM
charlesetc abandoned this revision.May 14 2020, 11:21 PM

Sorry about opening two by accident - refer to D8527