Merge "Distinguish between error and timeout in intraline diff error message" into stable-2.6
This commit is contained in:
commit
6d0b1de84d
@ -648,8 +648,11 @@ cache.diff_intraline.timeout::
|
||||
Maximum number of milliseconds to wait for intraline difference data
|
||||
before giving up and disabling it for a particular file pair. This is
|
||||
a work around for an infinite loop bug in the intraline difference
|
||||
implementation. If computation takes longer than the timeout the
|
||||
worker thread is terminated and no intraline difference is displayed.
|
||||
implementation.
|
||||
+
|
||||
If computation takes longer than the timeout, the worker thread is
|
||||
terminated, an error message is shown, and no intraline difference is
|
||||
displayed for the file pair.
|
||||
+
|
||||
Values should use common unit suffixes to express their setting:
|
||||
+
|
||||
|
@ -53,6 +53,7 @@ public class PatchScript {
|
||||
protected boolean hugeFile;
|
||||
protected boolean intralineDifference;
|
||||
protected boolean intralineFailure;
|
||||
protected boolean intralineTimeout;
|
||||
|
||||
public PatchScript(final Change.Key ck, final ChangeType ct, final String on,
|
||||
final String nn, final FileMode om, final FileMode nm,
|
||||
@ -60,7 +61,7 @@ public class PatchScript {
|
||||
final SparseFileContent ca, final SparseFileContent cb,
|
||||
final List<Edit> e, final DisplayMethod ma, final DisplayMethod mb,
|
||||
final CommentDetail cd, final List<Patch> hist, final boolean hf,
|
||||
final boolean id, final boolean idf) {
|
||||
final boolean id, final boolean idf, final boolean idt) {
|
||||
changeId = ck;
|
||||
changeType = ct;
|
||||
oldName = on;
|
||||
@ -79,6 +80,7 @@ public class PatchScript {
|
||||
hugeFile = hf;
|
||||
intralineDifference = id;
|
||||
intralineFailure = idf;
|
||||
intralineTimeout = idt;
|
||||
}
|
||||
|
||||
protected PatchScript() {
|
||||
@ -152,6 +154,10 @@ public class PatchScript {
|
||||
return intralineFailure;
|
||||
}
|
||||
|
||||
public boolean hasIntralineTimeout() {
|
||||
return intralineTimeout;
|
||||
}
|
||||
|
||||
public boolean isExpandAllComments() {
|
||||
return diffPrefs.isExpandAllComments();
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ public interface PatchConstants extends Constants {
|
||||
String patchHistoryTitle();
|
||||
String disabledOnLargeFiles();
|
||||
String intralineFailure();
|
||||
String intralineTimeout();
|
||||
String illegalNumberOfColumns();
|
||||
|
||||
String upToChange();
|
||||
|
@ -18,6 +18,7 @@ patchHistoryTitle = Patch History
|
||||
patchSet = Patch Set
|
||||
disabledOnLargeFiles = Disabled on very large source files.
|
||||
intralineFailure = Intraline difference not available due to server error.
|
||||
intralineTimeout = Intraline difference not available due to timeout.
|
||||
illegalNumberOfColumns = The number of columns cannot be zero or negative
|
||||
|
||||
upToChange = Up to change
|
||||
|
@ -120,6 +120,7 @@ public abstract class PatchScreen extends Screen implements
|
||||
private HandlerRegistration regNavigation;
|
||||
private HandlerRegistration regAction;
|
||||
private boolean intralineFailure;
|
||||
private boolean intralineTimeout;
|
||||
|
||||
/**
|
||||
* How this patch should be displayed in the patch screen.
|
||||
@ -468,6 +469,7 @@ public abstract class PatchScreen extends Screen implements
|
||||
}
|
||||
|
||||
intralineFailure = isFirst && script.hasIntralineFailure();
|
||||
intralineTimeout = isFirst && script.hasIntralineTimeout();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -476,6 +478,9 @@ public abstract class PatchScreen extends Screen implements
|
||||
if (intralineFailure) {
|
||||
intralineFailure = false;
|
||||
new ErrorDialog(PatchUtil.C.intralineFailure()).show();
|
||||
} else if (intralineTimeout) {
|
||||
intralineTimeout = false;
|
||||
new ErrorDialog(PatchUtil.C.intralineTimeout()).show();
|
||||
}
|
||||
if (topView != null && prefs.get().isRetainHeader()) {
|
||||
setTopView(topView);
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user