Tortoise Hg integration

Sujith Gokuladas's Avatar

Sujith Gokuladas

30 Oct, 2013 12:40 AM

Hello,
Sorry for being a total noob.

I am not sure whether I can configure Hglab to use windows authentication without the LDAP plugin. The network admin confirmed to me that we are not using LDAP; but just the AD Authentication (I am not a networking guy. So not sure what it means).

What I really want is to do is to use Tortoise Hg as the client and disable the authentication prompt every time when someone tries to do a push either by storing the password somewhere or disabling the login entirely. Is it something that I can do?

  1. Support Staff 1 Posted by Anton Gogolev on 30 Oct, 2013 06:29 AM

    Anton Gogolev's Avatar

    Hi, Sujith!

    Active Directory is essentially an LDAP server and these terms
    can generally be used interchangeably. With that in mind, you can add a
    Catalog that connects to your Active Directory Domain Controller so that
    you'll be authenticating in HgLab with your domain credentials.

    Now, there's a catch. Mercurial itself does not support Windows
    authentication, which means you must enter your password every time you do
    "push" to the server. To solve this, you'll have to enable
    "mercurial_keyring" extension in TortoiseHg Workbench - File - Settings -
    Global Settings tab - Extensions pane. This will securely keep your
    password in your Local User area and you'll not have to type it manually
    every time.

  2. 2 Posted by Sujith Gokulada... on 30 Oct, 2013 06:58 AM

    Sujith Gokuladas's Avatar

    Thank you for the detailed answer. I will try that tomorrow. Also, could you please tell me how to integrate Hglab with Jenkins? We have to do an automated check in after every release build and mercurial plugin for Jenkins will not support http authentication.

  3. Support Staff 3 Posted by Anton Gogolev on 30 Oct, 2013 07:18 AM

    Anton Gogolev's Avatar

    Anytime!

    I never tried Jenkins, but there are two options that may work fro you.

    First, you can try "embedding" login and password directly in the URL ( http://login:[email blocked]/url ), but Internets say that Jenkins may want to re-clone the repository each and every time (this might have been fixed already, don't really know).

    Second option is a bit more complicated. You need to go to C:\Users\<name-of-the-user-that-Jenkins-windows-service-is-running-under> and create a file called .hgrc (note the leading dot) with the following contents:

    [auth]
    hglab.prefix = http://hostname.com/hglab/hg
    hglab.username = ...
    hglab.password = ...
    

    Note that hglab.prefix should contain the URL of your HgLab installation up to the /hg segment, not deeper (that is, it should not include neither project slug nor repository name). And username and password are these of the Jenkins user in HgLab.

    Hope this helps. Let me know how things work out for you.

  4. 4 Posted by Sujith on 31 Oct, 2013 10:28 PM

    Sujith's Avatar

    Thanks. That worked. But when I try to clone a specific branch, I am getting an error.

    I am migrating my hg repo to another server. So I have configured hglab in the new server, created projects. I am unable to do hg push <new url> to the new server for the first time since my repo is around 4GB. So I have logged into the new server, replaced the .hg folder in the newly created repo with the .hg folder in the old one. Now I can see all the history and branches using hglab. But when I try to pull a specific branch, I am getting the below error. I am using this command because this is what jenkins will use internally to pull a branch

    D:\Jenkins\jobs\x64>hg clone --rev somebranch --noupdate http://user:password@server:8001/hg/testproject/test D:\Jenkins\jobs\x64\workspace --debug
    using http://server:8001/hg/testproject/test
    http auth: user user, password *******
    sending capabilities command
    sending lookup command
    abort: unknown revision 'somebranch'!

  5. Support Staff 5 Posted by Anton Gogolev on 01 Nov, 2013 07:26 AM

    Anton Gogolev's Avatar

    Sujith,

    4 Gb is well over recommended limits for Mercurial. It does support
    large repositories, but working with them is really cumbersome. Plus,
    HgLab doesn't handle extremely large pushes very well -- primarily due
    to IIS restrictions.

    The `hg clone --rev` command should actually work. Could you please
    ensure that the branch you're trying to clone actually exists on the
    server (with matching case). There's also `hg clone --branch` option,
    which explicitly clones only specified _branch_, not an arbitrary
    revision.

  6. 6 Posted by Sujith Gokulada... on 01 Nov, 2013 07:34 AM

    Sujith Gokuladas's Avatar

    Hello Anton,

    Yes. The branch exists. I am unable to clone with any branch; even with the default one. At the same time, I can do hg clone without specifying any branch and the do an hg update -C <branch name>. It is very strange...

  7. Support Staff 7 Posted by Anton Gogolev on 01 Nov, 2013 07:38 AM

    Anton Gogolev's Avatar

    Sujith,

    Then we'll need to investigate logs. Take a look inside App_Data in the folder where HgLab is installed (_not_ the home directory). If there are no .txt files in there, run the following command in an Elevated command prompt:

    icacls {absolute-path-to-app_data} /grant iis_iusrs:(OI)(CI)(F)
    

    Then try hg clone --rev once more and attach the log over here.

    Thanks!

  8. 8 Posted by Sujith Gokulada... on 01 Nov, 2013 07:42 AM

    Sujith Gokuladas's Avatar

    You are being very helpful. Appreciate that... I'll try that on Monday. I can't connect to work from home

  9. 9 Posted by Sujith Gokulada... on 03 Nov, 2013 10:22 PM

    Sujith Gokuladas's Avatar

    I have setup hg web and using the same repository via both the front ends. I have run the same command using both the URLs and attached the responses. The commands can be found in the log file itself

  10. Support Staff 10 Posted by Anton Gogolev on 04 Nov, 2013 05:36 AM

    Anton Gogolev's Avatar

    Sujith,

    Thanks! I've identified the issue and will issue a fix later today. Thanks again for the cooperation.

    On 04.11.2013, at 2:22, "Sujith Gokuladas" <[email blocked]> wrote:

  11. Support Staff 11 Posted by Anton Gogolev on 04 Nov, 2013 09:46 PM

    Anton Gogolev's Avatar

    Sujith,

    My apologies. The fix is delayed a bit.

    On Monday, November 4, 2013, Anton Gogolev wrote:

  12. Support Staff 12 Posted by Anton Gogolev on 05 Nov, 2013 01:19 PM

    Anton Gogolev's Avatar

    Sujith,

    Again, sorry for the delay. A fix is available over here: http://hglabhq.com/download/0.4.6

  13. 13 Posted by Sujith Gokulada... on 05 Nov, 2013 08:48 PM

    Sujith Gokuladas's Avatar

    Anton,

    Not a problem. I was away because of the Melbourne cup yesterday. Thanks for the fix. I will try that now

  14. 14 Posted by Sujith Gokulada... on 05 Nov, 2013 10:03 PM

    Sujith Gokuladas's Avatar

    Hello Anton,
    I am sorry, but that fix is still not working for me. Please find the error message and log file attached:

    adding changesets
    adding manifests
    transaction abort!
    rollback completed
    abort: 00manifest.i@57e28636b27f: unknown parent!

  15. Support Staff 15 Posted by Anton Gogolev on 06 Nov, 2013 04:22 AM

    Anton Gogolev's Avatar

    Sujith,

    Oh well. Now that you're hitting the longest-standing bug in HgSharp (sic) there is an incentive for me to actually fix it.

    The problem here is that there are some edge-cades when HgSharp doesn't handle "subgraph" clones/pulls particularly well. As a workaround you can try cloning/pulling the entire repository (that is, without "--rev" or "--branch" arguments) (with an added benefit of using an "--uncompressed" option), but I'm not sure if Jenkins supports this use-case.

    In any case, apologies for the inconvenience. Will try to resolve this ASAP.

    On 06.11.2013, at 2:04, "Sujith Gokuladas" <[email blocked]> wrote:

  16. 16 Posted by Sujith Gokulada... on 06 Nov, 2013 09:24 PM

    Sujith Gokuladas's Avatar

    Hi Anton,

    Not a problem. I do have an interim solution in place. And BTW, the solution that you have suggested will not work with Jenkins

  17. Anton Gogolev closed this discussion on 28 Jun, 2014 01:08 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

12 Jan, 2023 12:25 PM
10 Jan, 2023 04:49 PM
03 Aug, 2022 01:49 PM
05 Jul, 2022 07:01 PM
28 Mar, 2022 04:42 PM

 

21 Jan, 2022 10:43 AM
20 Jan, 2022 10:45 AM
18 Jan, 2022 10:15 AM
19 Mar, 2021 06:13 PM
01 Mar, 2021 02:51 PM
01 Jan, 2021 02:19 AM