检查HG中的变更集 [英] Examining a changeset in HG

查看:113
本文介绍了检查HG中的变更集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何查看mercurial中的变更集而不查找其父项?在mercurial中,相当于

  git show HEAD ^ 

Git-show给出了变更集元数据和差异。

解决方案

<你的问题有两个部分。首先,如何一次获得变更集的元数据和差异:

  hg log --patch --rev tip 

您可以缩短选项:

  hg log -pr提示

问题的第二部分是如果不查找它,就会说X的父变更集。为此,您可以使用Martin提到的 parentrevspec扩展



启用扩展程序后,您可以执行以下操作:

  hg log -pr tip ^ 

您可以将别名添加到〜/ .hgrc 文件,如果你不想从git的命令重新训练你的手指:

  [别名] 
show = log - 您可以使用:





$ p> hg show tip ^


How can I examine a changeset in mercurial without looking up its parent? In mercurial, what's the equivalent of

git show HEAD^

Git-show gives the changeset metadata and the diff as well.

解决方案

Your question has two parts. First, how to get the metadata and diff for a changeset all at once:

hg log --patch --rev tip

You can shorten the options:

hg log -pr tip

The second part of the question is how to say "the parent changeset of X" without looking it up. For that you can use the parentrevspec extension Martin mentioned.

Once you enable the extension you can do:

hg log -pr tip^

You could add an alias to your ~/.hgrc file if you don't want to retrain your fingers from git's command:

[alias]
show = log -pr

Then you could use:

hg show tip^

这篇关于检查HG中的变更集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆