Allow selecting text in new files again.

The CSS that made text in unrelated columns unselectable when selecting text
wasn't correct in the case of new files (where the "number 1" column uses td.r
for styling). To fix this, I've added a :not selector to verify that we don't
unintentionally disable selection for new files.

Testing done:
Tested text selection in both new and changed files.

Fixes bug 3661.

Reviewed at https://reviews.reviewboard.org/r/6609/
Allow HostingService Integration through Review Board extensions

This change adds a HostingServiceHook that extensions can use to
register new hosting services.

Testing done:
Unit test have been written to make sure that HostingService subclasses are
registered and unregistered properly.

Reviewed at https://reviews.reviewboard.org/r/6572/
Added documentation for HostingServiceHook

This change adds documentation and sample code for the newly created
HostingServiceHook.

Reviewed at https://reviews.reviewboard.org/r/6600/
Fix some trailing whitespace.
Add a blank webapi/admin.py file.

This mirrors the recent addition of a blank models.py file. It helps
when switching back and forth between release-2.0.x and master branches.
Fix formatting errors in admin module according to PEP8

Fixed the following formatting errors:
admin/forms.py:808:13: E265 block comment should start with '# '
admin/forms.py:849:5: E265 block comment should start with '# '
admin/forms.py:850:5: E265 block comment should start with '# '
admin/forms.py:851:5: E265 block comment should start with '# '
admin/forms.py:852:5: E265 block comment should start with '# '
admin/forms.py:853:5: E265 block comment should start with '# '
admin/forms.py:900:5: E265 block comment should start with '# '
admin/validation.py:28:1: E302 expected 2 blank lines, found 1

Testing done:
Ran unit tests for admin module, and ran pep8 again.

Reviewed at https://reviews.reviewboard.org/r/6625/diff/#
Clean up git scmtools tests a bit.

This fixes one thing where we're skipping an assertion, and fixes a file
descriptor leak.

Testing done:
Ran unit tests.
Fix formatting errors in accounts module according to PEP8

Fixed the following formatting errors:
accounts/backends.py:411:80: E501 line too long (86 > 79 characters)
accounts/urls.py:41:80: E501 line too long (95 > 79 characters)

Testing Done:
Ran unit tests for accounts module, and ran pep8 again.

Reviewed at https://reviews.reviewboard.org/r/6624/
Fix formatting errors in cmdline module according to PEP8

Fixed the following formatting errors:
cmdline/rbsite.py:1177:25: E128 continuation line under-indented for visual indent

Testing Done:
Ran unit tests for cmdline module, and ran pep8 again.

Reviewed at https://reviews.reviewboard.org/r/6628/
Fix formatting errors in site module according to PEP8

Fixed the following format errors:
site/tests.py:90:19: E221 multiple spaces before operator

Testing Done:
Ran unit tests for site module, and pep8.

Reviewed at https://reviews.reviewboard.org/r/6637/
Fix formatting errors in notifications module according to PEP8

Fixed the following format errors:
notifications/email.py:321:9: E201 whitespace after '('
notifications/email.py:321:9: E272 multiple spaces before keyword
notifications/email.py:322:9: E128 continuation line under-indented for visual indent

Testing Done:
Ran unit tests for notifications module, and ran pep8 again.

Reviewed at https://reviews.reviewboard.org/r/6632/
Fix formatting errors in scmtools module according to PEP8

Fixed the following format errors:
scmtools/clearcase.py:86:12: E713 test for membership should be 'not in'
scmtools/clearcase.py:274:18: E713 test for membership should be 'not in'
scmtools/clearcase.py:418:1: E302 expected 2 blank lines, found 1
scmtools/cvs.py:343:17: E713 test for membership should be 'not in'
scmtools/svn/__init__.py:41:12: E221 multiple spaces before operator
scmtools/svn/__init__.py:42:16: E221 multiple spaces before operator
scmtools/svn/__init__.py:43:15: E221 multiple spaces before operator
scmtools/svn/base.py:25:18: E241 multiple spaces after ':'
scmtools/svn/base.py:26:16: E241 multiple spaces after ':'
scmtools/svn/base.py:27:20: E241 multiple spaces after ':'
scmtools/svn/base.py:28:19: E241 multiple spaces after ':'
scmtools/svn/base.py:29:14: E241 multiple spaces after ':'
scmtools/svn/base.py:30:18: E241 multiple spaces after ':'
scmtools/svn/base.py:33:25: E241 multiple spaces after ':'
scmtools/svn/base.py:34:27: E241 multiple spaces after ':'
scmtools/svn/base.py:36:15: E241 multiple spaces after ':'
scmtools/svn/base.py:37:15: E241 multiple spaces after ':'
scmtools/tests.py:557:80: E501 line too long (88 > 79 characters)
scmtools/tests.py:606:80: E501 line too long (88 > 79 characters)
scmtools/tests.py:619:80: E501 line too long (88 > 79 characters)
scmtools/tests.py:633:80: E501 line too long (88 > 79 characters)
scmtools/tests.py:653:80: E501 line too long (88 > 79 characters)
scmtools/tests.py:678:80: E501 line too long (87 > 79 characters)
scmtools/tests.py:2691:80: E501 line too long (81 > 79 characters)
scmtools/tests.py:2829:80: E501 line too long (81 > 79 characters)
scmtools/tests.py:2921:80: E501 line too long (80 > 79 characters)

Testing Done:
Ran unit tests for scmtools module, and ran pep8 again.

Reviewed at https://reviews.reviewboard.org/r/6636/
Improve formatting for Markdown.

We try to keep our Markdown rendered output as close as possible to the
source text formatting, but there's only so much that can be done by
CSS. This change massively improves the rendering by introducing a set
of new Markdown processors that clean up newlines and attributes, giving
us the output our users would expect.

This primarily does the following:

* Keeps the correct number of blank lines between blocks (by default,
  Python Markdown will just trim them away).

* Keeps code blocks (and certain other extension-provided blocks) from
  having an unnecessary extra blank line after the HTML (interfering
  with our <pre> formatting).

* Allows line breaks in lists.

* Wrapped lines of text inside an ordered list item no longer shows the
  wrapped text at the same indentation level as the item's counter
  value. It now properly stays within the confines of the list item.

  To make this happen, we had to use CSS counters and some custom
  styles (using `display: table` and friends).

* Allows ordered lists to start at a particular value. We do this by
  turning off lazy_ol, which gives us a start= attribute on the list.
  Then, to get it to play nice with the custom counters mentioned above,
  we have a Markdown block processor that adds CSS to the <ol> that
  initializes the counter to the right value.

* Adds unit tests to ensure these formatting rules do not break in
  the future.

The result is much nicer formatting for most cases (all cases I've
tested).

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