我可以从 bzr post/pre-commit hook 更改已修复的错误吗?
我想使用提交后/提交前挂钩来填充提交的固定错误字段。 我想这样做,因为我们使用 redmine,并且在 redmine 中,如果您在提交消息中放入固定的 #132,它会将 bug #132 标记为已修复。 因此,为了让开发人员不会忘记填写已修复的错误字段,我想为他做这件事。
那么这可能吗?我可以更改已修复的错误字段吗?
谢谢
I would like to use a post/pre-commit hook to fill the fixed bug field of a commit.
I would like to do that because we use redmine and in redmine if you put fixed #132 in your commit message, it will mark bug #132 as fixed.
So to make the developer doesnt forget to fill the fixed bug field, i would like to do it for him.
SO is that possible? can i change the fixed bug field?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
修复了作为修订元数据的一部分保存的错误属性,因此您只能在实际提交之前更新此更改。也就是说,提交后挂钩对你不起作用。预提交钩子根据文档在“计算提交之后但完成之前”调用。实际上,在这个阶段,新的修订版本已经存储到存储库中,因此您无法更改它。但是,如果您想坚持新版本应包含特定的修复属性,则可以从预提交挂钩引发异常,从而有效地中止提交。
因此,我认为不可能使用提交前/提交后挂钩修改修订元数据。不过,您可能想在这里询问 bzr 开发人员:https://answers.launchpad.net/bzr/+addquestion
Fixed bug property saved as part of the revision metadata, so you can update this change only before actual commit. That said post-commit hook won't work for you. Pre-commit hook according to the documentation invoked "after a commit is calculated but before it is completed". Actually at this stage new revision is already stored to repository, so you can't change it. But you can raise an exception from pre-commit hook and thus effectively abort the commit if you want to insist that new revision should contain specific fixes attributes.
So, I think it's not possible to modify revision metadata with pre/post commit hooks. You may want to ask bzr developers here though: https://answers.launchpad.net/bzr/+addquestion