Mar*_*tos 10 mercurial mercurial-queue
如果我一直在编写代码并忘记创建补丁系列,我该如何回顾性地创建补丁系列?到目前为止,唯一想到的是:
# Prepare and test the first batch of changes.
$ hg qrecord -m 'first batch' 1.patch
$ hg qnew -m 'stash downstream changes' stash-1.patch
$ hg qdelete -k temp-1.patch
$ make hello
cc hello.c -o hello
hello.c: In function ‘main’:
hello.c:4: error: syntax error at end of input
make: *** [hello] Error 1
$ echo '}' >> hello.c
$ make hello
cc hello.c -o hello
$ hg qrefresh
# Recover the stashed changes.
$ patch -p1 < .hg/patches/last.patch
# And around we go again!
$ hg qrecord -m 'second batch' 2.patch
$ hg qnew -m 'stash downstream changes' stash-2.patch
$ hg qdelete -k stash-2.patch
$ make hello
...
Run Code Online (Sandbox Code Playgroud)
这种非常麻烦的方法也是危险的.我可能会忘记-k接通qdelete,此时我会将我的前额撞到砖墙上几分钟,或者在qrecord操作过程中我可能会包含太多或太少.
有没有更好的办法?
(我真正喜欢的是能够hg qpop在我想要分割的补丁之前,并使用当前不存在的命令hg qunrecord,以交互方式将补丁从补丁中吸收到我的工作目录中.一旦我开心了随着变化,hg qnew -f可以在旧的前面挤出一个新的补丁.)
该MQTutorial解释如何分割补丁.因此,您可以从当前工作中创建补丁并将其拆分为多个补丁.
| 归档时间: |
|
| 查看次数: |
3958 次 |
| 最近记录: |