summaryrefslogtreecommitdiffstats
path: root/gerrit-httpd
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2013-04-17 17:18:43 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2013-04-17 18:40:02 +0900
commite8c1fb9a640f9fc39c627f66b122a71d602ec7e5 (patch)
treeb36add3ecaf2945e34aa143dbcc8f18b88b1ca3b /gerrit-httpd
parente73a991c593e1b18951b7a419a828166ccb03a80 (diff)
Distinguish between error and timeout in intraline diff error message
When the intraline diff fails, the error message simply says that there was a server error. It could be that the reason for failure is a timeout, but it's not possible to know this from the error message. Add a new error message that is displayed when the intraline diff fails due to timeout. Also update the documentation to mention that an error message is displayed if the intraline diff times out. Change-Id: I93410d853aadc7ed1f6e4324d0578c4bcbe4e195
Diffstat (limited to 'gerrit-httpd')
-rw-r--r--gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptBuilder.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptBuilder.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptBuilder.java
index 816bbef6eb..e4871cbc36 100644
--- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptBuilder.java
+++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptBuilder.java
@@ -133,6 +133,7 @@ class PatchScriptBuilder {
throws IOException {
boolean intralineDifferenceIsPossible = true;
boolean intralineFailure = false;
+ boolean intralineTimeout = false;
a.path = oldName(content);
b.path = newName(content);
@@ -160,10 +161,14 @@ class PatchScriptBuilder {
break;
case ERROR:
- case TIMEOUT:
intralineDifferenceIsPossible = false;
intralineFailure = true;
break;
+
+ case TIMEOUT:
+ intralineDifferenceIsPossible = false;
+ intralineTimeout = true;
+ break;
}
} else {
intralineDifferenceIsPossible = false;
@@ -212,7 +217,7 @@ class PatchScriptBuilder {
content.getOldName(), content.getNewName(), a.fileMode, b.fileMode,
content.getHeaderLines(), diffPrefs, a.dst, b.dst, edits,
a.displayMethod, b.displayMethod, comments, history, hugeFile,
- intralineDifferenceIsPossible, intralineFailure);
+ intralineDifferenceIsPossible, intralineFailure, intralineTimeout);
}
private static boolean isModify(PatchListEntry content) {