問題:
I've finished working on a feature branch feature-x
. 我已經完成了功能分支feature-x
。 I want to merge results back to the default
branch and close feature-x
in order to get rid of it in the output of hg branches
. 我想將結果合併回default
分支並關閉feature-x
,以便在hg branches
的輸出中刪除它。
I came up with the following scenario, but it has some issues: 我想出了以下場景,但它有一些問題:
$ hg up default
$ hg merge feature-x
$ hg ci -m merge
$ hg up feature-x
$ hg ci -m 'Closed branch feature-x' --close-branch
So the feature-x
branch (changests 40
- 41
) is closed, but there is one new head , the closing branch changeset 44
, that will be listed in hg heads
every time: 因此, feature-x
分支(changests 40
- 41
)是封閉的,但有一個新的頭 ,關閉分支機構變更44
,將在上市hg heads
每次:
$ hg log ...
o 44 Closed branch feature-x
|
| @ 43 merge
|/|
| o 42 Changeset C
| |
o | 41 Changeset 2
| |
o | 40 Changeset 1
|/
o 39 Changeset B
|
o 38 Changeset A
|
Update : It appears that since version 1.5 Mercurial doesn't show heads of closed branches in the output of hg heads
anymore. 更新 :似乎從版本1.5 Mercurial不再顯示hg heads
輸出中的封閉分支hg heads
。
Is it possible to close a merged branch without leaving one more head? 是否有可能關閉合並的分支而不再留下一個頭? Is there more correct way to close a feature branch? 是否有更正確的方法來關閉功能分支?
Related questions: 相關問題:
- Is there a downside to this Mercurial workflow: named branch "dead" head? 這個Mercurial工作流程是否有缺點:命名分支“死”頭?
解決方案:
參考一: https://en.stackoom.com/question/9O0E參考二: https://stackoom.com/question/9O0E