Changes between Version 2 and Version 3 of BranchingPolicy
- Timestamp:
- 08/26/10 14:21:02 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BranchingPolicy
v2 v3 1 = Branching Policy = 2 1 3 CKAN is stored in a mercurial repo and we have devised this policy to cope with coding, releasing and maintaining versions of the software. 2 4 … … 5 7 '''default''' branch is for future releases - New features go here. Bug fixes should always go here as well as the other branches. 6 8 7 '''metastable''' branch is for releases deployed to ckan.net and similar servers. These servers get new features first. Sometimes there are issues to be resolved with these new features. It usually lags `default`.9 '''metastable''' branch is for beta releases and proper releases deployed to ckan.net and similar servers. These servers get new features first. Sometimes there are issues to be resolved with these new features. It usually lags `default`. 8 10 9 '''stable''' branch is for very stable code - major releases. It usually lags `metastable`.11 '''stable''' branch is the latest proper release. It usually lags `metastable`. 10 12 11 '''ultrastable''' branch is for the most stable code - major releases,one behind `stable`.13 '''ultrastable''' branch is for the most stable code - proper releases, always one behind `stable`. 12 14 13 (From now on) merges must only be done in the DOWN direction (in the direction `default`->`metastable`->`stable`->`ultrastable`) and only when you release. This means that you would release `default` to `metastable` with a merge, and from `metastable` to `stable`, but you must not merge `metastable` to `default`, for example. And not when you simply fix a bug. 15 This arrangement can be seen to be like a waterfall of changesets. `default` has the most, `metastable` is a subset of `default`, `stable` a subset of `metastable` etc. This is a reasonably accurate view, even working with these edge cases: 14 16 15 The problem with merging in the other direction is that bugfix changesets on `metastable` may well be mixed in with changesets incrementing the minor digit of the version number. The version number on the `default` branch may already have a higher major version and you don't want to overwrite it with the `metastable` changeset. When you merge you can't pick and choose changesets - you have all up to a certain one - so you can't merge in this direction. 17 * A branch may need a bug-fix, and this would need to be merged to all branches UP the waterfall. Even if the bug-fix no longer applies on `default` (because say the file in question has been completely refactored in the meantime), this isn't a bad thing, since you'll be alerted when you get a conflict during the merge. 18 * Along with the bug-fix it may be worth adding a version change (e.g. `1.2` to `1.2.1`). This would also be usefully merged with the bug-fix up the waterfall, indicating the bug is fixed in these places too. 16 19 17 You might have written a bugfix in `default` that you want in `metastable` too, but don't want the rigmorole of releasing all the code in `default` at this point. In this case, don't merge - the problem with merging, is that you may well pull half-finished features from `default`. 20 So the rule is: 21 * Releases are merged DOWN the waterfall: `default` -> `metastable` -> `stable` -> `ultrastable` 22 * Bug fixes should be merged UP the waterfall: `default` <- `metastable` <- `stable` <- `ultrastable` 18 23 19 The solution (instead of `hg merge`) is to `hg transplant` (or `hg export` + `hg import`) particular changesets from one branch to another. 24 (One future problem with this system might arises when you want a change on a branch which you don't want merged up the waterfall and wouldn't cause a conflict. We've not thought of a use case like this, so we will deal with not being able to merge upwards, it if it arises.) 25 26 It is good to merge all branch changes up the waterfall to the top, so that you don't forget to apply a bugfix to a higher branch. In the process of doing this, you close the branch heads on the way. So when you push new changesets onto a branch (aside from `default`), you should expect to be reminded to create a new head (`hg push -f`). 27 28 If you merge bug fixes the wrong way (i.e. down the waterfall), you may well end up with unstable changesets merged as well as the bugfix! If you find you have fixed a bug on a higher branch than necessary and want to have the bugfix on a lower branch, then you need to 'transplant' the changeset, rather than 'merge'. 29 30 == Transplanting changesets == 31 32 When you merge, you can't cherry pick changesets - you have to take all of them up to a certain one. So you have to be slightly more cunning to 'transplant' a bugfix changeset down the waterfall. 33 34 You can either use the mercurial 'transplant' extension or use `hg export` and `hg import`. 20 35 21 36 == 'tip' note ==