isomorphic-jj 1.9.2 → 1.11.0
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/CHANGELOG.md +239 -0
- package/dist/index.cjs +448 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +448 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/repository.js +419 -21
- package/src/core/revset-engine.js +29 -1
|
@@ -1107,11 +1107,39 @@ export class RevsetEngine {
|
|
|
1107
1107
|
return parentKeys.every((k) => parentSnapshot[k] === ownSnapshot[k]);
|
|
1108
1108
|
};
|
|
1109
1109
|
|
|
1110
|
+
// issue #43(2): the original #37(b) rule above (unreachable + isEmpty +
|
|
1111
|
+
// undescribed) only hides an orphan while it still happens to have
|
|
1112
|
+
// zero file diff versus its CURRENT parent. Two real shapes slip past
|
|
1113
|
+
// that once undo()/operations.restore() are involved, because both are
|
|
1114
|
+
// purely internal rewrite/undo artifacts that were never "empty" in
|
|
1115
|
+
// any way a user would recognize — they simply never held real user
|
|
1116
|
+
// content of their own, and a later revert of something else can make
|
|
1117
|
+
// isEmpty() disagree even though nothing about THIS change changed:
|
|
1118
|
+
//
|
|
1119
|
+
// 1. squash() creates a fresh empty `@` on top of `dest` when
|
|
1120
|
+
// squashing the working copy. If that squash is later undone,
|
|
1121
|
+
// the fresh `@` becomes unreferenced — but if `dest` itself gets
|
|
1122
|
+
// reverted back to its pre-squash content by the SAME undo,
|
|
1123
|
+
// isEmpty() now compares the orphan's (frozen, post-squash)
|
|
1124
|
+
// fileSnapshot against dest's (reverted, pre-squash) one and
|
|
1125
|
+
// finds a mismatch, even though the orphan is exactly as
|
|
1126
|
+
// "discardable" as it was the instant it was created.
|
|
1127
|
+
// 2. new() creates a fresh empty change on top of the previous `@`.
|
|
1128
|
+
// If something writes into it (write()/snapshot()) before an
|
|
1129
|
+
// undo() unwinds back past the new(), the orphan is left with
|
|
1130
|
+
// real file content that no longer matches its parent, even
|
|
1131
|
+
// though the user never gave it a real description.
|
|
1132
|
+
//
|
|
1133
|
+
// Changes created by squash()/new() are tagged `autoCreated: true` at
|
|
1134
|
+
// creation (see squash()/new() in repository.js) specifically so this
|
|
1135
|
+
// filter can hide them on that basis alone — still gated on being
|
|
1136
|
+
// unreachable and undescribed, so a change the user actually described
|
|
1137
|
+
// (or that's still live) is never hidden by this rule.
|
|
1110
1138
|
const hidden = new Set();
|
|
1111
1139
|
for (const change of allChanges) {
|
|
1112
1140
|
if (
|
|
1113
1141
|
!reachable.has(change.changeId) &&
|
|
1114
|
-
isEmpty(change) &&
|
|
1142
|
+
(isEmpty(change) || change.autoCreated) &&
|
|
1115
1143
|
UNDESCRIBED.has(change.description)
|
|
1116
1144
|
) {
|
|
1117
1145
|
hidden.add(change.changeId);
|