The callback gets a new "success" argument since Mercurial commit 888bd39ed555 (lock: pass "success" boolean to _afterlock callbacks, 2019-11-19).