Merge branch 'release-0.6.x'
Fix handling of repository name in 'rbt status'

'rbt status' was still using the old config.get() method of pulling out the
repository name, which no longer works.

Testing Done:
Checked with pylint, test with some internal repos that can only be identified
by name.

Reviewed at https://reviews.reviewboard.org/r/5731/
Merge branch 'release-0.6.x'
Fix plumbing of --disable-proxy/ENABLE_PROXY

We had a command-line flag and config setting to disable use of HTTP(s)
proxies, but it wasn't properly plumbed through to the API transport.

Testing done:
* Ran unit tests.
* Added some debug code to check that the value was getting through correctly.

Reviewed at https://reviews.reviewboard.org/r/5747/
Use the C.UTF-8 locale for executing subprocesses.

A while back, we changed our environment for executing subprocesses from
en_US.UTF-8 to C, because not everyone has a US English locale installed on
their machine. This broke subversion diffs when filenames or the diffs
contained unicode characters. Using the C.UTF-8 locale fixes this.

Testing done:
Had someone who was encountering this issue try the code change, and they
reported that it's fixed.

Reviewed at https://reviews.reviewboard.org/r/5752/
Fix problems with "key=" lines in hgrc files.

The code that parses hgrc was assuming that all key=value lines had a non-empty
value. This failed if the config included lines that didn't.

Testing done:
Created an hgrc file with this configuration and ran rbtools commands. Saw that
the bug reproduced before the change and didn't after.

Reviewed at https://reviews.reviewboard.org/r/5748/
Revert the changes to the subprocess locales.

We originally used 'en_US.UTF-8' as the locale for executing subprocesses.
After a bug report from someone who didn't have the en_US locale on their
system, we changed it to 'C', but that broke non-ASCII commit messages with
SVN. The third try, 'C.UTF-8' isn't well supported (yet). Overall, it seems
like our original choice, 'en_US.UTF-8' is the best (least worst) of these.

Ideally this would be override-able in the config file, but the execute()
method doesn't yet have the plumbing to do this. I've added a comment to this
effect.

Testing done: Ran unit tests.

Reviewed at https://reviews.reviewboard.org/r/5772/
Fix diffing for submitted Perforce changelists.

Somewhere in my diff refactoring, a couple crucial lines for diffing the files
for edited files in submitted changelists got deleted. Trivial fix.

Fixes bug 3335.
Added Depends On field to rbt post

Added the ability to write to the Depends On field for a review through the rbt
post tool. Through the use of the flag --depends-on, one can specify review
numbers (comma separated) that the review depends on. The new flag has been
added to the rbt post manual.

Testing Done:
The manual was tested by using 'make html' to ensure that the formatting was
correct. For testing the flag, I created two fake reviews (id: 1 and 2) on my
local machine. Then I made, added, and committed a change to the reviewboard
repository. I ran the post command with the flag --depends-on 1 and checked to
ensure it added it in the web view. I then tested with --depends-on "1, 2" to
ensure it supports multiple revisions. Finally, I tested --depends-on "test" to
ensure it was checking arguments.

Bugs closed: 3074

Reviewed at https://reviews.reviewboard.org/r/5799/
Use the correct binary name for GNU diff on Solaris.

People still use Solaris! On Solaris, GNU diff is called 'gdiff'. Some of our
code (particularly in the perforce client) handled this, but the check to make
sure that we were using GNU diff didn't.

Testing done:
I haven't had access to a Solaris machine in over a decade (eep), so I couldn't
test that part, but I ran the unit tests to make sure I didn't fudge up
anything else.

Fixes bug 3334.

Reviewed at https://reviews.reviewboard.org/r/5793/
Fix posting of perforce paths.

The path behavior for rbt post was broken in a couple ways, probably for quite
some time. The first issue was that we had changed the `p4 change` usage to use
marshalled results, but the run_p4 method didn't respect the ignore_errors flag
when marshalling, and would call die(). Once I fixed this, the code that checks
the status of the changelist couldn't cope with error states. With these fixes,
_get_changelist_status will return None, which will cause parse_revision_spec
to correctly determine that the given path is not actually a revision.

Testing done:
Ran unit tests.

Fixes bug 3336.

Reviewed at https://reviews.reviewboard.org/r/5794/
Output URL of new incomplete review

If `rbt post` did create review but failed before completing it, user had to
find the incomplete review themselves (and discard or complete it manually).

This patch adds the URI to the error message so that remedy is less cumbersome.

Testing Done:
I have tested this on my local machine, where rbt fails to post commit,
reporting HTTP 400 / API error 207. (Previous review request #5825 from Stephen
Gallagher addresses that)

Reviewed at https://reviews.reviewboard.org/r/5826/
Properly generate parent diffs in git with multiple remotes

When posting a revision range with Git, the git diff would try hard to
determine whether or not a parent diff was required by checking to see if the
first revision in the range was contained in the remote. This works fine for
basic setups where there's a single remote that's the same one that Review
Board talks to.

Unfortunately, if a user has multiple remotes, and pushes commits to a remote
which is different from the one Review Board uses, rbt would think that a
parent diff isn't required when it really is.

This change gets rid of the fancy testing, and just checks that the merge base
isn't the same as the parent revision. The worst case here is that we end up
generating a parent diff when it's not truly required, but it fixes the
problems with multiple remotes.

Testing Done:
1) Set up a series of patches that depended on one another. (Patch 2 depends
   on changes from patch 1)
2) Pushed the patches to a remote git repository
3) Ran 'rbt post patch1:patch2'

Previous behavior:
The file was not found in the repository (HTTP 400, API Error 207)

Behavior after this patch:
Review was properly uploaded.

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