Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TortoiseHg and multiple branches in one repo

I really can't figure it out. I'm new to Mercurial and TortoiseHg. Read alot of docs and still cant find answer. I know that one way of branching is making a copy. Thats clear but there is another way called "named branches" but this is one thing i can't understand.

For example i I have new repo first branch is called "default". Then i added 3 branches called "test1...3". Now in repo browser i have tree like this:

* test3
|
* test2
|
* test1
|
* default

how to achieve something like this:

* test 1 
|  _______* test 2
| | ______* test 3
| ||
|//
* default

How to after branching to "branch3" switch back to "default". After adding some things and commit and switch back to "branch3"?

like image 505
Krzysiek Grzembski Avatar asked Jul 16 '10 10:07

Krzysiek Grzembski


People also ask

How to change branch in Mercurial?

From the main menu, select Hg | Mercurial | Update to. In the Switch Working Directory dialog that opens, specify the target working directory: To switch to another line of development, choose Branch and select the desired branch from the list.

How do you create a new branch in Heartgold?

Creating a branch Branching can happen by committing a changeset within a single repository or by committing diverging changes in distinct (but related) repositories. Two repositories are said to be related if they were once cloned from the same repository but later may have diverged.

What is TortoiseHg workbench?

Workbench. TortoiseHg is a Windows shell extension and a series of applications for the Mercurial distributed revision control system. It also includes a Gnome/Nautilus extension and a CLI wrapper application so the TortoiseHg tools can be used on non-Windows platforms.

What is TortoiseHg used for?

TortoiseHg is a set of graphical tools and a shell extension for the Mercurial distributed revision control system. On Windows, TortoiseHg consists of a shell extension, which provides overlay icons and context menus in your file explorer, and a command line program named thg.exe which can launch the TortoiseHg tools.


2 Answers

If you need an advice in TortoiseHG specifically too - then you have to open repository explorer and choose "update" for the head of branch you are interested to switch to.

like image 107
zerkms Avatar answered Oct 01 '22 06:10

zerkms


You should make a

hg update -C default

between each named branch creation.

Beware of the -C option, which also discards local changes, so be careful before using this command.

like image 26
VonC Avatar answered Oct 01 '22 06:10

VonC