isomorphic-jj 1.2.0 → 1.3.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/dist/index.cjs +134 -135
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +134 -135
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/repository.js +134 -135
- package/src/types.d.ts +165 -2
package/package.json
CHANGED
package/src/api/repository.js
CHANGED
|
@@ -756,69 +756,116 @@ export async function createJJ(options) {
|
|
|
756
756
|
* @param {string[]} [args.paths] - Paths to move between changes (for history operations)
|
|
757
757
|
* @returns {Promise<Object>} Returns change object for history operations, file info for file operations
|
|
758
758
|
*/
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
759
|
+
/**
|
|
760
|
+
* Move a file in the working copy
|
|
761
|
+
*
|
|
762
|
+
* @param {Object} args - Move file arguments
|
|
763
|
+
* @param {string} args.from - Source file path
|
|
764
|
+
* @param {string} args.to - Destination file path
|
|
765
|
+
* @returns {Promise<Object>} Operation result including from, to paths and file stats
|
|
766
|
+
*/
|
|
767
|
+
async moveFile(args) {
|
|
768
|
+
if (!args.from || typeof args.from !== 'string') {
|
|
769
|
+
throw new JJError('INVALID_ARGUMENT', 'Missing or invalid from path', {
|
|
770
|
+
suggestion: 'Provide a valid source file path',
|
|
771
|
+
provided: { from: args.from, type: typeof args.from },
|
|
763
772
|
});
|
|
764
773
|
}
|
|
765
774
|
|
|
766
|
-
|
|
767
|
-
|
|
775
|
+
if (!args.to || typeof args.to !== 'string') {
|
|
776
|
+
throw new JJError('INVALID_ARGUMENT', 'Missing or invalid to path', {
|
|
777
|
+
suggestion: 'Provide a valid destination file path',
|
|
778
|
+
provided: { to: args.to, type: typeof args.to },
|
|
779
|
+
});
|
|
780
|
+
}
|
|
768
781
|
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
782
|
+
// Prevent moving to the same location
|
|
783
|
+
if (args.from === args.to) {
|
|
784
|
+
throw new JJError('INVALID_OPERATION', 'Source and destination paths are the same', {
|
|
785
|
+
path: args.from,
|
|
786
|
+
suggestion: 'Specify a different destination path',
|
|
787
|
+
});
|
|
773
788
|
}
|
|
774
|
-
},
|
|
775
789
|
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
*/
|
|
783
|
-
_detectHistoryOperation(args) {
|
|
784
|
-
// Explicit history operation indicators
|
|
785
|
-
if (args.paths || args.changeId || args.newParent) {
|
|
786
|
-
return true;
|
|
790
|
+
// Prevent absolute paths
|
|
791
|
+
if (args.from.startsWith('/') || args.to.startsWith('/')) {
|
|
792
|
+
throw new JJError('INVALID_PATH', 'Absolute paths are not allowed', {
|
|
793
|
+
suggestion: 'Use paths relative to the repository root',
|
|
794
|
+
provided: { from: args.from, to: args.to },
|
|
795
|
+
});
|
|
787
796
|
}
|
|
788
797
|
|
|
789
|
-
//
|
|
790
|
-
if (args.from
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
798
|
+
// Prevent parent directory traversal
|
|
799
|
+
if (args.from.includes('..') || args.to.includes('..')) {
|
|
800
|
+
throw new JJError('INVALID_PATH', 'Parent directory traversal (..) is not allowed', {
|
|
801
|
+
suggestion: 'Use paths within the repository',
|
|
802
|
+
provided: { from: args.from, to: args.to },
|
|
803
|
+
});
|
|
804
|
+
}
|
|
795
805
|
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
// Users should use explicit { changeId, newParent } for clarity
|
|
799
|
-
if (fromLooksLikeChangeId && toLooksLikeChangeId) {
|
|
800
|
-
// This is ambiguous - throw a helpful error
|
|
801
|
-
throw new JJError('AMBIGUOUS_OPERATION',
|
|
802
|
-
'Ambiguous move operation: arguments look like change IDs', {
|
|
803
|
-
suggestion: 'Use { changeId, newParent } for history operations or ensure file paths don\'t match change ID pattern',
|
|
804
|
-
args,
|
|
805
|
-
});
|
|
806
|
-
}
|
|
806
|
+
const fromPath = `${dir}/${args.from}`;
|
|
807
|
+
const toPath = `${dir}/${args.to}`;
|
|
807
808
|
|
|
808
|
-
|
|
809
|
+
// Check if source file exists
|
|
810
|
+
try {
|
|
811
|
+
await fs.promises.stat(fromPath);
|
|
812
|
+
} catch (error) {
|
|
813
|
+
throw new JJError('FILE_NOT_FOUND', `Source file not found: ${args.from}`, {
|
|
814
|
+
path: args.from,
|
|
815
|
+
suggestion: 'Check that the source file exists',
|
|
816
|
+
});
|
|
809
817
|
}
|
|
810
818
|
|
|
811
|
-
|
|
819
|
+
// Ensure destination directory exists
|
|
820
|
+
const toDir = toPath.substring(0, toPath.lastIndexOf('/'));
|
|
821
|
+
try {
|
|
822
|
+
await fs.promises.mkdir(toDir, { recursive: true });
|
|
823
|
+
} catch (error) {
|
|
824
|
+
throw new JJError('FILE_SYSTEM_ERROR', `Failed to create destination directory: ${error.message}`, {
|
|
825
|
+
path: toDir,
|
|
826
|
+
error: error.message,
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
// Move the file
|
|
831
|
+
try {
|
|
832
|
+
await fs.promises.rename(fromPath, toPath);
|
|
833
|
+
} catch (error) {
|
|
834
|
+
throw new JJError('FILE_SYSTEM_ERROR', `Failed to move file: ${error.message}`, {
|
|
835
|
+
from: args.from,
|
|
836
|
+
to: args.to,
|
|
837
|
+
error: error.message,
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
// Update working copy tracking
|
|
842
|
+
await workingCopy.load();
|
|
843
|
+
await workingCopy.untrackFile(args.from);
|
|
844
|
+
const stats = await fs.promises.stat(toPath);
|
|
845
|
+
await workingCopy.trackFile(args.to, {
|
|
846
|
+
mtime: stats.mtime,
|
|
847
|
+
size: stats.size,
|
|
848
|
+
mode: stats.mode,
|
|
849
|
+
});
|
|
850
|
+
|
|
851
|
+
return {
|
|
852
|
+
from: args.from,
|
|
853
|
+
to: args.to,
|
|
854
|
+
size: stats.size,
|
|
855
|
+
mode: stats.mode,
|
|
856
|
+
mtime: stats.mtime,
|
|
857
|
+
};
|
|
812
858
|
},
|
|
813
859
|
|
|
814
860
|
/**
|
|
815
|
-
* Move
|
|
861
|
+
* Move (rebase) a change to a new parent
|
|
816
862
|
*
|
|
817
|
-
* @
|
|
818
|
-
* @param {
|
|
863
|
+
* @param {Object} args - Move change arguments
|
|
864
|
+
* @param {string} args.changeId - Change ID to move (also accepts 'from' or 'source')
|
|
865
|
+
* @param {string} args.newParent - New parent change ID (also accepts 'to' or 'destination')
|
|
819
866
|
* @returns {Promise<Object>} Updated change object
|
|
820
867
|
*/
|
|
821
|
-
async
|
|
868
|
+
async moveChange(args) {
|
|
822
869
|
await graph.load();
|
|
823
870
|
|
|
824
871
|
// Support multiple parameter names for flexibility
|
|
@@ -906,110 +953,62 @@ export async function createJJ(options) {
|
|
|
906
953
|
},
|
|
907
954
|
|
|
908
955
|
/**
|
|
909
|
-
*
|
|
910
|
-
*
|
|
911
|
-
* @private
|
|
912
|
-
* @param {Object} args - Move arguments
|
|
913
|
-
* @returns {Promise<Object>} Operation result including from, to paths and file stats
|
|
956
|
+
* @deprecated Use moveFile() for files or moveChange() for history operations
|
|
957
|
+
* Move operation - delegates to moveFile or moveChange based on arguments
|
|
914
958
|
*/
|
|
915
|
-
async
|
|
916
|
-
if (!args
|
|
917
|
-
throw new JJError('INVALID_ARGUMENT', 'Missing or invalid
|
|
918
|
-
suggestion: '
|
|
919
|
-
provided: { from: args.from, type: typeof args.from },
|
|
920
|
-
});
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
if (!args.to || typeof args.to !== 'string') {
|
|
924
|
-
throw new JJError('INVALID_ARGUMENT', 'Missing or invalid to path', {
|
|
925
|
-
suggestion: 'Provide a valid destination file path',
|
|
926
|
-
provided: { to: args.to, type: typeof args.to },
|
|
959
|
+
async move(args) {
|
|
960
|
+
if (!args || typeof args !== 'object') {
|
|
961
|
+
throw new JJError('INVALID_ARGUMENT', 'Missing or invalid arguments', {
|
|
962
|
+
suggestion: 'Use moveFile({ from, to }) for files or moveChange({ changeId, newParent }) for history',
|
|
927
963
|
});
|
|
928
964
|
}
|
|
929
965
|
|
|
930
|
-
//
|
|
931
|
-
|
|
932
|
-
throw new JJError('INVALID_OPERATION', 'Source and destination paths are the same', {
|
|
933
|
-
path: args.from,
|
|
934
|
-
suggestion: 'Specify a different destination path',
|
|
935
|
-
});
|
|
936
|
-
}
|
|
966
|
+
// Detect operation type based on arguments
|
|
967
|
+
const isHistoryOp = this._detectHistoryOperation(args);
|
|
937
968
|
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
provided: { from: args.from, to: args.to },
|
|
943
|
-
});
|
|
969
|
+
if (isHistoryOp) {
|
|
970
|
+
return await this.moveChange(args);
|
|
971
|
+
} else {
|
|
972
|
+
return await this.moveFile(args);
|
|
944
973
|
}
|
|
974
|
+
},
|
|
945
975
|
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
976
|
+
/**
|
|
977
|
+
* Detect if move operation is for history (rebase) or files
|
|
978
|
+
*
|
|
979
|
+
* @private
|
|
980
|
+
* @param {Object} args - Move arguments
|
|
981
|
+
* @returns {boolean} True if history operation, false if file operation
|
|
982
|
+
*/
|
|
983
|
+
_detectHistoryOperation(args) {
|
|
984
|
+
// Explicit history operation indicators
|
|
985
|
+
if (args.paths || args.changeId || args.newParent) {
|
|
986
|
+
return true;
|
|
952
987
|
}
|
|
953
988
|
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
} catch (error) {
|
|
961
|
-
throw new JJError('FILE_NOT_FOUND', `Source file not found: ${args.from}`, {
|
|
962
|
-
path: args.from,
|
|
963
|
-
fullPath: fromPath,
|
|
964
|
-
suggestion: 'Check that the file exists',
|
|
965
|
-
});
|
|
966
|
-
}
|
|
989
|
+
// If only from/to are present, check if they look like change IDs
|
|
990
|
+
if (args.from && args.to && !args.changeId && !args.newParent && !args.paths) {
|
|
991
|
+
// Change IDs are 32-character hex strings
|
|
992
|
+
const changeIdPattern = /^[0-9a-f]{32}$/;
|
|
993
|
+
const fromLooksLikeChangeId = changeIdPattern.test(args.from);
|
|
994
|
+
const toLooksLikeChangeId = changeIdPattern.test(args.to);
|
|
967
995
|
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
`Failed to create destination directory: ${dirPath}`, {
|
|
978
|
-
directory: dirPath,
|
|
979
|
-
originalError: error.message,
|
|
996
|
+
// If both look like change IDs, it's likely a history operation
|
|
997
|
+
// However, we err on the side of file operations to be safe
|
|
998
|
+
// Users should use explicit { changeId, newParent } for clarity
|
|
999
|
+
if (fromLooksLikeChangeId && toLooksLikeChangeId) {
|
|
1000
|
+
// This is ambiguous - throw a helpful error
|
|
1001
|
+
throw new JJError('AMBIGUOUS_OPERATION',
|
|
1002
|
+
'Ambiguous move operation: arguments look like change IDs', {
|
|
1003
|
+
suggestion: 'Use { changeId, newParent } for history operations or ensure file paths don\'t match change ID pattern',
|
|
1004
|
+
args,
|
|
980
1005
|
});
|
|
981
1006
|
}
|
|
982
|
-
}
|
|
983
1007
|
|
|
984
|
-
|
|
985
|
-
try {
|
|
986
|
-
await fs.promises.rename(fromPath, toPath);
|
|
987
|
-
} catch (error) {
|
|
988
|
-
throw new JJError('FILE_MOVE_FAILED', `Failed to move file: ${error.message}`, {
|
|
989
|
-
from: args.from,
|
|
990
|
-
to: args.to,
|
|
991
|
-
originalError: error.message,
|
|
992
|
-
});
|
|
1008
|
+
return false; // Treat as file operation
|
|
993
1009
|
}
|
|
994
1010
|
|
|
995
|
-
|
|
996
|
-
await workingCopy.load();
|
|
997
|
-
await workingCopy.untrackFile(args.from);
|
|
998
|
-
const stats = await fs.promises.stat(toPath);
|
|
999
|
-
await workingCopy.trackFile(args.to, {
|
|
1000
|
-
mtime: stats.mtime,
|
|
1001
|
-
size: stats.size,
|
|
1002
|
-
mode: stats.mode,
|
|
1003
|
-
});
|
|
1004
|
-
|
|
1005
|
-
// Return useful information about the move operation
|
|
1006
|
-
return {
|
|
1007
|
-
from: args.from,
|
|
1008
|
-
to: args.to,
|
|
1009
|
-
size: stats.size,
|
|
1010
|
-
mode: stats.mode,
|
|
1011
|
-
mtime: stats.mtime,
|
|
1012
|
-
};
|
|
1011
|
+
return false;
|
|
1013
1012
|
},
|
|
1014
1013
|
|
|
1015
1014
|
/**
|
|
@@ -2516,7 +2515,7 @@ export async function createJJ(options) {
|
|
|
2516
2515
|
* });
|
|
2517
2516
|
*/
|
|
2518
2517
|
async rebase(args) {
|
|
2519
|
-
return await this.
|
|
2518
|
+
return await this.moveChange(args);
|
|
2520
2519
|
},
|
|
2521
2520
|
|
|
2522
2521
|
/**
|
package/src/types.d.ts
CHANGED
|
@@ -330,6 +330,24 @@ export interface MoveFileArgs {
|
|
|
330
330
|
to: string;
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
+
/**
|
|
334
|
+
* Move change (rebase) arguments
|
|
335
|
+
*/
|
|
336
|
+
export interface MoveChangeArgs {
|
|
337
|
+
/** Change ID to move (also accepts 'from' or 'source') */
|
|
338
|
+
changeId?: ChangeID;
|
|
339
|
+
/** Source change ID (alias for changeId) */
|
|
340
|
+
from?: ChangeID;
|
|
341
|
+
/** Source change ID (alias for changeId) */
|
|
342
|
+
source?: ChangeID;
|
|
343
|
+
/** New parent change ID (also accepts 'to' or 'destination') */
|
|
344
|
+
newParent?: ChangeID;
|
|
345
|
+
/** Destination change ID (alias for newParent) */
|
|
346
|
+
to?: ChangeID;
|
|
347
|
+
/** Destination change ID (alias for newParent) */
|
|
348
|
+
destination?: ChangeID;
|
|
349
|
+
}
|
|
350
|
+
|
|
333
351
|
/**
|
|
334
352
|
* Remove file arguments
|
|
335
353
|
*/
|
|
@@ -460,6 +478,8 @@ export interface UnabandonArgs {
|
|
|
460
478
|
export interface LogOptions {
|
|
461
479
|
revset?: Revset;
|
|
462
480
|
limit?: number;
|
|
481
|
+
/** If true, return count of commits instead of commit objects */
|
|
482
|
+
count?: boolean;
|
|
463
483
|
}
|
|
464
484
|
|
|
465
485
|
/**
|
|
@@ -856,6 +876,122 @@ export interface MergeResult {
|
|
|
856
876
|
conflicts: Conflict[];
|
|
857
877
|
}
|
|
858
878
|
|
|
879
|
+
/**
|
|
880
|
+
* Absorb operation arguments
|
|
881
|
+
*/
|
|
882
|
+
export interface AbsorbArgs {
|
|
883
|
+
/** Change to absorb into (optional, defaults to working copy parent) */
|
|
884
|
+
changeId?: ChangeID;
|
|
885
|
+
/** Destination change to absorb into (alias for changeId) */
|
|
886
|
+
destination?: ChangeID;
|
|
887
|
+
/** Dry run mode - don't apply changes */
|
|
888
|
+
dryRun?: boolean;
|
|
889
|
+
/** Specific paths to absorb */
|
|
890
|
+
paths?: string[];
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
/**
|
|
894
|
+
* Absorb operation result
|
|
895
|
+
*/
|
|
896
|
+
export interface AbsorbResult {
|
|
897
|
+
/** Changes that were absorbed */
|
|
898
|
+
absorbed: Array<{
|
|
899
|
+
path: string;
|
|
900
|
+
hunks: number;
|
|
901
|
+
destination: ChangeID;
|
|
902
|
+
}>;
|
|
903
|
+
/** Changes affected by the absorb */
|
|
904
|
+
affectedChanges: ChangeID[];
|
|
905
|
+
/** Changes that would be absorbed (dry run mode) */
|
|
906
|
+
wouldAbsorb?: Array<{
|
|
907
|
+
path: string;
|
|
908
|
+
hunks: number;
|
|
909
|
+
destination: ChangeID;
|
|
910
|
+
}>;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
/**
|
|
914
|
+
* Bisect start arguments
|
|
915
|
+
*/
|
|
916
|
+
export interface BisectStartArgs {
|
|
917
|
+
/** Good change ID */
|
|
918
|
+
good: ChangeID;
|
|
919
|
+
/** Bad change ID */
|
|
920
|
+
bad: ChangeID;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* Bisect state
|
|
925
|
+
*/
|
|
926
|
+
export interface BisectState {
|
|
927
|
+
/** Whether bisect is active */
|
|
928
|
+
active: boolean;
|
|
929
|
+
/** Good change */
|
|
930
|
+
good?: ChangeID;
|
|
931
|
+
/** Bad change */
|
|
932
|
+
bad?: ChangeID;
|
|
933
|
+
/** Current change being tested */
|
|
934
|
+
current?: ChangeID;
|
|
935
|
+
/** Remaining changes to test */
|
|
936
|
+
remaining?: number;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
/**
|
|
940
|
+
* Sparse checkout set arguments
|
|
941
|
+
*/
|
|
942
|
+
export interface SparseSetArgs {
|
|
943
|
+
/** Patterns to set (replaces existing patterns) */
|
|
944
|
+
patterns: string[];
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Sparse checkout add arguments
|
|
949
|
+
*/
|
|
950
|
+
export interface SparseAddArgs {
|
|
951
|
+
/** Patterns to add to existing sparse checkout */
|
|
952
|
+
patterns: string[];
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* Sparse checkout remove arguments
|
|
957
|
+
*/
|
|
958
|
+
export interface SparseRemoveArgs {
|
|
959
|
+
/** Patterns to remove from sparse checkout */
|
|
960
|
+
patterns: string[];
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
/**
|
|
964
|
+
* Merge driver for custom file merging
|
|
965
|
+
*/
|
|
966
|
+
export interface MergeDriver {
|
|
967
|
+
/** Driver name */
|
|
968
|
+
name: string;
|
|
969
|
+
/** Detect if this driver should handle a file */
|
|
970
|
+
detect(path: string, content: string): boolean;
|
|
971
|
+
/** Merge three versions of a file */
|
|
972
|
+
merge(args: {
|
|
973
|
+
path: string;
|
|
974
|
+
base: string;
|
|
975
|
+
ours: string;
|
|
976
|
+
theirs: string;
|
|
977
|
+
}): {
|
|
978
|
+
merged: string;
|
|
979
|
+
conflicts?: Array<{ line: number; message: string }>;
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
/**
|
|
984
|
+
* Merge driver registry
|
|
985
|
+
*/
|
|
986
|
+
export interface MergeDriverRegistry {
|
|
987
|
+
/** Register a custom merge driver */
|
|
988
|
+
register(driver: MergeDriver): void;
|
|
989
|
+
/** Get driver for a file path */
|
|
990
|
+
getDriver(path: string, content: string): MergeDriver | null;
|
|
991
|
+
/** List all registered drivers */
|
|
992
|
+
list(): MergeDriver[];
|
|
993
|
+
}
|
|
994
|
+
|
|
859
995
|
// ============================================================================
|
|
860
996
|
// Main JJ Repository Interface
|
|
861
997
|
// ============================================================================
|
|
@@ -875,6 +1011,7 @@ export interface JJ {
|
|
|
875
1011
|
revset: any;
|
|
876
1012
|
gitBackend?: any;
|
|
877
1013
|
backgroundOps?: any;
|
|
1014
|
+
mergeDrivers: MergeDriverRegistry;
|
|
878
1015
|
|
|
879
1016
|
// Repository lifecycle
|
|
880
1017
|
init(opts?: InitOptions): Promise<void>;
|
|
@@ -883,7 +1020,12 @@ export interface JJ {
|
|
|
883
1020
|
write(args: WriteArgs): Promise<WriteResult>;
|
|
884
1021
|
read(args: ReadArgs): Promise<string | Uint8Array>;
|
|
885
1022
|
cat(args: ReadArgs): Promise<string | Uint8Array>;
|
|
886
|
-
|
|
1023
|
+
moveFile(args: MoveFileArgs): Promise<MoveResult>;
|
|
1024
|
+
moveChange(args: MoveChangeArgs): Promise<Change>;
|
|
1025
|
+
/**
|
|
1026
|
+
* @deprecated Use moveFile() for files or moveChange() for history operations
|
|
1027
|
+
*/
|
|
1028
|
+
move(args: MoveFileArgs | MoveChangeArgs): Promise<MoveResult | Change>;
|
|
887
1029
|
remove(args: RemoveArgs): Promise<RemoveResult>;
|
|
888
1030
|
listFiles(args?: ListFilesArgs): Promise<string[]>;
|
|
889
1031
|
readStream(args: ReadStreamArgs): Promise<any>;
|
|
@@ -904,9 +1046,11 @@ export interface JJ {
|
|
|
904
1046
|
rebase(args: RebaseArgs): Promise<Change>;
|
|
905
1047
|
abandon(args: AbandonArgs): Promise<void>;
|
|
906
1048
|
unabandon(args: UnabandonArgs): Promise<void>;
|
|
1049
|
+
absorb(args?: AbsorbArgs): Promise<AbsorbResult>;
|
|
907
1050
|
|
|
908
1051
|
// Queries
|
|
909
|
-
log(opts?: LogOptions): Promise<LogEntry[]>;
|
|
1052
|
+
log(opts?: LogOptions & { count?: false }): Promise<LogEntry[]>;
|
|
1053
|
+
log(opts: LogOptions & { count: true }): Promise<number>;
|
|
910
1054
|
show(args: ShowArgs): Promise<Change>;
|
|
911
1055
|
obslog(opts?: ObslogOptions): Promise<Operation[]>;
|
|
912
1056
|
|
|
@@ -1104,6 +1248,25 @@ export interface JJ {
|
|
|
1104
1248
|
}>;
|
|
1105
1249
|
parent: ChangeID;
|
|
1106
1250
|
}>;
|
|
1251
|
+
|
|
1252
|
+
// Bisect operations
|
|
1253
|
+
bisect: {
|
|
1254
|
+
start(args: BisectStartArgs): Promise<void>;
|
|
1255
|
+
good(): Promise<void>;
|
|
1256
|
+
bad(): Promise<void>;
|
|
1257
|
+
status(): Promise<BisectState>;
|
|
1258
|
+
reset(): Promise<void>;
|
|
1259
|
+
};
|
|
1260
|
+
|
|
1261
|
+
// Sparse checkout
|
|
1262
|
+
sparse: {
|
|
1263
|
+
list(): Promise<string[]>;
|
|
1264
|
+
set(args: SparseSetArgs): Promise<void>;
|
|
1265
|
+
add(args: SparseAddArgs): Promise<void>;
|
|
1266
|
+
remove(args: SparseRemoveArgs): Promise<void>;
|
|
1267
|
+
reset(): Promise<void>;
|
|
1268
|
+
clear(): Promise<void>;
|
|
1269
|
+
};
|
|
1107
1270
|
}
|
|
1108
1271
|
|
|
1109
1272
|
// ============================================================================
|