Reputation: 13
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
Upvotes: 1
Views: 108
Reputation: 21473
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
Upvotes: 1