@adecore/merge 0.54.2 → 0.54.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/diff.js +1 -1
- package/dist/resolve.js +3 -3
- package/package.json +1 -1
- package/src/blocks.ts +1 -1
- package/src/diff.ts +1 -1
- package/src/resolve.ts +3 -3
package/dist/diff.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* Past this edit distance two files are answered as one stretch that differs whole. */
|
|
2
2
|
const MAX_DISTANCE = 4000;
|
|
3
|
-
/* The walk keeps every STRIDE-th state and walks the rounds between two again on the way back
|
|
3
|
+
/* The walk keeps every STRIDE-th state and walks the rounds between two again on the way back. A
|
|
4
4
|
state per round came to over a hundred megabytes at MAX_DISTANCE. */
|
|
5
5
|
const STRIDE = 64;
|
|
6
6
|
/* Whether a diagonal's furthest reach steps in from diagonal + 1 (an insert) rather than diagonal - 1 (a delete). */
|
package/dist/resolve.js
CHANGED
|
@@ -55,7 +55,7 @@ function covers(base, outer, inner) {
|
|
|
55
55
|
return added.every((line) => !base.includes(line) || inner.includes(line));
|
|
56
56
|
}
|
|
57
57
|
/*
|
|
58
|
-
* What
|
|
58
|
+
* What automatic resolution makes of a conflict, or null for one that needs a person after all. It closes only
|
|
59
59
|
* identical sides and a side that already holds every line of the other without putting back what
|
|
60
60
|
* the other deleted. Whitespace keeps its meaning because this function has no language context.
|
|
61
61
|
*/
|
|
@@ -73,7 +73,7 @@ export function wandLines(block) {
|
|
|
73
73
|
}
|
|
74
74
|
/*
|
|
75
75
|
* A short name for the two sides of one block, so an answer written for it can be checked against
|
|
76
|
-
* the block it lands on. FNV-1a, not a digest
|
|
76
|
+
* the block it lands on. FNV-1a, not a digest, because it has to read the same on a server and in a browser,
|
|
77
77
|
* and a browser has no synchronous crypto hash.
|
|
78
78
|
*/
|
|
79
79
|
export function fingerprint(block) {
|
|
@@ -96,7 +96,7 @@ export function draftOf(blocks, answered = new Map()) {
|
|
|
96
96
|
const spans = [];
|
|
97
97
|
for (const [index, block] of blocks.entries()) {
|
|
98
98
|
const from = lines.length;
|
|
99
|
-
// One push per line
|
|
99
|
+
// One push per line, since a block of a few hundred thousand lines is more arguments than V8 takes in one call.
|
|
100
100
|
for (const line of answered.get(index) ?? autoLines(block) ?? block.ours) {
|
|
101
101
|
lines.push(line);
|
|
102
102
|
}
|
package/package.json
CHANGED
package/src/blocks.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { diffLines, type Change } from './diff.ts';
|
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
* What happened to one stretch of a file between the version the two sides started from and what
|
|
5
|
-
* each of them made of it. Only `conflict` needs a person
|
|
5
|
+
* each of them made of it. Only `conflict` needs a person. The rest is one side's change, or the
|
|
6
6
|
* same change made twice.
|
|
7
7
|
*/
|
|
8
8
|
export type MergeBlockKind = 'stable' | 'ours' | 'theirs' | 'both' | 'conflict';
|
package/src/diff.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface Change {
|
|
|
12
12
|
/* Past this edit distance two files are answered as one stretch that differs whole. */
|
|
13
13
|
const MAX_DISTANCE = 4000;
|
|
14
14
|
|
|
15
|
-
/* The walk keeps every STRIDE-th state and walks the rounds between two again on the way back
|
|
15
|
+
/* The walk keeps every STRIDE-th state and walks the rounds between two again on the way back. A
|
|
16
16
|
state per round came to over a hundred megabytes at MAX_DISTANCE. */
|
|
17
17
|
const STRIDE = 64;
|
|
18
18
|
|
package/src/resolve.ts
CHANGED
|
@@ -71,7 +71,7 @@ function covers(base: readonly string[], outer: readonly string[], inner: readon
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
/*
|
|
74
|
-
* What
|
|
74
|
+
* What automatic resolution makes of a conflict, or null for one that needs a person after all. It closes only
|
|
75
75
|
* identical sides and a side that already holds every line of the other without putting back what
|
|
76
76
|
* the other deleted. Whitespace keeps its meaning because this function has no language context.
|
|
77
77
|
*/
|
|
@@ -93,7 +93,7 @@ export function wandLines(block: MergeBlock): string[] | null {
|
|
|
93
93
|
|
|
94
94
|
/*
|
|
95
95
|
* A short name for the two sides of one block, so an answer written for it can be checked against
|
|
96
|
-
* the block it lands on. FNV-1a, not a digest
|
|
96
|
+
* the block it lands on. FNV-1a, not a digest, because it has to read the same on a server and in a browser,
|
|
97
97
|
* and a browser has no synchronous crypto hash.
|
|
98
98
|
*/
|
|
99
99
|
export function fingerprint(block: MergeBlock): string {
|
|
@@ -135,7 +135,7 @@ export function draftOf(blocks: readonly MergeBlock[], answered: ReadonlyMap<num
|
|
|
135
135
|
for (const [index, block] of blocks.entries()) {
|
|
136
136
|
const from = lines.length;
|
|
137
137
|
|
|
138
|
-
// One push per line
|
|
138
|
+
// One push per line, since a block of a few hundred thousand lines is more arguments than V8 takes in one call.
|
|
139
139
|
for (const line of answered.get(index) ?? autoLines(block) ?? block.ours) {
|
|
140
140
|
lines.push(line);
|
|
141
141
|
}
|