Enhance our support for Codebase HQ.
Review Request #8143 — Created May 6, 2016 and submitted
This introduces support for Subversion and Mercurial repositories hosted on Codebase HQ. We now go through the Codebase API for all repository validation and file fetching, which gives us the ability to work with all supported repository types. There is one bug in their API that we're encountering and working around, which is that their file contents API is returning contents with the final trailing newline removed. This breaks patching, and in order to work around it, we need to add that newline back in. This could conceivably cause other problems (and we're having to make an educated guess about the type of newline to insert), but it will solve the common case until Codebase fixes the problem (which has been reported). There's no support yet for post-commit review, as their API lacks commits pagination and the ability to get a diff for a commit.
Unit tests pass.
Tested each type of repository by hand. I was able to validate the
repository configuration, post changes, and view the diffs.
- Change Summary:
-
- Tightened up some code, getting rid of an unused variable declaration.
- Fixed a duplicate function name.
-
Tool: Pyflakes Processed Files: reviewboard/hostingsvcs/codebasehq.py reviewboard/hostingsvcs/errors.py reviewboard/hostingsvcs/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/hostingsvcs/codebasehq.py reviewboard/hostingsvcs/errors.py reviewboard/hostingsvcs/tests.py
- Change Summary:
-
Updated the
parse_xml
docs to sayNone
is returned if the document could not be parsed.