如何检查远程存储库是否包含标记? [英] How to check if remote repository contains tag?

查看:158
本文介绍了如何检查远程存储库是否包含标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从命令行检查远程存储库中是否存在本地标记 mytag 并且指向同一变更集?

How do I check from the command-line whether a local tag mytag exists on a remote repository and is pointing to the same changeset?

我相信一旦我解决了以下子问题,我就可以解决这个问题:

I believe that I can solve this problem once I solve the following sub-problems:


  1. 如何知道哪个变更集添加了标签?

  2. 如何确定远程存储库是否包含更改集?

  1. How do I find out which changeset added a tag?
  2. How to find out whether a remote repository contains a changeset?


推荐答案

根据上述子问题,我相信以下内容将有效:

Based on the aforementioned sub-questions, I believe the following will work:

// Get the changeset that the tag points to
def referenced = $(hg id -q -r ${tag})

// Get the changeset that added the tag
def addedTag = $(hg log -r children(${referenced}) --template {node})

// Check whether the remote repository contains the changeset
def tagFound = $(hg outgoing -r ${addedTag})

这篇关于如何检查远程存储库是否包含标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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