1. Sergey Antonov
  2. HgSccPackage
  3. Issues
Issue #40 new

Cloning Repository which contain sub repos fail

chen.hendrawan
created an issue

I have central repository hosted on IIS server secured with basic authentication. My repository contain sub repos.

The problem is HgScc only have authorization option for the main repo, but not for the sub repos. So pulling the sub repos will just fail.

Comments (4)

  1. Sergey Antonov repo owner

    I've not used subrepos yet, so how does it work when you clone the main repo with command line client hg.exe ? Will it ask you for username/password for each subrepo ?

    Can you please try to clone the main repo with hg.exe, so that each repo will have a default remote path with user credentials, and then try incoming/outgoing with HgSccPackage ? Will it work ?

    The problem is that I using hg.exe internaly with redirected output and if it used that way, then it won't ask for user input, because it knows, that input/output is redirected.

    I don't know a way to fix that without writing a library, that uses mercurial sources in python (like tortoisehg).

  2. chen.hendrawan reporter

    Yes, when using command line hg.exe, it will ask for username/pass for each subrepo. The behavior of the TortoiseHg is also the same.

    Clone from hg.exe, then using it from HgSccPackage also doesn't work. Incoming and outgoing work, but only showing changes on main repo. The actual push / pull will fail with this message

    [Push started]
    
    pushing to http://myuser:***@myurl.domain.com/main
    [Error: abort: http authorization required]
    pushing subrepo SourceCode-SubRepo1 to http://myuser:***/myurl.domain.com/subrepo1
    
    [Operation completed. Exit code: -1]
    
    

    I understand the problem you are facing. I'll let you know if I have an idea how to implement it.

  3. Sergey Antonov repo owner

    As a workaround you can try to use [auth] section of Mercurial.ini, which located in user home directory ("c:\Documents and Settings\Username\Mercurial.ini"). If it is not there, create it.

    Add folowing section in your Mercurial.ini:

    [auth]
    my_srv.prefix = myurl.domain.com
    my_srv.username = myuser
    my_srv.password = mypassword
    my_srv.schemes = http https
    
    

    and change myurl, myuser, mypassword to your credentials for remote repository. Here is a doc for auth: (http://www.selenic.com/mercurial/hgrc.5.html#auth)

    I've just tried that, and it works ok with HgSccPackage (and with hg.exe).

    There is also exists keyring extension for mercurial, that can store the passwords in secured store, but I've not tried it yet (http://mercurial.selenic.com/wiki/KeyringExtension)

  4. Log in to comment