Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Mercurial标记规则引擎_Java_Mercurial_Tortoisehg_Rule Engine - Fatal编程技术网

Java Mercurial标记规则引擎

Java Mercurial标记规则引擎,java,mercurial,tortoisehg,rule-engine,Java,Mercurial,Tortoisehg,Rule Engine,Mercurial中是否有标记规则引擎?我想强制使用标记名。例如标签版本2.4…我想有一个方法来强制“版本”在标签名称中,无论什么 谢谢。您有pretag钩子,可以在上面添加一些验证。您有关于此线程的一些信息: .hg/hgrc: goodtag_re = r'(ver-\d+\.\d+\.\d+|tip)$' def localbadtag(ui, repo, hooktype, node, **kwargs): assert(hooktype == 'pretag')

Mercurial中是否有标记规则引擎?我想强制使用标记名。例如标签版本2.4…我想有一个方法来强制“版本”在标签名称中,无论什么


谢谢。

您有
pretag
钩子,可以在上面添加一些验证。您有关于此线程的一些信息:

.hg/hgrc

goodtag_re = r'(ver-\d+\.\d+\.\d+|tip)$' def localbadtag(ui, repo,
    hooktype, node, **kwargs):
    assert(hooktype == 'pretag')
    re_ = re.compile(goodtag_re)
    if not re_.match(tag):
        ui.warn('Invalid tag name "%s".\n' % tag)
        ui.warn('Use one of tip, ver-xx.xx.xx\n')
        return True
    return False
pretag.badtagname=python:.hg/hgcheck.py:localbadtag

.hg/hgcheck.py

goodtag_re = r'(ver-\d+\.\d+\.\d+|tip)$' def localbadtag(ui, repo,
    hooktype, node, **kwargs):
    assert(hooktype == 'pretag')
    re_ = re.compile(goodtag_re)
    if not re_.match(tag):
        ui.warn('Invalid tag name "%s".\n' % tag)
        ui.warn('Use one of tip, ver-xx.xx.xx\n')
        return True
    return False
这里有一些钩子示例:

您还可以考虑在发布管理过程中强制执行这些规则,即提供构建脚本,其中版本被视为输入、验证,并且<强> >版本< /强>然后被添加到最终的标签名。它不会限制人们直接使用无效名称进行标记,但通常情况下,自动发布/构建过程会节省大量时间和错误,因此没有人愿意回到手动过程

理想情况下,这一切都集中在您的CI服务器上,因此您不需要依赖于需要在每个Mercurial安装中安装的自定义挂钩