最近我从SVN切换到了Mercurial.现在我想知道如何根据良好实践在Mercurial中实现我想要的分支工作流程,希望其他开发人员了解存储库中会发生什么.
这是工作流程:
我的问题不是这个工作流程是否合适(我猜这不是根本错误的).我的问题是,我在Mercurial中实现这一点的方式是否可以被视为良好实践或是否有更好的机会.
所以这就是我计划在Mercurial中管理分支的方式......
从具有单个分支的存储库开始,该分支包含当前版本系列1.x的代码:
$ hg init
$ echo "hello world" > file1.txt
$ hg ci -A -m "Initial commit of 1.x code"
Run Code Online (Sandbox Code Playgroud)
开始处理2.x版本:
$ hg branch 2.x
$ hg ci -m "Create new branch for 2.x development"
$ echo "Big new feature for 2.x" > file2.txt
$ hg ci -A -m "Add big new feature"
Run Code Online (Sandbox Code Playgroud)
同时,在当前版本系列(1.x)中做一些工作:
$ hg up default
$ echo "Minor adjustments specific for 1.x" > file3.txt
$ hg ci …Run Code Online (Sandbox Code Playgroud)