diff --git a/git-review.1 b/git-review.1 index b69c9417..2648d94b 100644 --- a/git-review.1 +++ b/git-review.1 @@ -60,7 +60,7 @@ can be .Ar changeNumber as obtained using .Fl \-list -option, or it can be +option, or it can be .Ar changeNumber,patchsetNumber for fetching exact patchset from the change. In that case local branch name will have a \-patch[patchsetNumber] suffix. @@ -353,6 +353,8 @@ Particular patchset cannot be fetched from the remote git repository. Specified patchset number not found in the changeset. .It 39 Invalid patchsets for comparison. +.It 40 +Connection to Gerrit was closed. .It 64 Cannot checkout downloaded patchset into the new branch. .It 65 diff --git a/git_review/cmd.py b/git_review/cmd.py index 16c180bb..035b6e19 100755 --- a/git_review/cmd.py +++ b/git_review/cmd.py @@ -388,8 +388,9 @@ def add_remote(scheme, hostname, port, project, remote, usepushurl): remote_url = make_remote_url(scheme, username, hostname, port, project) print("Trying again with %s" % remote_url) if not test_remote_url(remote_url): - raise GitReviewException("Could not connect to gerrit at " - "%s" % remote_url) + raise GerritConnectionException( + "Could not connect to gerrit at %s" % remote_url + ) asked_for_username = True if usepushurl: @@ -1054,6 +1055,11 @@ class PatchSetNotFound(ChangeSetException): EXIT_CODE = 38 +class GerritConnectionException(GitReviewException): + """Problem to establish connection to gerrit.""" + EXIT_CODE = 40 + + class CheckoutNewBranchFailed(CommandFailed): "Cannot checkout to new branch" EXIT_CODE = 64