Fossil SCM

merge trunk

jan.nijtmans 2012-11-26 22:47 ticket-d17d6e5b17 merge
Commit f05090e5e8369f6ae91940f4165388e59f68d119
1 file changed +45 -23
+45 -23
--- src/checkin.c
+++ src/checkin.c
@@ -656,11 +656,11 @@
656656
" AND type='ci' AND objid=%d",
657657
zDate, rid
658658
);
659659
if( b ){
660660
fossil_fatal("ancestor check-in [%.10s] (%s) is not older (clock skew?)"
661
- " Use -f to override.", zUuid, zDate);
661
+ " Use --allow-older to override.", zUuid, zDate);
662662
}
663663
#endif
664664
}
665665
666666
/*
@@ -987,32 +987,45 @@
987987
**
988988
** The --bgcolor option works like --branchcolor but only sets the
989989
** background color for a single check-in. Subsequent check-ins revert
990990
** to the default color.
991991
**
992
-** A check-in is not permitted to fork unless the --force or -f
993
-** option appears. A check-in is not allowed against a closed leaf.
992
+** A check-in is not permitted to fork unless the --allow-fork option
993
+** appears. An empty check-in (i.e. with nothing changed) is not
994
+** allowed unless the --allow-empty option appears. A check-in may not
995
+** be older than its ancestor unless the --allow-older option appears.
996
+** If any of files in the check-in appear to contain unresolved merge
997
+** conflicts, the check-in will not be allowed unless the
998
+** --allow-conflict option is present. In addition, the entire
999
+** check-in process may be aborted if a file contains content that
1000
+** appears to be binary, Unicode text, or text with CR/NL line endings
1001
+** unless the interactive user chooses to proceed. If there is no
1002
+** interactive user or these warnings should be skipped for some other
1003
+** reason, the --no-warnings option may be used. A check-in is not
1004
+** allowed against a closed leaf.
9941005
**
9951006
** The --private option creates a private check-in that is never synced.
9961007
** Children of private check-ins are automatically private.
9971008
**
9981009
** the --tag option applies the symbolic tag name to the check-in.
9991010
**
10001011
** Options:
1012
+** --allow-conflict allow unresolved merge conflicts
1013
+** --allow-empty allow a commit with no changes
1014
+** --allow-fork allow the commit to fork
1015
+** --allow-older allow a commit older than its ancestor
10011016
** --baseline use a baseline manifest in the commit process
10021017
** --bgcolor COLOR apply COLOR to this one check-in only
10031018
** --branch NEW-BRANCH-NAME check in to this new branch
10041019
** --branchcolor COLOR apply given COLOR to the branch
10051020
** --comment|-m COMMENT-TEXT use COMMENT-TEXT as commit comment
10061021
** --delta use a delta manifest in the commit process
1007
-** --force|-f allow forking with this commit
10081022
** --message-file|-M FILE read the commit comment from given file
1023
+** --no-warnings omit all warnings about file contents
10091024
** --nosign do not attempt to sign this commit with gpg
10101025
** --private do not sync changes and their descendants
10111026
** --tag TAG-NAME assign given tag TAG-NAME to the checkin
1012
-** --conflict allow unresolved merge conflicts
1013
-** --binary-ok do not warn about committing binary files
10141027
**
10151028
** See also: branch, changes, checkout, extra, sync
10161029
*/
10171030
void commit_cmd(void){
10181031
int hasChanges; /* True if unsaved changes exist */
@@ -1024,15 +1037,17 @@
10241037
Stmt q; /* Query to find files that have been modified */
10251038
char *zUuid; /* UUID of the new check-in */
10261039
int noSign = 0; /* True to omit signing the manifest using GPG */
10271040
int isAMerge = 0; /* True if checking in a merge */
10281041
int noWarningFlag = 0; /* True if skipping all warnings */
1029
- int forceFlag = 0; /* Force a fork */
1042
+ int forceFlag = 0; /* Undocumented: Disables all checks */
10301043
int forceDelta = 0; /* Force a delta-manifest */
10311044
int forceBaseline = 0; /* Force a baseline-manifest */
10321045
int allowConflict = 0; /* Allow unresolve merge conflicts */
1033
- int binaryOk = 0; /* The --binary-ok flag */
1046
+ int allowEmpty = 0; /* Allow a commit with no changes */
1047
+ int allowFork = 0; /* Allow the commit to fork */
1048
+ int allowOlder = 0; /* Allow a commit older than its ancestor */
10341049
char *zManifestFile; /* Name of the manifest file */
10351050
int useCksum; /* True if checksums should be computed and verified */
10361051
int outputManifest; /* True to output "manifest" and "manifest.uuid" */
10371052
int testRun; /* True for a test run. Debugging only */
10381053
const char *zBranch; /* Create a new branch with this name */
@@ -1062,15 +1077,18 @@
10621077
fossil_fatal("cannot use --delta and --baseline together");
10631078
}
10641079
testRun = find_option("test",0,0)!=0;
10651080
zComment = find_option("comment","m",1);
10661081
forceFlag = find_option("force", "f", 0)!=0;
1082
+ allowConflict = find_option("allow-conflict",0,0)!=0;
1083
+ allowEmpty = find_option("allow-empty",0,0)!=0;
1084
+ allowFork = find_option("allow-fork",0,0)!=0;
1085
+ allowOlder = find_option("allow-older",0,0)!=0;
10671086
noWarningFlag = find_option("no-warnings", 0, 0)!=0;
10681087
zBranch = find_option("branch","b",1);
10691088
zColor = find_option("bgcolor",0,1);
10701089
zBrClr = find_option("branchcolor",0,1);
1071
- binaryOk = find_option("binary-ok",0,0)!=0;
10721090
while( (zTag = find_option("tag",0,1))!=0 ){
10731091
if( zTag[0]==0 ) continue;
10741092
azTag = fossil_realloc((void *)azTag, sizeof(char*)*(nTag+2));
10751093
azTag[nTag++] = zTag;
10761094
azTag[nTag] = 0;
@@ -1081,11 +1099,10 @@
10811099
if( zBranch==0 ) zBranch = "private";
10821100
if( zBrClr==0 && zColor==0 ) zBrClr = "#fec084"; /* Orange */
10831101
}
10841102
zDateOvrd = find_option("date-override",0,1);
10851103
zUserOvrd = find_option("user-override",0,1);
1086
- allowConflict = find_option("conflict",0,0)!=0;
10871104
db_must_be_within_tree();
10881105
noSign = db_get_boolean("omitsign", 0)|noSign;
10891106
if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
10901107
useCksum = db_get_boolean("repo-cksum", 1);
10911108
outputManifest = db_get_boolean("manifest", 0);
@@ -1188,34 +1205,38 @@
11881205
}
11891206
11901207
hasChanges = unsaved_changes();
11911208
db_begin_transaction();
11921209
db_record_repository_filename(0);
1193
- if( hasChanges==0 && !isAMerge && !forceFlag ){
1194
- fossil_fatal("nothing has changed");
1210
+ if( hasChanges==0 && !isAMerge && !allowEmpty && !forceFlag ){
1211
+ fossil_fatal("nothing has changed; use --allow-empty to override");
11951212
}
11961213
11971214
/* If none of the files that were named on the command line have
1198
- ** been modified, bail out now unless the --force flag is used.
1215
+ ** been modified, bail out now unless the --allow-empty or --force
1216
+ ** flags is used.
11991217
*/
12001218
if( g.aCommitFile
1219
+ && !allowEmpty
12011220
&& !forceFlag
12021221
&& !db_exists(
12031222
"SELECT 1 FROM vfile "
12041223
" WHERE is_selected(id)"
12051224
" AND (chnged OR deleted OR rid=0 OR pathname!=origname)")
12061225
){
1207
- fossil_fatal("none of the selected files have changed; use -f"
1208
- " or --force.");
1226
+ fossil_fatal("none of the selected files have changed; use "
1227
+ "--allow-empty to override.");
12091228
}
12101229
12111230
/*
1212
- ** Do not allow a commit that will cause a fork unless the --force flag
1213
- ** is used or unless this is a private check-in.
1231
+ ** Do not allow a commit that will cause a fork unless the --allow-fork
1232
+ ** or --force flags is used, or unless this is a private check-in.
12141233
*/
1215
- if( zBranch==0 && forceFlag==0 && g.markPrivate==0 && !is_a_leaf(vid) ){
1216
- fossil_fatal("would fork. \"update\" first or use -f or --force.");
1234
+ if( zBranch==0 && allowFork==0 && forceFlag==0
1235
+ && g.markPrivate==0 && !is_a_leaf(vid)
1236
+ ){
1237
+ fossil_fatal("would fork. \"update\" first or use --allow-fork.");
12171238
}
12181239
12191240
/*
12201241
** Do not allow a commit against a closed leaf
12211242
*/
@@ -1278,11 +1299,11 @@
12781299
id = db_column_int(&q, 0);
12791300
zFullname = db_column_text(&q, 1);
12801301
rid = db_column_int(&q, 2);
12811302
crnlOk = db_column_int(&q, 3);
12821303
chnged = db_column_int(&q, 4);
1283
- binOk = binaryOk || db_column_int(&q, 5);
1304
+ binOk = db_column_int(&q, 5);
12841305
unicodeOk = db_column_int(&q, 6);
12851306
12861307
blob_zero(&content);
12871308
if( file_wd_islink(zFullname) ){
12881309
/* Instead of file content, put link destination path */
@@ -1311,11 +1332,12 @@
13111332
db_multi_exec("UPDATE vfile SET mrid=%d, rid=%d WHERE id=%d", nrid,nrid,id);
13121333
db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nrid);
13131334
}
13141335
db_finalize(&q);
13151336
if( nConflict && !allowConflict ){
1316
- fossil_fatal("abort due to unresolve merge conflicts");
1337
+ fossil_fatal("abort due to unresolved merge conflicts; "
1338
+ "use --allow-conflict to override");
13171339
}
13181340
13191341
/* Create the new manifest */
13201342
if( blob_size(&comment)==0 ){
13211343
blob_append(&comment, "(no comment)", -1);
@@ -1322,11 +1344,11 @@
13221344
}
13231345
if( forceDelta ){
13241346
blob_zero(&manifest);
13251347
}else{
13261348
create_manifest(&manifest, 0, 0, &comment, vid,
1327
- !forceFlag, useCksum ? &cksum1 : 0,
1349
+ !allowOlder && !forceFlag, useCksum ? &cksum1 : 0,
13281350
zDateOvrd, zUserOvrd, zBranch, zColor, zBrClr,
13291351
azTag, &szB);
13301352
}
13311353
13321354
/* See if a delta-manifest would be more appropriate */
@@ -1343,11 +1365,11 @@
13431365
pBaseline = pParent;
13441366
}
13451367
if( pBaseline ){
13461368
Blob delta;
13471369
create_manifest(&delta, zBaselineUuid, pBaseline, &comment, vid,
1348
- !forceFlag, useCksum ? &cksum1 : 0,
1370
+ !allowOlder && !forceFlag, useCksum ? &cksum1 : 0,
13491371
zDateOvrd, zUserOvrd, zBranch, zColor, zBrClr,
13501372
azTag, &szD);
13511373
/*
13521374
** At this point, two manifests have been constructed, either of
13531375
** which would work for this checkin. The first manifest (held
13541376
--- src/checkin.c
+++ src/checkin.c
@@ -656,11 +656,11 @@
656 " AND type='ci' AND objid=%d",
657 zDate, rid
658 );
659 if( b ){
660 fossil_fatal("ancestor check-in [%.10s] (%s) is not older (clock skew?)"
661 " Use -f to override.", zUuid, zDate);
662 }
663 #endif
664 }
665
666 /*
@@ -987,32 +987,45 @@
987 **
988 ** The --bgcolor option works like --branchcolor but only sets the
989 ** background color for a single check-in. Subsequent check-ins revert
990 ** to the default color.
991 **
992 ** A check-in is not permitted to fork unless the --force or -f
993 ** option appears. A check-in is not allowed against a closed leaf.
 
 
 
 
 
 
 
 
 
 
 
994 **
995 ** The --private option creates a private check-in that is never synced.
996 ** Children of private check-ins are automatically private.
997 **
998 ** the --tag option applies the symbolic tag name to the check-in.
999 **
1000 ** Options:
 
 
 
 
1001 ** --baseline use a baseline manifest in the commit process
1002 ** --bgcolor COLOR apply COLOR to this one check-in only
1003 ** --branch NEW-BRANCH-NAME check in to this new branch
1004 ** --branchcolor COLOR apply given COLOR to the branch
1005 ** --comment|-m COMMENT-TEXT use COMMENT-TEXT as commit comment
1006 ** --delta use a delta manifest in the commit process
1007 ** --force|-f allow forking with this commit
1008 ** --message-file|-M FILE read the commit comment from given file
 
1009 ** --nosign do not attempt to sign this commit with gpg
1010 ** --private do not sync changes and their descendants
1011 ** --tag TAG-NAME assign given tag TAG-NAME to the checkin
1012 ** --conflict allow unresolved merge conflicts
1013 ** --binary-ok do not warn about committing binary files
1014 **
1015 ** See also: branch, changes, checkout, extra, sync
1016 */
1017 void commit_cmd(void){
1018 int hasChanges; /* True if unsaved changes exist */
@@ -1024,15 +1037,17 @@
1024 Stmt q; /* Query to find files that have been modified */
1025 char *zUuid; /* UUID of the new check-in */
1026 int noSign = 0; /* True to omit signing the manifest using GPG */
1027 int isAMerge = 0; /* True if checking in a merge */
1028 int noWarningFlag = 0; /* True if skipping all warnings */
1029 int forceFlag = 0; /* Force a fork */
1030 int forceDelta = 0; /* Force a delta-manifest */
1031 int forceBaseline = 0; /* Force a baseline-manifest */
1032 int allowConflict = 0; /* Allow unresolve merge conflicts */
1033 int binaryOk = 0; /* The --binary-ok flag */
 
 
1034 char *zManifestFile; /* Name of the manifest file */
1035 int useCksum; /* True if checksums should be computed and verified */
1036 int outputManifest; /* True to output "manifest" and "manifest.uuid" */
1037 int testRun; /* True for a test run. Debugging only */
1038 const char *zBranch; /* Create a new branch with this name */
@@ -1062,15 +1077,18 @@
1062 fossil_fatal("cannot use --delta and --baseline together");
1063 }
1064 testRun = find_option("test",0,0)!=0;
1065 zComment = find_option("comment","m",1);
1066 forceFlag = find_option("force", "f", 0)!=0;
 
 
 
 
1067 noWarningFlag = find_option("no-warnings", 0, 0)!=0;
1068 zBranch = find_option("branch","b",1);
1069 zColor = find_option("bgcolor",0,1);
1070 zBrClr = find_option("branchcolor",0,1);
1071 binaryOk = find_option("binary-ok",0,0)!=0;
1072 while( (zTag = find_option("tag",0,1))!=0 ){
1073 if( zTag[0]==0 ) continue;
1074 azTag = fossil_realloc((void *)azTag, sizeof(char*)*(nTag+2));
1075 azTag[nTag++] = zTag;
1076 azTag[nTag] = 0;
@@ -1081,11 +1099,10 @@
1081 if( zBranch==0 ) zBranch = "private";
1082 if( zBrClr==0 && zColor==0 ) zBrClr = "#fec084"; /* Orange */
1083 }
1084 zDateOvrd = find_option("date-override",0,1);
1085 zUserOvrd = find_option("user-override",0,1);
1086 allowConflict = find_option("conflict",0,0)!=0;
1087 db_must_be_within_tree();
1088 noSign = db_get_boolean("omitsign", 0)|noSign;
1089 if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
1090 useCksum = db_get_boolean("repo-cksum", 1);
1091 outputManifest = db_get_boolean("manifest", 0);
@@ -1188,34 +1205,38 @@
1188 }
1189
1190 hasChanges = unsaved_changes();
1191 db_begin_transaction();
1192 db_record_repository_filename(0);
1193 if( hasChanges==0 && !isAMerge && !forceFlag ){
1194 fossil_fatal("nothing has changed");
1195 }
1196
1197 /* If none of the files that were named on the command line have
1198 ** been modified, bail out now unless the --force flag is used.
 
1199 */
1200 if( g.aCommitFile
 
1201 && !forceFlag
1202 && !db_exists(
1203 "SELECT 1 FROM vfile "
1204 " WHERE is_selected(id)"
1205 " AND (chnged OR deleted OR rid=0 OR pathname!=origname)")
1206 ){
1207 fossil_fatal("none of the selected files have changed; use -f"
1208 " or --force.");
1209 }
1210
1211 /*
1212 ** Do not allow a commit that will cause a fork unless the --force flag
1213 ** is used or unless this is a private check-in.
1214 */
1215 if( zBranch==0 && forceFlag==0 && g.markPrivate==0 && !is_a_leaf(vid) ){
1216 fossil_fatal("would fork. \"update\" first or use -f or --force.");
 
 
1217 }
1218
1219 /*
1220 ** Do not allow a commit against a closed leaf
1221 */
@@ -1278,11 +1299,11 @@
1278 id = db_column_int(&q, 0);
1279 zFullname = db_column_text(&q, 1);
1280 rid = db_column_int(&q, 2);
1281 crnlOk = db_column_int(&q, 3);
1282 chnged = db_column_int(&q, 4);
1283 binOk = binaryOk || db_column_int(&q, 5);
1284 unicodeOk = db_column_int(&q, 6);
1285
1286 blob_zero(&content);
1287 if( file_wd_islink(zFullname) ){
1288 /* Instead of file content, put link destination path */
@@ -1311,11 +1332,12 @@
1311 db_multi_exec("UPDATE vfile SET mrid=%d, rid=%d WHERE id=%d", nrid,nrid,id);
1312 db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nrid);
1313 }
1314 db_finalize(&q);
1315 if( nConflict && !allowConflict ){
1316 fossil_fatal("abort due to unresolve merge conflicts");
 
1317 }
1318
1319 /* Create the new manifest */
1320 if( blob_size(&comment)==0 ){
1321 blob_append(&comment, "(no comment)", -1);
@@ -1322,11 +1344,11 @@
1322 }
1323 if( forceDelta ){
1324 blob_zero(&manifest);
1325 }else{
1326 create_manifest(&manifest, 0, 0, &comment, vid,
1327 !forceFlag, useCksum ? &cksum1 : 0,
1328 zDateOvrd, zUserOvrd, zBranch, zColor, zBrClr,
1329 azTag, &szB);
1330 }
1331
1332 /* See if a delta-manifest would be more appropriate */
@@ -1343,11 +1365,11 @@
1343 pBaseline = pParent;
1344 }
1345 if( pBaseline ){
1346 Blob delta;
1347 create_manifest(&delta, zBaselineUuid, pBaseline, &comment, vid,
1348 !forceFlag, useCksum ? &cksum1 : 0,
1349 zDateOvrd, zUserOvrd, zBranch, zColor, zBrClr,
1350 azTag, &szD);
1351 /*
1352 ** At this point, two manifests have been constructed, either of
1353 ** which would work for this checkin. The first manifest (held
1354
--- src/checkin.c
+++ src/checkin.c
@@ -656,11 +656,11 @@
656 " AND type='ci' AND objid=%d",
657 zDate, rid
658 );
659 if( b ){
660 fossil_fatal("ancestor check-in [%.10s] (%s) is not older (clock skew?)"
661 " Use --allow-older to override.", zUuid, zDate);
662 }
663 #endif
664 }
665
666 /*
@@ -987,32 +987,45 @@
987 **
988 ** The --bgcolor option works like --branchcolor but only sets the
989 ** background color for a single check-in. Subsequent check-ins revert
990 ** to the default color.
991 **
992 ** A check-in is not permitted to fork unless the --allow-fork option
993 ** appears. An empty check-in (i.e. with nothing changed) is not
994 ** allowed unless the --allow-empty option appears. A check-in may not
995 ** be older than its ancestor unless the --allow-older option appears.
996 ** If any of files in the check-in appear to contain unresolved merge
997 ** conflicts, the check-in will not be allowed unless the
998 ** --allow-conflict option is present. In addition, the entire
999 ** check-in process may be aborted if a file contains content that
1000 ** appears to be binary, Unicode text, or text with CR/NL line endings
1001 ** unless the interactive user chooses to proceed. If there is no
1002 ** interactive user or these warnings should be skipped for some other
1003 ** reason, the --no-warnings option may be used. A check-in is not
1004 ** allowed against a closed leaf.
1005 **
1006 ** The --private option creates a private check-in that is never synced.
1007 ** Children of private check-ins are automatically private.
1008 **
1009 ** the --tag option applies the symbolic tag name to the check-in.
1010 **
1011 ** Options:
1012 ** --allow-conflict allow unresolved merge conflicts
1013 ** --allow-empty allow a commit with no changes
1014 ** --allow-fork allow the commit to fork
1015 ** --allow-older allow a commit older than its ancestor
1016 ** --baseline use a baseline manifest in the commit process
1017 ** --bgcolor COLOR apply COLOR to this one check-in only
1018 ** --branch NEW-BRANCH-NAME check in to this new branch
1019 ** --branchcolor COLOR apply given COLOR to the branch
1020 ** --comment|-m COMMENT-TEXT use COMMENT-TEXT as commit comment
1021 ** --delta use a delta manifest in the commit process
 
1022 ** --message-file|-M FILE read the commit comment from given file
1023 ** --no-warnings omit all warnings about file contents
1024 ** --nosign do not attempt to sign this commit with gpg
1025 ** --private do not sync changes and their descendants
1026 ** --tag TAG-NAME assign given tag TAG-NAME to the checkin
 
 
1027 **
1028 ** See also: branch, changes, checkout, extra, sync
1029 */
1030 void commit_cmd(void){
1031 int hasChanges; /* True if unsaved changes exist */
@@ -1024,15 +1037,17 @@
1037 Stmt q; /* Query to find files that have been modified */
1038 char *zUuid; /* UUID of the new check-in */
1039 int noSign = 0; /* True to omit signing the manifest using GPG */
1040 int isAMerge = 0; /* True if checking in a merge */
1041 int noWarningFlag = 0; /* True if skipping all warnings */
1042 int forceFlag = 0; /* Undocumented: Disables all checks */
1043 int forceDelta = 0; /* Force a delta-manifest */
1044 int forceBaseline = 0; /* Force a baseline-manifest */
1045 int allowConflict = 0; /* Allow unresolve merge conflicts */
1046 int allowEmpty = 0; /* Allow a commit with no changes */
1047 int allowFork = 0; /* Allow the commit to fork */
1048 int allowOlder = 0; /* Allow a commit older than its ancestor */
1049 char *zManifestFile; /* Name of the manifest file */
1050 int useCksum; /* True if checksums should be computed and verified */
1051 int outputManifest; /* True to output "manifest" and "manifest.uuid" */
1052 int testRun; /* True for a test run. Debugging only */
1053 const char *zBranch; /* Create a new branch with this name */
@@ -1062,15 +1077,18 @@
1077 fossil_fatal("cannot use --delta and --baseline together");
1078 }
1079 testRun = find_option("test",0,0)!=0;
1080 zComment = find_option("comment","m",1);
1081 forceFlag = find_option("force", "f", 0)!=0;
1082 allowConflict = find_option("allow-conflict",0,0)!=0;
1083 allowEmpty = find_option("allow-empty",0,0)!=0;
1084 allowFork = find_option("allow-fork",0,0)!=0;
1085 allowOlder = find_option("allow-older",0,0)!=0;
1086 noWarningFlag = find_option("no-warnings", 0, 0)!=0;
1087 zBranch = find_option("branch","b",1);
1088 zColor = find_option("bgcolor",0,1);
1089 zBrClr = find_option("branchcolor",0,1);
 
1090 while( (zTag = find_option("tag",0,1))!=0 ){
1091 if( zTag[0]==0 ) continue;
1092 azTag = fossil_realloc((void *)azTag, sizeof(char*)*(nTag+2));
1093 azTag[nTag++] = zTag;
1094 azTag[nTag] = 0;
@@ -1081,11 +1099,10 @@
1099 if( zBranch==0 ) zBranch = "private";
1100 if( zBrClr==0 && zColor==0 ) zBrClr = "#fec084"; /* Orange */
1101 }
1102 zDateOvrd = find_option("date-override",0,1);
1103 zUserOvrd = find_option("user-override",0,1);
 
1104 db_must_be_within_tree();
1105 noSign = db_get_boolean("omitsign", 0)|noSign;
1106 if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
1107 useCksum = db_get_boolean("repo-cksum", 1);
1108 outputManifest = db_get_boolean("manifest", 0);
@@ -1188,34 +1205,38 @@
1205 }
1206
1207 hasChanges = unsaved_changes();
1208 db_begin_transaction();
1209 db_record_repository_filename(0);
1210 if( hasChanges==0 && !isAMerge && !allowEmpty && !forceFlag ){
1211 fossil_fatal("nothing has changed; use --allow-empty to override");
1212 }
1213
1214 /* If none of the files that were named on the command line have
1215 ** been modified, bail out now unless the --allow-empty or --force
1216 ** flags is used.
1217 */
1218 if( g.aCommitFile
1219 && !allowEmpty
1220 && !forceFlag
1221 && !db_exists(
1222 "SELECT 1 FROM vfile "
1223 " WHERE is_selected(id)"
1224 " AND (chnged OR deleted OR rid=0 OR pathname!=origname)")
1225 ){
1226 fossil_fatal("none of the selected files have changed; use "
1227 "--allow-empty to override.");
1228 }
1229
1230 /*
1231 ** Do not allow a commit that will cause a fork unless the --allow-fork
1232 ** or --force flags is used, or unless this is a private check-in.
1233 */
1234 if( zBranch==0 && allowFork==0 && forceFlag==0
1235 && g.markPrivate==0 && !is_a_leaf(vid)
1236 ){
1237 fossil_fatal("would fork. \"update\" first or use --allow-fork.");
1238 }
1239
1240 /*
1241 ** Do not allow a commit against a closed leaf
1242 */
@@ -1278,11 +1299,11 @@
1299 id = db_column_int(&q, 0);
1300 zFullname = db_column_text(&q, 1);
1301 rid = db_column_int(&q, 2);
1302 crnlOk = db_column_int(&q, 3);
1303 chnged = db_column_int(&q, 4);
1304 binOk = db_column_int(&q, 5);
1305 unicodeOk = db_column_int(&q, 6);
1306
1307 blob_zero(&content);
1308 if( file_wd_islink(zFullname) ){
1309 /* Instead of file content, put link destination path */
@@ -1311,11 +1332,12 @@
1332 db_multi_exec("UPDATE vfile SET mrid=%d, rid=%d WHERE id=%d", nrid,nrid,id);
1333 db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nrid);
1334 }
1335 db_finalize(&q);
1336 if( nConflict && !allowConflict ){
1337 fossil_fatal("abort due to unresolved merge conflicts; "
1338 "use --allow-conflict to override");
1339 }
1340
1341 /* Create the new manifest */
1342 if( blob_size(&comment)==0 ){
1343 blob_append(&comment, "(no comment)", -1);
@@ -1322,11 +1344,11 @@
1344 }
1345 if( forceDelta ){
1346 blob_zero(&manifest);
1347 }else{
1348 create_manifest(&manifest, 0, 0, &comment, vid,
1349 !allowOlder && !forceFlag, useCksum ? &cksum1 : 0,
1350 zDateOvrd, zUserOvrd, zBranch, zColor, zBrClr,
1351 azTag, &szB);
1352 }
1353
1354 /* See if a delta-manifest would be more appropriate */
@@ -1343,11 +1365,11 @@
1365 pBaseline = pParent;
1366 }
1367 if( pBaseline ){
1368 Blob delta;
1369 create_manifest(&delta, zBaselineUuid, pBaseline, &comment, vid,
1370 !allowOlder && !forceFlag, useCksum ? &cksum1 : 0,
1371 zDateOvrd, zUserOvrd, zBranch, zColor, zBrClr,
1372 azTag, &szD);
1373 /*
1374 ** At this point, two manifests have been constructed, either of
1375 ** which would work for this checkin. The first manifest (held
1376

Keyboard Shortcuts

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