sha1dc: import latest version from github
After the recent SHA1 news, the attacks are serious enough we should
be more proactive. This code will at least allow detection of attacks
early. It's already widely deployed in Git.
This is git revision
855827c583bc30645ba427885caa40c5b81764d2 of the
sha1collisiondetection repo[0], with most of the files omitted. A
follow-up change will introduce Python bindings for this code.
0: https://github.com/cr-marcstevens/sha1collisiondetection
Differential Revision: https://phab.mercurial-scm.org/D7814
transaction: add a `hasfinalize` method
The method allow code to check if an existing callback exists. It allow them to
skip potentially expensive setup for a callback.
Differential Revision: https://phab.mercurial-scm.org/D7832