如何将编号附加到 Mercurial 提交?

发布于 2024-09-16 06:59:17 字数 164 浏览 4 评论 0原文

在进行 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

蝶…霜飞 2024-09-23 06:59:17

没有特殊字段。唯一的技巧是,当您不使用详细视图时,仅显示第一行。

然而,一些与 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.

橘亓 2024-09-23 06:59:17

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.

时光匆匆的小流年 2024-09-23 06:59:17

提交消息可能很好,因为正如 Matthew 指出的那样,您的项目跟踪器可能有能力找到这些消息。例如,Redmine 会在您的提交消息中查找诸如“Fixed #578”之类的短语,并自动更新相关问题。

您还可以使用 revsets(新的查询语言)按提交消息中的关键字进行搜索。

如果您仍然不喜欢将它们放入提交消息中,您可以标记提交。
也许是这样的:

hg tag defect-578 -m "Problem with the widget on the left side of the thing fixed."

然后可以根据需要将标签推送到上游、修改或删除。

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:

hg tag defect-578 -m "Problem with the widget on the left side of the thing fixed."

The tag can then be pushed upstream, modified, or removed as necessary.

此刻的回忆 2024-09-23 06:59:17

查看 mercurial 标签
对于我来说,我总是只是将缺陷编号放在注释中,然后在需要查找它时使用 log 命令:

hg log -k 'defect#'

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:

hg log -k 'defect#'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文