How to check whether specific revision is present on some Mercurial remote?

与世无争的帅哥 提交于 2021-02-10 14:27:45

问题


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.

For Mercurial I tried the following command:

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

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?


回答1:


hg in -r REV

-r --rev REV [+] a remote changeset intended to be added

Returns 0 if there are incoming changes, 1 otherwise.


来源:https://stackoverflow.com/questions/64430285/how-to-check-whether-specific-revision-is-present-on-some-mercurial-remote

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!