This is an archive of the discontinued Mercurial Phabricator instance.

test-check-code: fail new commits which use 'atexit' instead of 'ui.atexit'
ClosedPublic

Authored by singhsrb on Oct 5 2017, 5:20 PM.

Details

Summary

Callbacks registered with 'atexit' are sometimes not called (like when
hg aborts and calls os._exit). On the other hand, callbacks registered with
'ui.atexit' are called in most cases. Therefore, encouraging the use of
'ui.atexit' by failing the test 'test-check-code.t' appropriately.

Test Plan

Ran the test 'test-check-code.t' after importing 'atexit' in one of
the py files and confirmed that the test fails.

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

singhsrb created this revision.Oct 5 2017, 5:20 PM
quark accepted this revision.Oct 5 2017, 6:33 PM
This revision was automatically updated to reflect the committed changes.