If you want to deploy post-review with some site specific customizations 
(e.g. add support for a custom in house SCM) there are only a few options:

    * Privately fork post-review and try and sync all the changes that
      occur in "trunk" into your version
    * add a wrapper script around post-review, e.g. rename post-review
      to postreview.py (python does not allow hypens "-" in
      module/library names), import postreview in your tool and then
      monkey patch in your changes. The rename can be handled in
      setup.py when "building"

Neither solution is optimal but this is the price you pay if you want 
private custom versions :-(

I don't have a solution to the above but I have some ideas on making it 
suck slightly less by making either option easier to deal with. For 
instance take the case where one needs to add in support for a custom 
SCM. You need to add a new class (subclassed from SCMClient) and then 
modify determine_client() to add it to the list of SCM's.

    * With the forked approach you have to edit determine_client().
    * With the wrapper approach you have to copy the existing
      determine_client() into your wrapper, modify it then monkey patch
      the original.

Either way you have to be prepared to follow the trunk version in case 
determine_client() changes.

What do people think of the following ideas:

1) move the tuple of SCM clients into a global variable.
E.g. instead of:

    # Try to find the SCM Client we're going to be working with.
    for tool in (SVNClient(), CVSClient(), GitClient(), MercurialClient(),
                 PerforceClient(), ClearCaseClient()):


scm_tuple=(SVNClient(), CVSClient(), GitClient(), MercurialClient(),
           PerforceClient(), ClearCaseClient())
def determine_client():
    # Try to find the SCM Client we're going to be working with.
    for tool in scm_tuple:

This makes monkey patching the list easier, you just update the global 
from outside.

2) modify the trunk version of post-review to change the formatting that 
is used in the tuple (list) of SCM clients to make it easier to edit the 
list. E.g.:


This makes it easier to modify the code if you decide to fork the 
script. You can re-order, add, or remove very easily. Diffs show up very 

Does this appeal to anyone? #1 above would make my life easier. I wanted 
to get a feel from a wide audience before posting a for patch for review 
where it may not be seen by so many people.


You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to