如何检查某些Mercurial遥控器上是否存在特定的修订版本? [英] How to check whether specific revision is present on some Mercurial remote?

查看:53
本文介绍了如何检查某些Mercurial遥控器上是否存在特定的修订版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Git SCM中,我使用以下命令来检查某个遥控器上是否存在特定的修订版本:

In Git SCM I'm using the following command to check whether a specific revision is present on some remote:

git fetch <remote> <revision> -q --dry-run

如果命令的退出代码为零,则表示该修订版存在于遥控器上.

If the exit code of the command is zero that means the revision is present on the remote.

对于Mercurial,我尝试了以下命令:

For Mercurial I tried the following command:

hg pull <remote> -r <revision> -q

它可以工作,但是问题在于,如果存在于远程而不是本地,它实际上会拉动修订.是否有与Git相同的-dry-run 选项,或在Mercurial中以其他方式执行此操作,该方法不执行指定修订的提取,而仅检查它是否存在于指定版本中.远程吗?

It works but the problem is that it actually pulls the revision if present on the remote, but not locally. Is there an equivalent of the --dry-run option for Git, or some other way to do it in Mercurial which does not perform pulling of the specified revision, but only checks whether it is present on the remote?

推荐答案

-r REV中的汞

-r --rev REV [+]打算添加的远程变更集

Returns 0 if there are incoming changes, 1 otherwise.

这篇关于如何检查某些Mercurial遥控器上是否存在特定的修订版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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