Hg(Mercurial SCM)和通知-如何获取项目名称和编辑电子邮件主题? [英] Hg (Mercurial SCM) and Notify - How to get project name and edit email subject?

查看:100
本文介绍了Hg(Mercurial SCM)和通知-如何获取项目名称和编辑电子邮件主题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有Notify扩展名的Hg(1.6.4),并且尝试在电子邮件主题上使用项目名称覆盖变更集模板. 我阅读了汞模板帮助",但没有找到用于获取项目名称的特定标签.

I'm using Hg(1.6.4) with Notify extension and I am trying to override the changeset template with project name on email subject. I read the "hg template help" and I not found a specific tag to get the project name.

{webroot}和{root}标记具有所有路径,而我只需要PROJECT名称,即:

The {webroot} and {root} tags got all path and I wanted PROJECT name only, i.e:

/home/USER/repo/PROJECT/rev

/home/USER/repo/PROJECT/rev

是否可以仅提取项目名称? 是否有任何标记或模板可用于解析并获取项目名称?

Is it possible to extract only PROJECT name? Is there any tag or template to parser and to get the project name?

推荐答案

取消注释hgrc文件中的 strip 变量

Uncomment the strip variable in hgrc file

#If you want to use a shorter repo-name, you can strip off components at the beginning.
#For example to strip off /usr/local/hg/repos from /usr/local/hg/repos/code use
strip = 3

并使用这样的模板来编辑电子邮件主题:

And use a template like this to edit the email subject:

template = Subject: {webroot|strip}\n
 details:     {webroot}/rev/{node|short}
 branches:    {branches}
 changeset:   {rev}:{node|short}
 user:        {author}
 date:        {date|date}
 description: {desc}\n

这篇关于Hg(Mercurial SCM)和通知-如何获取项目名称和编辑电子邮件主题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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