Replace the content of a hg branch

£可爱£侵袭症+ 提交于 2019-12-23 03:54:07

问题


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:

  1. 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

  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!