fdaines
fdaines

Reputation: 1246

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

How 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.

Upvotes: 0

Views: 110

Answers (1)

bialix
bialix

Reputation: 21473

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.

Upvotes: 2

Related Questions