Added a mercurial hook for posting review requests when pushing to central repo.

Review Request #7100 — Created March 21, 2015 and discarded — Latest diff uploaded

halvorlu
RBTools
master
rbtools

A Mercurial hook to post to Review Board on push to a central server.

The hook was designed to make posting to Review Board easy for new or inexperienced users. It allows user to post to ReviewBoard by using the ordinary "hg push", without any need to learn or install RBTools locally.

The hook only allows the push if all commits have been approved in a review requests, otherwise it rejects it and creates a review request for the (new) commits. This is similar to "rbt post", but
1. does not require the user to install RBTools locally
2. makes sure any changes pushed to the central server have been reviewed and approved
3. makes links of all references to tickets/bugs/issues, which rbt post doesn't do.
4. automatically finds the right review request to update if there are any new commits, based the commit ID and a date/author hash. This does not require the user to confirm anything, which rbt post (often) requires. This also allows the hook to recognize rebased/amended changesets, because the date/author hash is unchanged.

The hook has been tested both with some unit testing and partly in a production environment.
Unit testing also included testing communication with server, which revealed a few issues that have been fixed.
I wasn't sure how these unit tests should be included in the test suites for RBTools, so I've left them out for now.

Loading...