Updated for mercurial 4.7 compatibility
Created originally on Bitbucket by Andrew Fischer
Was already merged in Bitbucket before import, marked as merged by the import user
Turns out 4.7 now requires the command class to be imported from registrar.py