Using mercurial_keyring extension with Mercurial on Windows

Thursday, October 7, 2010 by alexandrul

Permalink

TortoiseHg ships with the mercurial_keyring extension, along with Python Keyring Lib that provides Win32CryptoKeyring for Windows 2k+, allowing secure password storage.

In order to use the mercurial_keyring extension with Mercurial, you have two choices:

  • if you have Python 2.6.6 up and running, you could install Python Keyring Lib (I had Visual C++ 2008 already installed), add {Python location}/Lib/site-packages folder to the sys.path inside the mercurial_keyring.py, and then enable the extension in mercurial.ini:
    [extensions]
    mercurial_keyring = /your/path/to/mercurial_keyring.py
  • or, just copy the following files from {TortoiseHg location}/library.zip to {Mercurial location}/library.zip:
    hgext\mercurial_keyring.pyo
    keyring\__init__.pyo
    keyring\backend.pyo
    keyring\core.pyo
    win32_crypto.pyd

    and then enable the extension in mercurial.ini:

    [extensions]
    mercurial_keyring =

It works on my machine :D, both at home and at work, on Windows 7 and Windows Server 2008 SP2 x86.