We are using mercurial in a single repository. We have a master
branch and a develop
branch (as well as feature branches, but they aren't germane to the issue at hand).
We tag the master
branch with releases (5.1.0.102, etc). We do our development on develop
.
But now we want to fix a bug in a previous version. There are a lot of questions here on SO about this issue, but none of them seem to explain what I want to do.
What I want to do is this:
- Update to the point where we released (say 6.1.1)
- Fix a number of bugs in that release
- Label that resulting code state as (6.1.2)
- Do a build of this new 6.1.2 codebase.
- Migrate those fixes into the
develop
branch - Do this in such a way that I can go back to 6.1.2 and fix bugs there if need be.
I can't seem to do this via updating. I tried to update to the 6.1.1, create a branch, and go from there, but that brings in the tip of the master
branch, includ开发者_开发技巧ing all subsequent changes.
Is there a standard way of doing this? Did I explain that correctly so you guys get what I need to do? It seems like this is a pretty common thing to do.
You don't need to explicitly create a branch. The way I would do it is this:
- Update to the point where you released (6.1.1 in the master branch).
- Make changes and commit them.
- Tag the latest commit in master as 6.1.2.
- Pull those changes into the develop branch.
- Continue working.
If you need to make more changes, then simply repeat the above but using the 6.1.2 tag in the master branch.
You really shouldn't need to create a named branch unless you truly want to have a full-out branch. What you probably want to do is:
- update to 6.1.1
- make the edits
- commit (will create a new un-named branch)
- tag that new revision as 6.1.2.
- You can then merge that edit into your develop branch
As long as you are updating to a revision earlier than the tip on the Master branch, the commit will make a new branch off of it.
This will leave the version tagged so you can easily get back to it.
精彩评论