Utility functions reusable between various mercurial extensions. Mostly handling compatibility with various Mercurial versions.