[autotest] Pylint checks committed versions of a file.

The contents of a file in the git work tree can differ from the
contents of a file in the HEAD commit. This is problematic for the
following reasons:
1. The uploader may not have committed their changes.
2. The uploader might repo upload a stack of commits each of which
   builds upon the other. In this case run_hooks is invoked on each
   commit and running pylint on the work tree version of the file
   doesn't make sense.
To work around this we invoke run pylint on a temp file, into which
we've 'git show'n the committed version of each file, so we're only
checking that specific commit. The change also batch processes files
so we get consolidated error reports and excuses run_once, initialize
and cleanup from needing a docstring.

The 'git show' mentioned above is achieved through a GitRepo object.
This commit also allows revision_control to run git commands without
requiring a giturl, and adds unittests to check that commands that
do need a giturl raise an exception if called without one.

TEST=Ran pylint with malformed non committed/committed files. Made
     sure pylint displays multiple errors of the same type in one
     report.
BUG=None

Change-Id: I82329d14c0334752941150c61d91e2e723b0c4d2
Reviewed-on: https://gerrit.chromium.org/gerrit/43697
Commit-Queue: Scott Zawalski <scottz@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Tested-by: Scott Zawalski <scottz@chromium.org>
5 files changed