Replace hg branch contents

I have a hg repo. I used to have a short-lived branch named "1.x", which at some point in time was interrupted by "default". It closed because I did not feel the need to use this branch at this particular moment.

However, I was forced to abandon how the "default" was designed and created another branch with a much earlier version before creating the "1.x". I could not use the name "1.x", so I named it "oldui". The default branch was closed as a dead end. I feel uncomfortable with that name. You can see this in detail in my repository: https://bitbucket.org/mingos/umbracms/changesets/6a3c7980a219

I would like to be able to reuse the branch name "1.x" instead of the cryptic "oldui". How can I achieve this if there is a way at all?

+1
source share
2 answers

You made two big mistakes:

  • You do not read the documents: "Standard practice recommends that primary development take place on the default branch. And" 2.1. Do not use a name other than the default for your main development branch from the "What not to do" Mercurial wiki

  • You do not read documents: hg help branch clearly indicates

If the -f / -force option is not specified , the branch will not allow you to set the name of the branch that already exists, even if it is inactive.

+2
source

You can simply reuse the name of the branch, although the hg branch will complain that you can override with -f .

+7
source

Source: https://habr.com/ru/post/985070/


All Articles