Branch-per-feature, and it's another world

http://weblogs.java.net/blog/fabriziogiudici/archive/2009/08/branchperfeatur.html


パーソナルブランチ超便利だよね,という話は置いといて,ここに注目。

[Mistral:Projects/jrawio/src] fritz% hg branches --closed | sort
2.0                          540:0dd29bb11aec
default                      556:a9e02a1f070d (inactive)
fix-JRW-120                  562:a82b7ed21b94
fix-JRW-162-and-JRW-194      367:e75735d2055c
fix-JRW-187-1                408:1a0cbede4cb8 (closed)
fix-JRW-203-1                558:92fcd592cc51
fix-JRW-6                    560:eb9031bec74c
nef-fixes-1                  555:9ecb14834d0f (inactive)
src                          286:d9692def01a2 (closed)

"(closed)"って何すか?と思い調べてみたら,これを見つけた。

4. Closing branches
Mercurial version 1.2 introduced the ability to close a branch. This can be done by running the following commands:

hg up -C badbranch
hg commit --close-branch -m 'close badbranch, this approach never worked'
hg up -C default # switch back to "good" branch

This creates a closing changeset which typically contains no modifications to tracked files. Closing changesets can be identified by close=1 in the changeset's extra field.

Once a branch is closed it will display the closed state in hg branches. A closed branch is not considered active and will not be displayed if the --active option is given to branches.

% hg branches
default                       12:d52ed2ac9127
badbranch                 11:cd3e11a024bf (closed)
% hg branches --active
default                       12:d52ed2ac9127

In addition hg heads now accepts the --active option and will not display any heads that have been marked closed if the option is specified.

PruningDeadBranches - Mercurial


なんですとー!!Mercurial 1.2からcommitオプションに"--close-branch"なんての出来たんだ!?と,一見便利そうなんだけど,Closed Branchって何か制約が設けられるんだろうか?あとClosedから再開するとか,そこらへんどこに書いてるんだろう...。


(追記)実際にためしてみたけど,--close-branchオプションを付けてコミットすると,そのブランチに(closed)属性がつくだけで特になにがどうってことはないようだ。
その証拠に,(closed)なブランチにさらにコミットする事ができた。コミットしたら,勝手に(closed)属性は消えちゃった。つまりは,ちょっとした目印なんだろな。