Fossil SCM

Add the "--tree DIRECTORY" option to the "fossil diff" command.

drh 2024-12-14 19:52 trunk
Commit 07a699738a2f3e9e086bfc82d05599d416ffce4699e8afc350b5229d5043040f
2 files changed +2 -2 +74 -12
+2 -2
--- src/checkin.c
+++ src/checkin.c
@@ -1563,17 +1563,17 @@
15631563
break;
15641564
}
15651565
diffFiles[i].nName = strlen(diffFiles[i].zName);
15661566
diffFiles[i].nUsed = 0;
15671567
}
1568
- diff_against_disk(0, &DCfg, diffFiles, &prompt);
1568
+ diff_version_to_checkout(0, &DCfg, diffFiles, &prompt);
15691569
for( i=0; diffFiles[i].zName; ++i ){
15701570
fossil_free(diffFiles[i].zName);
15711571
}
15721572
fossil_free(diffFiles);
15731573
}else{
1574
- diff_against_disk(0, &DCfg, 0, &prompt);
1574
+ diff_version_to_checkout(0, &DCfg, 0, &prompt);
15751575
}
15761576
}
15771577
prompt_for_user_comment(pComment, &prompt);
15781578
blob_reset(&prompt);
15791579
}
15801580
--- src/checkin.c
+++ src/checkin.c
@@ -1563,17 +1563,17 @@
1563 break;
1564 }
1565 diffFiles[i].nName = strlen(diffFiles[i].zName);
1566 diffFiles[i].nUsed = 0;
1567 }
1568 diff_against_disk(0, &DCfg, diffFiles, &prompt);
1569 for( i=0; diffFiles[i].zName; ++i ){
1570 fossil_free(diffFiles[i].zName);
1571 }
1572 fossil_free(diffFiles);
1573 }else{
1574 diff_against_disk(0, &DCfg, 0, &prompt);
1575 }
1576 }
1577 prompt_for_user_comment(pComment, &prompt);
1578 blob_reset(&prompt);
1579 }
1580
--- src/checkin.c
+++ src/checkin.c
@@ -1563,17 +1563,17 @@
1563 break;
1564 }
1565 diffFiles[i].nName = strlen(diffFiles[i].zName);
1566 diffFiles[i].nUsed = 0;
1567 }
1568 diff_version_to_checkout(0, &DCfg, diffFiles, &prompt);
1569 for( i=0; diffFiles[i].zName; ++i ){
1570 fossil_free(diffFiles[i].zName);
1571 }
1572 fossil_free(diffFiles);
1573 }else{
1574 diff_version_to_checkout(0, &DCfg, 0, &prompt);
1575 }
1576 }
1577 prompt_for_user_comment(pComment, &prompt);
1578 blob_reset(&prompt);
1579 }
1580
+74 -12
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -784,26 +784,27 @@
784784
blob_reset(&file);
785785
return rc;
786786
}
787787
788788
/*
789
-** Run a diff between the version zFrom and files on disk. zFrom might
790
-** be NULL which means to simply show the difference between the edited
791
-** files on disk and the check-out on which they are based.
789
+** Run a diff between the version zFrom and files on disk in the current
790
+** working checkout. zFrom might be NULL which means to simply show the
791
+** difference between the edited files on disk and the check-out on which
792
+** they are based.
792793
**
793794
** Use the internal diff logic if zDiffCmd is NULL. Otherwise call the
794795
** command zDiffCmd to do the diffing.
795796
**
796797
** When using an external diff program, zBinGlob contains the GLOB patterns
797798
** for file names to treat as binary. If fIncludeBinary is zero, these files
798799
** will be skipped in addition to files that may contain binary content.
799800
*/
800
-void diff_against_disk(
801
+void diff_version_to_checkout(
801802
const char *zFrom, /* Version to difference from */
802803
DiffConfig *pCfg, /* Flags controlling diff output */
803804
FileDirList *pFileDir, /* Which files to diff */
804
- Blob *pOut /* Blob to output diff instead of stdout */
805
+ Blob *pOut /* Blob to output diff instead of stdout */
805806
){
806807
int vid;
807808
Blob sql;
808809
Stmt q;
809810
int asNewFile; /* Treat non-existant files as empty files */
@@ -928,20 +929,20 @@
928929
db_finalize(&q);
929930
db_end_transaction(1); /* ROLLBACK */
930931
}
931932
932933
/*
933
-** Run a diff between the undo buffer and files on disk.
934
+** Run a diff from the undo buffer to files on disk.
934935
**
935936
** Use the internal diff logic if zDiffCmd is NULL. Otherwise call the
936937
** command zDiffCmd to do the diffing.
937938
**
938939
** When using an external diff program, zBinGlob contains the GLOB patterns
939940
** for file names to treat as binary. If fIncludeBinary is zero, these files
940941
** will be skipped in addition to files that may contain binary content.
941942
*/
942
-static void diff_against_undo(
943
+static void diff_undo_to_checkout(
943944
DiffConfig *pCfg, /* Flags controlling diff output */
944945
FileDirList *pFileDir /* List of files and directories to diff */
945946
){
946947
Stmt q;
947948
Blob content;
@@ -1088,10 +1089,62 @@
10881089
}
10891090
}
10901091
manifest_destroy(pFrom);
10911092
manifest_destroy(pTo);
10921093
}
1094
+
1095
+/*
1096
+** Compute the difference from an external tree of files to the current
1097
+** working checkout with its edits.
1098
+**
1099
+** To put it another way: Every managed file in the current working
1100
+** checkout is compared to the file with same under in zTree. The zTree
1101
+** files are on the left and the files in the current working directory
1102
+** are on the right.
1103
+*/
1104
+void diff_tree_to_checkout(
1105
+ const char *zExternTree, /* Remote tree to use as the baseline */
1106
+ DiffConfig *pCfg, /* Diff settings */
1107
+ FileDirList *pFileDir /* Only look at these files */
1108
+){
1109
+ int vid;
1110
+ Stmt q;
1111
+
1112
+ vid = db_lget_int("checkout",0);
1113
+ if( file_isdir(zExternTree, ExtFILE)!=1 ){
1114
+ fossil_fatal("\"%s\" is not a directory", zExternTree);
1115
+ }
1116
+ db_prepare(&q,
1117
+ "SELECT pathname FROM vfile WHERE vid=%d ORDER BY pathname",
1118
+ vid
1119
+ );
1120
+ while( db_step(&q)==SQLITE_ROW ){
1121
+ const char *zTreename = db_column_text(&q,0);
1122
+ char *zLhs = mprintf("%s/%s", zExternTree, zTreename);
1123
+ char *zRhs = mprintf("%s%s", g.zLocalRoot, zTreename);
1124
+ Blob rhs;
1125
+ Blob lhs;
1126
+ if( file_size(zLhs, ExtFILE)<0 ){
1127
+ blob_zero(&lhs);
1128
+ }else{
1129
+ blob_read_from_file(&lhs, zLhs, ExtFILE);
1130
+ }
1131
+ blob_read_from_file(&rhs, zRhs, ExtFILE);
1132
+ if( blob_size(&lhs)!=blob_size(&rhs)
1133
+ || memcmp(blob_buffer(&lhs), blob_buffer(&rhs), blob_size(&lhs))!=0
1134
+ ){
1135
+ diff_print_index(zTreename, pCfg, 0);
1136
+ diff_file_mem(&lhs, &rhs, zTreename, pCfg);
1137
+ }
1138
+ blob_reset(&lhs);
1139
+ blob_reset(&rhs);
1140
+ fossil_free(zLhs);
1141
+ fossil_free(zRhs);
1142
+ }
1143
+ db_finalize(&q);
1144
+}
1145
+
10931146
10941147
/*
10951148
** Return the name of the external diff command, or return NULL if
10961149
** no external diff command is defined.
10971150
*/
@@ -1270,10 +1323,11 @@
12701323
** --strip-trailing-cr Strip trailing CR
12711324
** --tcl Tcl-formatted output used internally by --tk
12721325
** --tclsh PATH Tcl/Tk shell used for --tk (default: "tclsh")
12731326
** --tk Launch a Tcl/Tk GUI for display
12741327
** --to VERSION Select VERSION as target for the diff
1328
+** --tree DIR Use files under DIR as the baseline
12751329
** --undo Diff against the "undo" buffer
12761330
** --unified Unified diff
12771331
** -v|--verbose Output complete text of added or deleted files
12781332
** -h|--versions Show compared versions in the diff header
12791333
** --webpage Format output as a stand-alone HTML webpage
@@ -1284,10 +1338,11 @@
12841338
int isGDiff; /* True for gdiff. False for normal diff */
12851339
const char *zFrom; /* Source version number */
12861340
const char *zTo; /* Target version number */
12871341
const char *zCheckin; /* Check-in version number */
12881342
const char *zBranch; /* Branch to diff */
1343
+ const char *zTree; /* The --tree */
12891344
int againstUndo = 0; /* Diff against files in the undo buffer */
12901345
FileDirList *pFileDir = 0; /* Restrict the diff to these files */
12911346
DiffConfig DCfg; /* Diff configuration object */
12921347
12931348
if( find_option("tk",0,0)!=0 || has_option("tclsh") ){
@@ -1297,12 +1352,17 @@
12971352
isGDiff = g.argv[1][0]=='g';
12981353
zFrom = find_option("from", "r", 1);
12991354
zTo = find_option("to", 0, 1);
13001355
zCheckin = find_option("checkin", "ci", 1);
13011356
zBranch = find_option("branch", 0, 1);
1357
+ zTree = find_option("tree", 0, 1);
13021358
againstUndo = find_option("undo",0,0)!=0;
1303
- if( againstUndo && ( zFrom!=0 || zTo!=0 || zCheckin!=0 || zBranch!=0) ){
1359
+ if( zTree && (zFrom || zTo || zCheckin || zBranch || againstUndo) ){
1360
+ fossil_fatal("cannot use --tree together with --from, --to, --checkin,"
1361
+ " --branch, or --undo");
1362
+ }
1363
+ if( againstUndo && (zFrom!=0 || zTo!=0 || zCheckin!=0 || zBranch!=0) ){
13041364
fossil_fatal("cannot use --undo together with --from, --to, --checkin,"
13051365
" or --branch");
13061366
}
13071367
if( zBranch ){
13081368
if( zTo || zFrom || zCheckin ){
@@ -1309,11 +1369,11 @@
13091369
fossil_fatal("cannot use --from, --to, or --checkin with --branch");
13101370
}
13111371
zTo = zBranch;
13121372
zFrom = mprintf("root:%s", zBranch);
13131373
}
1314
- if( zCheckin!=0 && ( zFrom!=0 || zTo!=0 ) ){
1374
+ if( zCheckin!=0 && (zFrom!=0 || zTo!=0) ){
13151375
fossil_fatal("cannot use --checkin together with --from or --to");
13161376
}
13171377
diff_options(&DCfg, isGDiff, 0);
13181378
determine_exec_relative_option(1);
13191379
if( 0==zCheckin ){
@@ -1357,18 +1417,20 @@
13571417
if( zFrom==0 ){
13581418
fossil_fatal("check-in %s has no parent", zTo);
13591419
}
13601420
}
13611421
diff_begin(&DCfg);
1362
- if( againstUndo ){
1422
+ if( zTree ){
1423
+ diff_tree_to_checkout(zTree, &DCfg, pFileDir);
1424
+ }else if( againstUndo ){
13631425
if( db_lget_int("undo_available",0)==0 ){
13641426
fossil_print("No undo or redo is available\n");
13651427
return;
13661428
}
1367
- diff_against_undo(&DCfg, pFileDir);
1429
+ diff_undo_to_checkout(&DCfg, pFileDir);
13681430
}else if( zTo==0 ){
1369
- diff_against_disk(zFrom, &DCfg, pFileDir, 0);
1431
+ diff_version_to_checkout(zFrom, &DCfg, pFileDir, 0);
13701432
}else{
13711433
diff_two_versions(zFrom, zTo, &DCfg, pFileDir);
13721434
}
13731435
if( pFileDir ){
13741436
int i;
13751437
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -784,26 +784,27 @@
784 blob_reset(&file);
785 return rc;
786 }
787
788 /*
789 ** Run a diff between the version zFrom and files on disk. zFrom might
790 ** be NULL which means to simply show the difference between the edited
791 ** files on disk and the check-out on which they are based.
 
792 **
793 ** Use the internal diff logic if zDiffCmd is NULL. Otherwise call the
794 ** command zDiffCmd to do the diffing.
795 **
796 ** When using an external diff program, zBinGlob contains the GLOB patterns
797 ** for file names to treat as binary. If fIncludeBinary is zero, these files
798 ** will be skipped in addition to files that may contain binary content.
799 */
800 void diff_against_disk(
801 const char *zFrom, /* Version to difference from */
802 DiffConfig *pCfg, /* Flags controlling diff output */
803 FileDirList *pFileDir, /* Which files to diff */
804 Blob *pOut /* Blob to output diff instead of stdout */
805 ){
806 int vid;
807 Blob sql;
808 Stmt q;
809 int asNewFile; /* Treat non-existant files as empty files */
@@ -928,20 +929,20 @@
928 db_finalize(&q);
929 db_end_transaction(1); /* ROLLBACK */
930 }
931
932 /*
933 ** Run a diff between the undo buffer and files on disk.
934 **
935 ** Use the internal diff logic if zDiffCmd is NULL. Otherwise call the
936 ** command zDiffCmd to do the diffing.
937 **
938 ** When using an external diff program, zBinGlob contains the GLOB patterns
939 ** for file names to treat as binary. If fIncludeBinary is zero, these files
940 ** will be skipped in addition to files that may contain binary content.
941 */
942 static void diff_against_undo(
943 DiffConfig *pCfg, /* Flags controlling diff output */
944 FileDirList *pFileDir /* List of files and directories to diff */
945 ){
946 Stmt q;
947 Blob content;
@@ -1088,10 +1089,62 @@
1088 }
1089 }
1090 manifest_destroy(pFrom);
1091 manifest_destroy(pTo);
1092 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1093
1094 /*
1095 ** Return the name of the external diff command, or return NULL if
1096 ** no external diff command is defined.
1097 */
@@ -1270,10 +1323,11 @@
1270 ** --strip-trailing-cr Strip trailing CR
1271 ** --tcl Tcl-formatted output used internally by --tk
1272 ** --tclsh PATH Tcl/Tk shell used for --tk (default: "tclsh")
1273 ** --tk Launch a Tcl/Tk GUI for display
1274 ** --to VERSION Select VERSION as target for the diff
 
1275 ** --undo Diff against the "undo" buffer
1276 ** --unified Unified diff
1277 ** -v|--verbose Output complete text of added or deleted files
1278 ** -h|--versions Show compared versions in the diff header
1279 ** --webpage Format output as a stand-alone HTML webpage
@@ -1284,10 +1338,11 @@
1284 int isGDiff; /* True for gdiff. False for normal diff */
1285 const char *zFrom; /* Source version number */
1286 const char *zTo; /* Target version number */
1287 const char *zCheckin; /* Check-in version number */
1288 const char *zBranch; /* Branch to diff */
 
1289 int againstUndo = 0; /* Diff against files in the undo buffer */
1290 FileDirList *pFileDir = 0; /* Restrict the diff to these files */
1291 DiffConfig DCfg; /* Diff configuration object */
1292
1293 if( find_option("tk",0,0)!=0 || has_option("tclsh") ){
@@ -1297,12 +1352,17 @@
1297 isGDiff = g.argv[1][0]=='g';
1298 zFrom = find_option("from", "r", 1);
1299 zTo = find_option("to", 0, 1);
1300 zCheckin = find_option("checkin", "ci", 1);
1301 zBranch = find_option("branch", 0, 1);
 
1302 againstUndo = find_option("undo",0,0)!=0;
1303 if( againstUndo && ( zFrom!=0 || zTo!=0 || zCheckin!=0 || zBranch!=0) ){
 
 
 
 
1304 fossil_fatal("cannot use --undo together with --from, --to, --checkin,"
1305 " or --branch");
1306 }
1307 if( zBranch ){
1308 if( zTo || zFrom || zCheckin ){
@@ -1309,11 +1369,11 @@
1309 fossil_fatal("cannot use --from, --to, or --checkin with --branch");
1310 }
1311 zTo = zBranch;
1312 zFrom = mprintf("root:%s", zBranch);
1313 }
1314 if( zCheckin!=0 && ( zFrom!=0 || zTo!=0 ) ){
1315 fossil_fatal("cannot use --checkin together with --from or --to");
1316 }
1317 diff_options(&DCfg, isGDiff, 0);
1318 determine_exec_relative_option(1);
1319 if( 0==zCheckin ){
@@ -1357,18 +1417,20 @@
1357 if( zFrom==0 ){
1358 fossil_fatal("check-in %s has no parent", zTo);
1359 }
1360 }
1361 diff_begin(&DCfg);
1362 if( againstUndo ){
 
 
1363 if( db_lget_int("undo_available",0)==0 ){
1364 fossil_print("No undo or redo is available\n");
1365 return;
1366 }
1367 diff_against_undo(&DCfg, pFileDir);
1368 }else if( zTo==0 ){
1369 diff_against_disk(zFrom, &DCfg, pFileDir, 0);
1370 }else{
1371 diff_two_versions(zFrom, zTo, &DCfg, pFileDir);
1372 }
1373 if( pFileDir ){
1374 int i;
1375
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -784,26 +784,27 @@
784 blob_reset(&file);
785 return rc;
786 }
787
788 /*
789 ** Run a diff between the version zFrom and files on disk in the current
790 ** working checkout. zFrom might be NULL which means to simply show the
791 ** difference between the edited files on disk and the check-out on which
792 ** they are based.
793 **
794 ** Use the internal diff logic if zDiffCmd is NULL. Otherwise call the
795 ** command zDiffCmd to do the diffing.
796 **
797 ** When using an external diff program, zBinGlob contains the GLOB patterns
798 ** for file names to treat as binary. If fIncludeBinary is zero, these files
799 ** will be skipped in addition to files that may contain binary content.
800 */
801 void diff_version_to_checkout(
802 const char *zFrom, /* Version to difference from */
803 DiffConfig *pCfg, /* Flags controlling diff output */
804 FileDirList *pFileDir, /* Which files to diff */
805 Blob *pOut /* Blob to output diff instead of stdout */
806 ){
807 int vid;
808 Blob sql;
809 Stmt q;
810 int asNewFile; /* Treat non-existant files as empty files */
@@ -928,20 +929,20 @@
929 db_finalize(&q);
930 db_end_transaction(1); /* ROLLBACK */
931 }
932
933 /*
934 ** Run a diff from the undo buffer to files on disk.
935 **
936 ** Use the internal diff logic if zDiffCmd is NULL. Otherwise call the
937 ** command zDiffCmd to do the diffing.
938 **
939 ** When using an external diff program, zBinGlob contains the GLOB patterns
940 ** for file names to treat as binary. If fIncludeBinary is zero, these files
941 ** will be skipped in addition to files that may contain binary content.
942 */
943 static void diff_undo_to_checkout(
944 DiffConfig *pCfg, /* Flags controlling diff output */
945 FileDirList *pFileDir /* List of files and directories to diff */
946 ){
947 Stmt q;
948 Blob content;
@@ -1088,10 +1089,62 @@
1089 }
1090 }
1091 manifest_destroy(pFrom);
1092 manifest_destroy(pTo);
1093 }
1094
1095 /*
1096 ** Compute the difference from an external tree of files to the current
1097 ** working checkout with its edits.
1098 **
1099 ** To put it another way: Every managed file in the current working
1100 ** checkout is compared to the file with same under in zTree. The zTree
1101 ** files are on the left and the files in the current working directory
1102 ** are on the right.
1103 */
1104 void diff_tree_to_checkout(
1105 const char *zExternTree, /* Remote tree to use as the baseline */
1106 DiffConfig *pCfg, /* Diff settings */
1107 FileDirList *pFileDir /* Only look at these files */
1108 ){
1109 int vid;
1110 Stmt q;
1111
1112 vid = db_lget_int("checkout",0);
1113 if( file_isdir(zExternTree, ExtFILE)!=1 ){
1114 fossil_fatal("\"%s\" is not a directory", zExternTree);
1115 }
1116 db_prepare(&q,
1117 "SELECT pathname FROM vfile WHERE vid=%d ORDER BY pathname",
1118 vid
1119 );
1120 while( db_step(&q)==SQLITE_ROW ){
1121 const char *zTreename = db_column_text(&q,0);
1122 char *zLhs = mprintf("%s/%s", zExternTree, zTreename);
1123 char *zRhs = mprintf("%s%s", g.zLocalRoot, zTreename);
1124 Blob rhs;
1125 Blob lhs;
1126 if( file_size(zLhs, ExtFILE)<0 ){
1127 blob_zero(&lhs);
1128 }else{
1129 blob_read_from_file(&lhs, zLhs, ExtFILE);
1130 }
1131 blob_read_from_file(&rhs, zRhs, ExtFILE);
1132 if( blob_size(&lhs)!=blob_size(&rhs)
1133 || memcmp(blob_buffer(&lhs), blob_buffer(&rhs), blob_size(&lhs))!=0
1134 ){
1135 diff_print_index(zTreename, pCfg, 0);
1136 diff_file_mem(&lhs, &rhs, zTreename, pCfg);
1137 }
1138 blob_reset(&lhs);
1139 blob_reset(&rhs);
1140 fossil_free(zLhs);
1141 fossil_free(zRhs);
1142 }
1143 db_finalize(&q);
1144 }
1145
1146
1147 /*
1148 ** Return the name of the external diff command, or return NULL if
1149 ** no external diff command is defined.
1150 */
@@ -1270,10 +1323,11 @@
1323 ** --strip-trailing-cr Strip trailing CR
1324 ** --tcl Tcl-formatted output used internally by --tk
1325 ** --tclsh PATH Tcl/Tk shell used for --tk (default: "tclsh")
1326 ** --tk Launch a Tcl/Tk GUI for display
1327 ** --to VERSION Select VERSION as target for the diff
1328 ** --tree DIR Use files under DIR as the baseline
1329 ** --undo Diff against the "undo" buffer
1330 ** --unified Unified diff
1331 ** -v|--verbose Output complete text of added or deleted files
1332 ** -h|--versions Show compared versions in the diff header
1333 ** --webpage Format output as a stand-alone HTML webpage
@@ -1284,10 +1338,11 @@
1338 int isGDiff; /* True for gdiff. False for normal diff */
1339 const char *zFrom; /* Source version number */
1340 const char *zTo; /* Target version number */
1341 const char *zCheckin; /* Check-in version number */
1342 const char *zBranch; /* Branch to diff */
1343 const char *zTree; /* The --tree */
1344 int againstUndo = 0; /* Diff against files in the undo buffer */
1345 FileDirList *pFileDir = 0; /* Restrict the diff to these files */
1346 DiffConfig DCfg; /* Diff configuration object */
1347
1348 if( find_option("tk",0,0)!=0 || has_option("tclsh") ){
@@ -1297,12 +1352,17 @@
1352 isGDiff = g.argv[1][0]=='g';
1353 zFrom = find_option("from", "r", 1);
1354 zTo = find_option("to", 0, 1);
1355 zCheckin = find_option("checkin", "ci", 1);
1356 zBranch = find_option("branch", 0, 1);
1357 zTree = find_option("tree", 0, 1);
1358 againstUndo = find_option("undo",0,0)!=0;
1359 if( zTree && (zFrom || zTo || zCheckin || zBranch || againstUndo) ){
1360 fossil_fatal("cannot use --tree together with --from, --to, --checkin,"
1361 " --branch, or --undo");
1362 }
1363 if( againstUndo && (zFrom!=0 || zTo!=0 || zCheckin!=0 || zBranch!=0) ){
1364 fossil_fatal("cannot use --undo together with --from, --to, --checkin,"
1365 " or --branch");
1366 }
1367 if( zBranch ){
1368 if( zTo || zFrom || zCheckin ){
@@ -1309,11 +1369,11 @@
1369 fossil_fatal("cannot use --from, --to, or --checkin with --branch");
1370 }
1371 zTo = zBranch;
1372 zFrom = mprintf("root:%s", zBranch);
1373 }
1374 if( zCheckin!=0 && (zFrom!=0 || zTo!=0) ){
1375 fossil_fatal("cannot use --checkin together with --from or --to");
1376 }
1377 diff_options(&DCfg, isGDiff, 0);
1378 determine_exec_relative_option(1);
1379 if( 0==zCheckin ){
@@ -1357,18 +1417,20 @@
1417 if( zFrom==0 ){
1418 fossil_fatal("check-in %s has no parent", zTo);
1419 }
1420 }
1421 diff_begin(&DCfg);
1422 if( zTree ){
1423 diff_tree_to_checkout(zTree, &DCfg, pFileDir);
1424 }else if( againstUndo ){
1425 if( db_lget_int("undo_available",0)==0 ){
1426 fossil_print("No undo or redo is available\n");
1427 return;
1428 }
1429 diff_undo_to_checkout(&DCfg, pFileDir);
1430 }else if( zTo==0 ){
1431 diff_version_to_checkout(zFrom, &DCfg, pFileDir, 0);
1432 }else{
1433 diff_two_versions(zFrom, zTo, &DCfg, pFileDir);
1434 }
1435 if( pFileDir ){
1436 int i;
1437

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button