How to make TortoiseHg pull certain branch only?

21,715

Solution 1

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.

Solution 2

hg pull -r <branch name>  

For more info: https://stackoverflow.com/questions/5796908/mercurial-how-can-i-import-only-some-changesets-from-a-repository/5798221#5798221

Share:
21,715

Related videos on Youtube

mark
Author by

mark

Updated on September 18, 2022

Comments

  • mark
    mark almost 2 years

    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.

    • Admin
      Admin over 12 years
      Have you tried doing this from the workbench? I'm not using Hg at work, so I can't test it here.
    • Admin
      Admin over 12 years
      I am using the workbench all the time and I could find any option there which would tell it to pull the current or the certain branch only.
  • mark
    mark over 12 years
    I have edited the question body.
  • Helgi
    Helgi about 12 years
    This seem to be working. I'd suggest to specify . as the branch name, this way it will always refer to the branch you're working on.
  • George Marian
    George Marian over 8 years
    Just a note for others: There is a Synchronize entry under the Repository menu. That is not the entry you are looking for.
  • Dany
    Dany about 8 years
    @GeorgeMarian ha good point. It would be much better if the one under View was called "Sync options" or "Synchronisation". That option does not actually perform the action of Synchronise :)
  • StayOnTarget
    StayOnTarget almost 8 years
    @Kaymar it is -b for pulling a branch. -r is for a revision. From help for hg pull: -r --rev REV [+] a remote changeset intended to be added ... -b --branch BRANCH [+] a specific branch you would like to pull