Search code examples
tortoisehgworkbench

Create two user in TortoiseHg Workbench


I work with TortoiseHg Workbench and I have two different repository with different login and password. So I am interesting in the way how to I can store and bind proper login/password with target repository ?


Solution

  • If you really said

    I have two local repositories, cloned from different (http-based) sources, which require different authentication credentials for pull-push

    you have to read hg help hgrc ([auth] setion part) or do it online and add to global (or each repo-specific) hgrc [auth] section (missing by default) with needed key=value pair

    Example:
    
    foo.prefix = hg.intevation.org/mercurial
    foo.username = foo
    foo.password = bar
    foo.schemes = http https
    

    will silently authorizes you as user foo with password bar on http://hg.intevation.org/mercurial* or https://hg.intevation.org/mercurial*. You can have intersected prefixes for different auth on different subtrees of single resource - longest matching prefix always win