Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is this right? Merging between stable and default branches in Mercurial using TortoiseHg

I'm new to Mercurial, and I'm using the Stable/Default branching system. We're all on Windows here, and I'm trying to get everyone else to work in this system. We're all using TortoiseHg. I'm trying to document how to Merge changes into stable and tag releases, but I've only been using Mercurial for about three weeks, so I'm not even sure I'm doing this correctly. Also, TortoiseHg seems to be missing a few options available from the command line. But, I need to make this work from the Windows shell, or it won't get adopted here.

All of our programming work is done in default, and the stable branch is used only for releases of the software. One thing that leads me to believe I'm doing something wrong is that, after every merge, I have to re-make the stable branch. Is that normal? Seems counter-intuitive.

Below is the procedure I wrote up. Please feel free to point out my idiocy or ask any questions. And thank you in advance for any comments.

On my laptop, there are two directories for each project. The devel directory stores a clone of the default branch,

===============

Merging the branches and creating a stable release, TortoiseHg

-- Commit in the devel repository.

-- Open the devel local directory.

-- Start HgWorkbench.

-- Click the latest stable version of the stable branch.

-- Select Merge with local...

-- Synchronize and push changes to the remote repository.

-- Go to the local stable repository.

-- Synchronize and pull from the remote repository.

-- Update to the latest default branch. Picking "update to tip" should be best.

-- TortoiseHg -> commit. Commit to branch "stable." You'll need to re-create a new branch. When it asks, select "Restart branch."

-- Open HgWorkbench and add a tag for the latest stable version. Example "Version X.X"

-- Synchronize and push to the remote repository. Use the Options button in the Sync dialog box to bring up the "sync options" dialog. In the bottom field labeled "Branch", type "stable"

-- Return to the local "devel" repository.

-- Synchronize and pull from the remote repository. Use the Options button in the Sync dialog box to bring up the "sync options" dialog. In the bottom field labeled "Branch", make sure the field is blank. Otherwise, it will default to the "stable" branch.

like image 647
user1372617 Avatar asked May 03 '12 15:05

user1372617


1 Answers

There's no need for the second clone to achieve what you want and I think that it adds complexity where it isn't needed.

This is what I'd do:

  1. Have a single clone of the repository
  2. Commit in the default branch
  3. Start HgWorkbench
  4. Right click the latest changeset on the stable branch
  5. Choose Update... in the pop up menu and press the Update button in the pop up window (use the default options)
  6. Right click the latest changeset in the default branch
  7. Choose Merge with local...
  8. If the working directory status is shown to be clean (it should be) then click the Next button
  9. If there are no merge conflicts (again, there shouldn't be if you do no development in stable) click the Next button again
  10. Enter a commit message and click the Commit button and the press Finish on the next step
  11. Right click the last changeset in the stable branch and choose Tag..., enter the tag name and press the Add button.
  12. Right click the last changeset in the default branch and choose Update... using the default options again

You've now got a tagged stable branch and are back on the default branch to continue development. When you're ready to release a new stable version then repeat the steps above from step 3.

like image 93
Steve Kaye Avatar answered Sep 20 '22 06:09

Steve Kaye