问题
I have a hg repo. I used to have a short-lived branch named "1.x", which stemmed off "default" at a certain point in time. It got closed because I didn't feel the need to use that branch at that particular moment.
However, I was forced to abandon the way "default" was developing and create another branch at a much earlier revision, way before creating "1.x". I was unable to use the name "1.x", so I called it "oldui". The branch "default" was closed as a dead end. I feel uncomfortable with such naming. 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 would I go about achieving this, if there is a way at all?
回答1:
You made two big mistakes:
You don't read docs: "Standard practice recommends that primary development take place on the 'default' branch." and "2.1. Don't use a name other than default for your main development branch" part from "What not to do" Mercurial wiki
You don't read docs:
hg help branch
states clearly
Unless -f/--force is specified, branch will not let you set a branch name that already exists, even if it's inactive.
回答2:
You can just reuse the branch name, although hg branch
will complain, which you can override with -f
.
来源:https://stackoverflow.com/questions/9599724/replace-the-content-of-a-hg-branch