[MERGE] Add add_commit_revprops hook so plugins can set their own revprops.

James Westby jw+debian at jameswestby.net
Sat Feb 21 23:51:50 GMT 2009


On Thu, 2009-02-19 at 20:53 +0000, James Westby wrote:
> Hi,
> 
> It's not currently easy for plugins to add their own revprops
> to the upcoming commit, so I implemented a hook to allow it.
> 
> The alternative to a separate hook would be making revprops
> an attribute of MutableTree so that plugins can use start_commit
> to do it.

I'm not sure about this myself.

I just wrote an implementation of commit_message_template in
bzr-builddeb. Getting passed the Commit object here is quite
nice, as it gives you all the information you need, such as
specific_files and excludes for the commit.

My use case for this is making use of the structured information
we put in debian/changelog when we fix a bug. I patched "debcommit"
to pass --fixes, but it would be nice to have it happen automatically
on "bzr commit".

I don't think the revision properties should be added if you
"bzr commit -x debian/changelog", but you can't work this out
given just the working tree.

We could extend the hook signature to include more of this information,
but that's going to be fragile.

Would it be feasible to follow the message code and add a 
revprops_callback to Commit?

Thanks,

James




More information about the bazaar mailing list