tortoise hg - How to make TortoiseHg pull certain branch only?

25
2013-11
  • mark

    I have cloned the default branch of a big repository and now I wish to pull from the server using the TortoiseHg client.

    However, TortoiseHg proposes to pull from all the branches. Is it possible to instruct it to pull from the current branch only?

    So far I have seen suggestions to:

    • Setup a hook on the client side to reject pulls from unwanted branches
    • Check incoming revisions in TortoiseHg and only pull the ones belonging to the current branch
    • Use the Mercurial ACL extension to deny access to all the branches, but the current one.

    I dislike all of these solutions, since all of them are client based. In all of them TortoiseHg actually pulls all of the branches (even in the second, where the pulled revisions are arranged into a bundle presented in the incoming revisions view)

    Is there an hg pull -b BRANCH equivalent in TortoiseHg?

    Thanks.

    EDIT

    I know how to do all of this using the Mercurial command line client - hg.exe. This question is specifically about the TortoiseHg GUI client.

  • Answers
  • afrazier

    This can be done from the Synchronize area of the Workbench. Click the Synchronize entry on the View menu or the Synchronize toolbar icon (2 green arrows appearing to form a circle). In the bottom right pane, click Options. Enter the branch name you'd like to pull in the Branch: edit box. Finish the pull as usual.


  • Related Question

    version control - How do I prevent a "No supported authentication methods available" error when using TortoiseHg?
  • jammus

    I'm trying out Mercurial for the first time but am having problems doing a push/pull/clone with a remote server (in this case it's codebasehq.com) when using TortoiseHg.

    Here are some steps to reproduce:

    1. Download and install TortoiseHg
    2. Go to directory where I want my repository
    3. Right click -> TortoiseHg -> Clone
    4. Enter ssh://[email protected]/accountname/projectname/repositoryshortcode.hg as the source path
    5. Click Clone

    Once I've clicked Clone it pops up a error dialogue

    "PuTTY Fatal Error" "Disconnected: No supported authentication methods available."

    and when returning to the clone dialogue this error is shown:

    running ""C:\Program Files\TortoiseHg\TortoisePlink.exe" -ssh -2 [email protected] "hg -R accountname/projectname/repositoryshortcode.hg serve --stdio"" no suitable response from remote hg

    [command interrupted]

    What do I need to do to prevent this error and successfully interact with the remote repository?


  • Related Answers
  • jammus

    Clocked it. I needed to create an ssh-key pair. To do this I opened puttygen.exe and generated a key. Then I run pageant.exe and added the generated key to its list. The final stage was to log in to codebasehq and add the text of the key (from the box in puttygen labelled 'Public key for pasting...') to my profile.

    Hope this helps someone.

    (I'm going to accept my own answer but if someone can come up with a more concise answer I'll happily accept yours instead)

  • Fabian

    I just had the same error message. But in my case, the problem was an outdated Pageant version that came with TortoiseHg.

    A great trick to debug the "No supported authentication methods available" error message is to add -v in mercurial.ini

    \# Generated by TortoiseHg settings dialog
    [ui]
    username = name <[email protected]>
    ssh = "TortoisePlink.exe" -ssh -2 -batch -C -v
    

    Output:

    remote: Pageant is running. Requesting keys.
    remote: Failed to get reply from Pageant
    remote: Using username "hg".
    remote: Disconnected: No supported authentication methods available (server sent: publickey)
    no suitable response from remote hg
    

    Also see:

    http://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Mercurial

    http://confluence.atlassian.com/display/BITBUCKET/Troubleshooting+SSH+Issues