mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-08 20:12:23 +00:00
normalized line endings
This commit is contained in:
1 parent
8cf9053d37
commit
9123771f34
2780 files changed
+301735
-301735
No files matched your search
@@ -1,27 +1,27 @@
|
||||
package diffutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import difflib.DiffUtils;
|
||||
import difflib.Patch;
|
||||
import difflib.PatchFailedException;
|
||||
|
||||
public class ApplyPatch extends Example {
|
||||
static final String FS = File.separator;
|
||||
static final String ORIGINAL = "test" + FS + "mocks" + FS + "issue10_base.txt";
|
||||
static final String PATCH = "test" + FS + "mocks" + FS + "issue10_patch.txt";
|
||||
|
||||
public static void main(String[] args) throws PatchFailedException {
|
||||
List<String> original = fileToLines(ORIGINAL);
|
||||
List<String> patched = fileToLines(PATCH);
|
||||
|
||||
// At first, parse the unified diff file and get the patch
|
||||
Patch<String> patch = DiffUtils.parseUnifiedDiff(patched);
|
||||
|
||||
// Then apply the computed patch to the given text
|
||||
List<String> result = DiffUtils.patch(original, patch);
|
||||
System.out.println(result);
|
||||
/// Or we can call patch.applyTo(original). There is no difference.
|
||||
}
|
||||
}
|
||||
package diffutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import difflib.DiffUtils;
|
||||
import difflib.Patch;
|
||||
import difflib.PatchFailedException;
|
||||
|
||||
public class ApplyPatch extends Example {
|
||||
static final String FS = File.separator;
|
||||
static final String ORIGINAL = "test" + FS + "mocks" + FS + "issue10_base.txt";
|
||||
static final String PATCH = "test" + FS + "mocks" + FS + "issue10_patch.txt";
|
||||
|
||||
public static void main(String[] args) throws PatchFailedException {
|
||||
List<String> original = fileToLines(ORIGINAL);
|
||||
List<String> patched = fileToLines(PATCH);
|
||||
|
||||
// At first, parse the unified diff file and get the patch
|
||||
Patch<String> patch = DiffUtils.parseUnifiedDiff(patched);
|
||||
|
||||
// Then apply the computed patch to the given text
|
||||
List<String> result = DiffUtils.patch(original, patch);
|
||||
System.out.println(result);
|
||||
/// Or we can call patch.applyTo(original). There is no difference.
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user