Follow up I92b8637c: Fix Python 3 compatibility.

This should fix the error I get when trying to update from git-review 1.19:

alex@alex:/var/www/MediaWiki/Git/core$ sudo pip install -U git-review
[sudo] password for alex:
Downloading/unpacking git-review from http://pypi.python.org/packages/source/g/git-review/git-review-1.20.tar.gz#md5=d8446f99fd4ef2cc8090bef2c9eac294
  Downloading git-review-1.20.tar.gz
  Running setup.py egg_info for package git-review
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/tmp/pip-build/git-review/setup.py", line 25, in <module>
        exec(open("git-review").read())
      File "<string>", line 864
        except CommandFailed, e:
                            ^
    SyntaxError: invalid syntax
[...]

Change-Id: I1aa43f7bb14bbf68c3a63f2225fb91d1ad53124b
Introduce base exception classes

GitReviewException:

Handle also exceptions that are
not related to the failed external
commands at toplevel.

ChangeSetException:

For exceptions not related to the
execution of the external command;
such an exception is associated
with a change set identifier.

[reintroduction of previously re-re-reverted b744111]

Change-Id: I8b850ba0b611b452acbacb21393f86858e72099a
git-review(1): explain exit code ranges

32..63 - remote communication with gerrit/git repository
>64 - problems with local git repository

[reintroduction of previously reverted 78b6ace]

Change-Id: I0dbd87fd7566ff7c659bc1066643f347801daaa3
Use exceptions for download_review

Add exceptions to errors that might
happend when fetching a change
for review.

Handle non-existing changeset number
better (don't fail on KeyError).

Better error message when the change
number is correct, but cannot be
fetched into the current project.

Allocate exit codes 34,35,36,37 and
64,65 for errors related to patchset
download.

Change-Id: I8bb7dd9418dc9488ff80b572a4494afa39472128
Use exceptions for finish_review

Add exceptions to errors that might
happend when closing a branch.

Allocate exit codes 67,68 for
for errors related to removing
the branch.

Change-Id: I9ba37ca5a69ded1421845a8d1a40bd6be22addca
Use exceptions for list_reviews

Add exceptions to errors that might
happend when listing open changes
for review.

Use exit codes 32 and 33 for exceptions.

Change-Id: I8a94fd0e13bbf1dbc9f01ca03a319628ca497d81
Add mailing list to README.

Change-Id: Ib76d80227177ec4ab5aca6d417c0728b425f1f0f
Updated .gitreview location

Change-Id: If0ea43e9b6d0b53f4bc9408e6e907c1b7006f3fa
Update README for project move.

* README.md: Correct .gitreview sample and Github URL.

Change-Id: I6aa23a54c3acd756141777513867d49873355027
Merge "Update README for project move."
Merge "Introduce base exception classes"
Merge "git-review(1): explain exit code ranges"
Merge "Use exceptions for download_review"
Merge "Use exceptions for finish_review"
Merge "Use exceptions for list_reviews"
Remove two else: blocks in main()

Don't check for status of finish_remote()
since an exception will be returned.

Remove else: blocks and use return to
make logic a bit more readable with
less intendation.

Change-Id: I83172dfeb786adc3e925116c39e7ffdc616de893
Fix regression in repeated -d of the same change.

Fixes bug 1092943.

* git-review(download_review): Earlier refactoring in commit 4511318
resulted in checking the wrong output for existing branch errors,
since it moved into the exception data. Fixed in this commit.

Change-Id: I761b01c70ab93e77b112ddf85c63a829d5334196
Topic name should be determined only for git push

When setting up git-review, it tries to acquire a topic name although
that is of no use to setup.  A side effect is that git-review can not be
setup whenever the git remote is a fresh repository since it get no
branch. Solve this by moving it after the setup routines.

Inform the user why the particular topic name has been selected.

Change-Id: Iaa942b8dc77b0c3f720085358c38e8295138025a
Check that the owner of a change has name defined

Sometimes Gerrit might not return owner name
due to some internal misconfiguration or database
problem. Since we are using owner name here to
generate the name of a local git branch, instead
of failing here we should try to just go ahead
with 'unknown'.

More information about this error:

https://bugzilla.wikimedia.org/show_bug.cgi?id=40061#c5
https://gerrit.wikimedia.org/r/#/c/37771/

Change-Id: Icaa9baa453e3fd7d54adf9138a9435e4271cee0a
Check HEAD for extra commits instead of master

Removes noise if one pushes to master from detached HEAD or just another branch

Change-Id: Icd62c2ee359b95877097a57a3b517434d9f7f5e0