开发者

Enable Bazaar plugin operation for a specific branch (not for any branch)

开发者 https://www.devze.com 2023-03-13 05:03 出处:网络
Ho开发者_运维问答w can I write a post_commit (like) plugin that is executed only when a specific branch is commited?.

Ho开发者_运维问答w can I write a post_commit (like) plugin that is executed only when a specific branch is commited?.

Right now I have written a plugin in "~/.bazaar/plugins/" directory, but the problem is that the plugin is executing when any branch in the repository is commited.

The idea is to trigger a call to a Continuous Integration server (Hudson) to automatically build the project-job when a revision is commited

Thanks.


There is no automatic way to associate a plugin to specific branch, but you can use configuration files (either branch.conf or locations.conf) to control the behavior of your plugin. So your plugin only should open the branch config and read some option from there, for example:

my_plugin_post_commit = enabled

And if required option is present in branch config then you execute required operations, otherwise your plugin simply exits and that's all.

0

精彩评论

暂无评论...
验证码 换一张
取 消