Make another branch default?

后端 未结 4 533
萌比男神i
萌比男神i 2020-12-25 12:20

I have a Mercurial repo at Bitbucket and on my local machine, both are mirrors, up to date. I created a feature branch, reflected in both repos. I did all my work in the fea

4条回答
  •  长情又很酷
    2020-12-25 12:56

    I wanted to do just what you described and hunted around until I found an answer which uses the revert command to do just what you describe. Here is the code I used:

    hg revert --all --rev ${1}

    hg commit -m "Restoring branch ${1} as default"

    where ${1} is the number of the revision or the name of the branch. These two lines are actually part of a bash script, but they work fine on their own if you want to do it manually.

    This is useful if you need to add a hot fix to a release branch, but need to build from default (until we get our CI tools right and able to build from branches and later do away with release branches as well).

提交回复
热议问题