Fix starred groups list in dashboard when user.pk != profile.pk.

The code that generated the list of the watched groups in the dashboard sidebar
was passing the wrong object in for the starred_by relation, which meant that if
the user's pk wasn't the same as the profile pk, it would show an incorrect
list.

Testing done: Set up the reproduction case and looked at the dashboard. Grepped
around to verify that nowhere else made this same mistake.
Add a fallback encoding conversion for diff content.

When trying to convert the resulting diff content to unicode, we first try
straight utf-8, and then try any encodings which were configured on the
repository. This change adds one additional step, where we try to interpret the
file as utf-8 but replace any unknown characters with U+FFFD.

Fixes bug 2776.
Reviewed at. http://reviews.reviewboard.org/r/3528/
Fix errors when manipulating the "New Review Request" field in wonky ways.

On the "New Review Request" form, if the user first chooses a perforce
repository and enters a change number, but then changes the repository type to
"None (Graphics Only)", the changenum field will still be sent to the server.
Unfortunately, NewReviewRequestForm.create() was conditionalizing only on
"changenum" and nothing else.

Fixes bug 2708.
Reviewed at http://reviews.reviewboard.org/r/3529/
Remove useless, broken supports_change_timezone conditionals.

I guess when we initially did the timezone support, we thought it might be
connected to the auth backend. The result of this was code that would hide the
field on the preferences dialog for all auth backends except the standard
builtin one, and then fail to save when users tried to change their preferences
because the field was still marked as required.

Because the timezone setting is just part of the user profile and unrelated to
the auth backend, there's no reason to have these conditionals present.

Fixes bug 2797.
Reviewed at http://reviews.reviewboard.org/r/3491/
Add better help text to the repository form's Path field.

Our help text for the Path field was a big ol' mess of information for a
variety of SCMTools, and certainly didn't scale or look readable.

We now allow SCMTools to provide their own help text for any fields they
choose (though right now, it's only used for Path). When switching tools
on the repository form, the help text for all affected fields will
change.

The existing help text has been split up into the various SCMTools we
previously documented, and cleaned up a bit.
Choose a better default for the hosting account on the repository form.

When switching hosting services on the repository form, the Account
dropdown would default to "<Link a new account>", unless there was
already a matching account selected before. This is not a good default
when there are actual, valid accounts previously linked.

Now we choose the 1st real account as the default, unless we find a
previously selected account in the list, in which case that'll be the
default.
Add API support for creating a review request with no repository.

Our API wasn't allowing the creation of review requests without a
repository. This should be allowed, as the web UI allows it, and not all
review requests going forward will have anything to do with diffs.

The 'repository' parameter is now optional. Documentation was updated to
explain the new usage of this parameter.
Fix a memory leak with the new in-database SVN cert storage.

The new SVN cert support introduced a memory leak due to a circular
dependency.

The client was holding on to a reference to the function on SVNTool,
while SVNTool was holding on to the client, preventing either from being
cleaned up.

An attempt was made at inlining the function, but as that accessed data
bound to the class, the circular dependency remained.

This appears to be an issue specifically with PySVN, as an independent
repro case could be devised for pysvn.Client's callbacks, but not those
from a mock object.

The callback is now defined as a classmethod and the only attribute it
needs, a repository, is set up as a weakptr which is then accessed by a
lambda calling the callback. This prevents the repository and SVNTool
from remaining around indefinitely.
Change the FileAttachmentComment API to require an "extra_data." prefix for extra data.

Recently, FileAttachmentComment was given support for specifying extra
data to store with a comment. This took any unknown variable and stored
it as extra data, but that meant that typos would also get stored.

Now it requires an "extra_data." prefix for any variables meant to be
stored there. That corresponds to the resulting payload, which is a
dictionary in 'extra_data'.
Merge branch 'release-1.6.x'
Fix the style for the comment save bubble in the diff viewer.

A CSS rule was introduced for the floating collapse div in the diff
viewer that broke the style for the comment save bubble. The border of
the bubble was no longer covering all the text, which looked very
broken.

The div for the collapse button has been given a class and the offending
rule has been updated to specifically make use of that class.
Merge branch 'release-1.6.x'
Keep the review request banner from shifting around with the inline editor.

When showing or hiding the inline editor, the draft/discard/submitted
banners would shift around a little. The position of the text didn't
align, nor did the edit box. This was due to some bad margin, size, and
alignment rules. Now they should be better in sync.
Removed parentheses in autocompleter if suggested user does not have a first and last name.

The suggestions show up as "Username (FirstName LastName). If the user
does not provide a first/last name, it looks like "Username ()".

This occurs in RB's main search functionality and in the reviewer's
people input field.

I also have noticed (and mentioned) about the problem with overlapping
characters in the autocomplete suggestions with users that have long
usernames. I am having a slight issue with finding an elegant solution
to changing the size of the widget dynamically. I saw some suggestions
in stackoverflow but I am looking for something more elegant.

Reviewed at http://reviews.reviewboard.org/r/3533/
Fix review request field sizing issues and hide unused fields.

Review request fields were never shown very well. They had a hacky setup
that caused them to jump when the content changed, such as more text or
an inline editor being shown. This was ugly and I just won't stand it
anymore.

Now instead of a 4 column approach (which was really the core issue, as
it meant that the table was reevaluating its layout based on any new
content all the time and causing things to jump), we have two tables
floated next to each other, each taking up 50% of the space.

These tables will no longer intrude on each others' space, preventing
things from jumping around.

A nice side-benefit is that when resized really small (such as on mobile
devices), the tables will themselves wrap, moving to a single column.

Along with this, I've changed the template to not show the Change Number
field unless one is present, and not show Repository unless it's a
repository-backed review request. This simplifies things in certain
cases.
Fix rendering of text file thumbnails for unopened files.

Text file thumbnails, when accessed via the API, didn't have access to
an opened file. This was causing an error when attempting to read the
file data. The solution is just to open the file before doing any
reading from it.

Fixes bug #2805
Update the default branch for review requests for the release-1.7.x branch.
Merge branch 'release-1.7.x'
Dynamically generate the webapi resource tree docs.

The webapi resource tree docs were hand-generated, and out of date.
This adds a new ReST directive to spit out a resource tree based on
what's in the webapi resources list.
Stop including flup.

flup is needed for fastcgi, but their site has been down for a while
now, and we recommend wsgi, so stop bundling it with Review Board.