1

My default branch is very old and was not changed in the last weeks - people work on another, second branch. This means that there are big differences today. A lot of new files, a lot of files deleted, a lot of files changed. I'm trying to find out the easiest way to "replace" the default branch by that second branch. Do I really have to merge every single change? thank you

alapeno
  • 2,724
  • 6
  • 36
  • 53

1 Answers1

3

I think you're describing a situation where you have two very divergent branches: the abandoned or forgotten 'default' branch, and the active 'default2' branch. Merging these together could be difficult.

  1. If you don't want any of the changes from 'default', you could use hg backout to create anti-changesets for all changesets back to the common ancestor of 'default' and 'default2'. Then, because 'default' will look just like an ancestor of 'default2', you should be able to merge the two together with no issues. Your developers would then begin to use 'default' as their primary development branch.
  2. You could simply close the 'default' branch and rename 'default2' to 'default' as per this SO thread.
  3. Of course, if you have a small development team and complete server control, you could strip 'default' from your repo and rename 'default2' to 'default' using Mercurial Queues.
Community
  • 1
  • 1
dls
  • 4,146
  • 2
  • 24
  • 26