如何将编号附加到 Mercurial 提交?
在进行 Mercurial 提交时如何包含缺陷号?我目前的做法是在提交消息之前加上缺陷编号,以便 QA 可以找到与每个缺陷相关的提交。
是否有一个字段或标签允许我为每个 Mercurial 提交添加一个数字?
如果没有,是否有更好的方法(比将数字放入提交消息中)将数字与提交相关联?
How do I include a defect number when doing a mercurial commit? The way that I'm currently doing it is to precede the commit message with the defect number so that QA can find the commits that relate to each defect.
Is there a field or tag that would allow me to add a number to each mercurial commit?
If not, is there a better way (than putting the number in the commit message) to associate a number with a commit?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
没有特殊字段。唯一的技巧是,当您不使用详细视图时,仅显示第一行。
然而,一些与 Mercurial 集成的软件会以各种方式解析消息。例如,Google 代码将检测对“issue n”的引用,并创建一个链接。
There are no special fields. The only trick is that only the first line appears when you're not using verbose view.
However, some software that integrates with Mercurial parses the message in various ways. For example, Google Code will detect references to "issue n", and create a link.
Mercurial 中没有标准的方法来注释缺陷 ID。要同步版本控制系统和错误跟踪软件,您通常会设置“挂钩”。这些挂钩是在执行特定操作后调用的脚本。例如,您可能有一个提交后挂钩,用于检查您的最新提交是否包含“fixed xxxx”类型的字符串,然后通过 API 调用在错误跟踪软件上自动将案例 xxxx 标记为已修复。
许多自由和开源软件和商业集成源代码修订控制+错误跟踪解决方案已经为您做到了这一点。
There is no standard way to annotate defect ids in mercurial. To sync revision control systems and bugtracking software, you usually setup 'hooks'. These hooks are scripts that get called after a certain operation has been performed. For instance, you may have a post-commit hook that checks if your latest commit contained a string of the type 'fixed xxxx', and then automatically marks the case xxxx as fixed on your bugtracking software through an API call.
Many FOSS and commercial integrated source code revision control + bugtracking solutions already do this for you.
提交消息可能很好,因为正如 Matthew 指出的那样,您的项目跟踪器可能有能力找到这些消息。例如,Redmine 会在您的提交消息中查找诸如“Fixed #578”之类的短语,并自动更新相关问题。
您还可以使用 revsets(新的查询语言)按提交消息中的关键字进行搜索。
如果您仍然不喜欢将它们放入提交消息中,您可以标记提交。
也许是这样的:
然后可以根据需要将标签推送到上游、修改或删除。
Commit messages are probably good, since as Matthew points out your project tracker likely has the capability to find these. For instance, Redmine will look for phrases like "Fixed #578" in your commit messages and automatically update the related issue.
You could also use revsets (the new query language) to search by keywords in commit message.
If you still don't like putting those in commit messages, you could tag the commit.
Perhaps something like:
The tag can then be pushed upstream, modified, or removed as necessary.
查看 mercurial 标签。
对于我来说,我总是只是将缺陷编号放在注释中,然后在需要查找它时使用
log
命令:Take a look at mercurial tags.
As for me, I always just put defect number in comment and then use
log
command when I need to find it: