Bug fix: post-review creates unpublishable draft on submitted review requests

I went with the first suggestion (not allowing updates), but I can also look
into re-opening the issue upon publishing, if everyone likes that option better.

Fixes bug 2549.
Reviewed at http://reviews.reviewboard.org/r/3085/
Allow utf-8 in the summary or description.

This patch fixes bug 2616 and makes http_put more equivalent to http_post.

url is of <type 'unicode>; body is of <type 'str'> Somewhere in the
urllib2 package something happens like: url + body To do unicode + str,
the str is implicetly converted to unicode.  However bytes >128 cannot
be represented in unicode and post-review crashes.  eg:
u'www.reviewboard.com' + "\x81" => error The solution:
str(u'www.reviewboard.com') + "\x81" => 'www.reviewboard.com\x81'

It seems the str(url) is already in place for the http_post function,
but not for http_put.  This patch makes unicode work and makes http_put
more similar to http_post.

Fixes bug #2616
Reviewed at http://reviews.reviewboard.org/r/3133/
Update post-review for Plastic 4.0

Review Board itself has been updated to use the latest version of Plastic. This
is the equivalent change for rbtools.
Fix ClearCase base path generation

In following path:
  C:\clearcase\PROJECT_view\PROJECT

current code would extract the base path as C:\clearcase\PROJECT

This patch effectively fixes this issue by using "cleartool pwv -root"
to get view directory string length.

Reviewed at http://reviews.reviewboard.org/r/3281/
Handle modifications inside moved/copied directory for Subversion.

This change fixes an issue with post-review when a file inside a copied
path is modified (or copied/moved). In that case, 'svn info' on the leaf
path does not show 'Copied From URL' line - it is necessary to go up to
the parent path(s) to figure out the copy-from information. Once a path
with copy-from information is found, it is not necessary to go up
further.

Reviewed at http://reviews.reviewboard.org/r/3103/
Bump to version 0.4.2 dev.
Add REPOSITORY to .reviewboardrc

Without this post-review was failing when trying to create review
requests with my path. This was happening when working on the API
branch.

Reviewed at http://reviews.reviewboard.org/r/3333/
Fix path calculation and revision specification for hgsubversion client.

1. Fix calculation of base_path and path. Previous calculations would strip the
username field from the repository and then use the length of that to calculate
the base_path:
    svn://username@test.com/repo => svn://test.com/repo
                                    svn://username@test.com/repo/trunk

    base_path would then be calculated as ".com/repo/trunk" instead of "/trunk".

2. Allow users to specify a revision to diff against when posting reviews.

Two tests added, all previous tests pass.

Reviewed at http://reviews.reviewboard.org/r/3326/
Speed up Subversion by only getting repo info when necessary.

Our Subversion support was looping over all server-side Subversion
repositories in order to compare UUIDs to find a matching repository.
This was pretty aggressive, and not really needed if paths matched.

We now do two passes. The first checks the paths. If we find a matching
repository, we're good. If not, we attempt to scan UUIDs, which is more
time-consuming, but hopefully not needed often.

This should speed up Subversion in the average case, especially when
there are lots of repositories configured for Review Board.
Increase the amount of useful debug information we provide.

We now log the Python version, OS, and the current directory in the
post-review debug log. This will help reduce the amount of questions we
have to ask when collecting support data.

We also now have some helpful text saying to ignore some of the errors
shown, as they're mostly harmless.
Release RBTools 0.4.2.
Fix issues with server authentication when anonymous is disabled

* Do not try to connect server if post-review is issued with '--output-diff'
* Use relative url to get the api info in case the server is behind a reverse
  proxy, such as nginx

Fixes issues 2429 and 2430
Reviewed at http://reviews.reviewboard.org/r/2776/
Add the users HOME in the global config dict.

BUG: If the user has set up only one .reviewboardrc in his/hers home directory,
it will not be included in the search path for configs. It's contents is
returned from load_config_files() and assigned to user_configs in main. How ever
this variable is never used in parse_options().

FIX: Add the HOME path to the search path for global configs.

Reviewed at http://reviews.reviewboard.org/r/3171/
Fix for --guess-summary doesn't work when summary has newline characters in it.

Instead of blindly trusting the results of "hg log", we should replace newlines
with spaces. Used this to file many review requests that didn't work before.

Fixes bug 2703
Reviewed at http://reviews.reviewboard.org/r/3358/
Fix the copyright header in setup.py.

This was mistakingly showing the GPL. I don't know how that got here,
because everywhere else we clearly list it as MIT. Update it
accordingly.
Merge branch 'release-0.3.x'
Add the --basedir option to post-review.

This new option can be used to override the base directory generated by post-review.
Fix post-review error when svn diffs contain a delete.

post-review would try to call 'svn info' on the deleted files, and would fail. This patch causes post-review to ignore the failure, and continue.
Add bazaar support to post-review

I updated the change from http://reviews.reviewboard.org/r/1739/ which added
support for Bazaar to post-review, but is now out of date.

Testing done: Ran the unit tests included, and used it locally to submit some
changes.

Fixes bug 773.
Reviewed at http://reviews.reviewboard.org/r/3424/
Add a missing file.

I forgot to add bazaar.py when submitting the previous change.