我如何在mercurial中检查变更集,而不查找它的父级?在mercurial中,什么等同于
git show HEAD^Git-show给出了变更集元数据和差异。
发布于 2009-08-21 19:39:39
你的问题有两个部分。首先,如何同时获取变更集的元数据和差异:
hg log --patch --rev tip您可以缩短选项:
hg log -pr tip问题的第二部分是如何在不查找的情况下说出“X的父变更集”。为此,您可以使用马丁提到的parentrevspec extension。
启用扩展后,您可以执行以下操作:
hg log -pr tip^如果你不想从git的命令中重新训练你的手指,你可以给你的~/.hgrc文件添加一个别名:
[alias]
show = log -pr然后你可以使用:
hg show tip^发布于 2009-08-21 15:46:55
我想你想要hg export cset。
发布于 2013-02-09 09:10:36
与"git show HEAD^“类似的命令如下:
hg log -pr -2 # -1 (last commit), -2 - one before it, etc.或
hg exp tip^ # tip^ is similar to -r -2或者,例如,如果您想查看最后3次提交(使用diff):
hg log -pr -3: # colon means start 3 commits behind and up to tip inclusive答案有点晚了,但还是有点晚。:)
更新:显然现在HG也支持git语法:
hg exp tip^^^..tip或
hg log -pr tip~4https://stackoverflow.com/questions/1312633
复制相似问题