mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[shelf]: do not load history if the base texts are already inside patch
This commit is contained in:
+12
-12
@@ -70,6 +70,18 @@ public class ApplyPatchForBaseRevisionTexts {
|
||||
|
||||
final List<PatchHunk> hunks = patch.getHunks();
|
||||
|
||||
CharSequence contents = baseContents != null ? baseContents.get() : null;
|
||||
if (contents != null) {
|
||||
contents = StringUtil.convertLineSeparators(contents.toString());
|
||||
myBase = contents;
|
||||
final GenericPatchApplier applier = new GenericPatchApplier(contents, hunks);
|
||||
if (!applier.execute()) {
|
||||
applier.trySolveSomehow();
|
||||
}
|
||||
setPatched(applier.getAfter());
|
||||
return;
|
||||
}
|
||||
|
||||
if (provider != null) {
|
||||
try {
|
||||
provider.getBaseVersionContent(pathBeforeRename, text -> {
|
||||
@@ -88,18 +100,6 @@ public class ApplyPatchForBaseRevisionTexts {
|
||||
if (myPatched != null) return;
|
||||
}
|
||||
|
||||
CharSequence contents = baseContents.get();
|
||||
if (contents != null) {
|
||||
contents = StringUtil.convertLineSeparators(contents.toString());
|
||||
myBase = contents;
|
||||
final GenericPatchApplier applier = new GenericPatchApplier(contents, hunks);
|
||||
if (! applier.execute()) {
|
||||
applier.trySolveSomehow();
|
||||
}
|
||||
setPatched(applier.getAfter());
|
||||
return;
|
||||
}
|
||||
|
||||
final GenericPatchApplier applier = new GenericPatchApplier(myLocal, hunks);
|
||||
if (! applier.execute()) {
|
||||
applier.trySolveSomehow();
|
||||
|
||||
Reference in New Issue
Block a user