Beanstalk post-receive web hook
Beanstalk post-receive web hook

This is a Beanstalk post-receive hook that will automatically close review
requests as "submitted" after a push. To determine which review requests should
be closed, it scans through each commit's commit message for the following
strings (case-insensitive): "Reviewed at <reviewboard_url>/r/<id>" or "Review
request #<id>".

This is what the JSON payload looks like:
http://support.beanstalkapp.com/customer/portal/articles/75753-trigger-a-url-on-commit-with-web-hooks

Testing Done:
Test carried out on git and svn repos.

1) Push with the review request id in the commit message. Review request
   closed.
2) Push without a review request id in the commit message. (Review request
   closed based on the commit_id for git and error looged for svn)
3) Push with non existent review request id. (Error: Review request does not
   exist)
4) Push with review id in the message that is already submitted. (logged a
   warning: request id already submitted.)
5) Push with review id in the message that has been marked as discarded.
   (review request marked as submitted.)

Reviewed at https://reviews.reviewboard.org/r/5698/

chipx86/reviewboard,custode/reviewboard,bkochendorfer/reviewboard,beol/reviewboard,sgallagher/reviewboard,bkochendorfer/reviewboard,reviewboard/reviewboard,sgallagher/reviewboard,KnowNo/reviewboard,KnowNo/reviewboard,brennie/reviewboard,bkochendorfer/reviewboard,beol/reviewboard,davidt/reviewboard,beol/reviewboard,custode/reviewboard,1tush/reviewboard,KnowNo/reviewboard,1tush/reviewboard,1tush/reviewboard,1tush/reviewboard,1tush/reviewboard,davidt/reviewboard,brennie/reviewboard,custode/reviewboard,custode/reviewboard,sgallagher/reviewboard,brennie/reviewboard,beol/reviewboard,1tush/reviewboard,1tush/reviewboard,KnowNo/reviewboard,davidt/reviewboard,davidt/reviewboard,reviewboard/reviewboard,chipx86/reviewboard,brennie/reviewboard,1tush/reviewboard,chipx86/reviewboard,1tush/reviewboard,reviewboard/reviewboard,reviewboard/reviewboard,chipx86/reviewboard,bkochendorfer/reviewboard,sgallagher/reviewboard