| | @@ -890,10 +890,11 @@ |
| 890 | 890 | */ |
| 891 | 891 | static void commit_warning( |
| 892 | 892 | const Blob *p, /* The content of the file being committed. */ |
| 893 | 893 | int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */ |
| 894 | 894 | int binOk, /* Non-zero if binary warnings should be disabled. */ |
| 895 | + int unicodeOk, /* Non-zero if unicode warnings should be disabled. */ |
| 895 | 896 | const char *zFilename /* The full name of the file being committed. */ |
| 896 | 897 | ){ |
| 897 | 898 | int eType; /* return value of looks_like_utf8/utf16() */ |
| 898 | 899 | int fUnicode; /* return value of starts_with_utf16_bom() */ |
| 899 | 900 | char *zMsg; /* Warning message */ |
| | @@ -907,10 +908,13 @@ |
| 907 | 908 | const char *zWarning; |
| 908 | 909 | Blob ans; |
| 909 | 910 | char cReply; |
| 910 | 911 | |
| 911 | 912 | if( eType==-1 && fUnicode ){ |
| 913 | + if ( crnlOk && unicodeOk ){ |
| 914 | + return; /* We don't want Unicode/CR/NL warnings for this file. */ |
| 915 | + } |
| 912 | 916 | zWarning = "Unicode and CR/NL line endings"; |
| 913 | 917 | }else if( eType==-1 ){ |
| 914 | 918 | if( crnlOk ){ |
| 915 | 919 | return; /* We don't want CR/NL warnings for this file. */ |
| 916 | 920 | } |
| | @@ -919,10 +923,13 @@ |
| 919 | 923 | if( binOk ){ |
| 920 | 924 | return; /* We don't want binary warnings for this file. */ |
| 921 | 925 | } |
| 922 | 926 | zWarning = "binary data"; |
| 923 | 927 | }else{ |
| 928 | + if ( unicodeOk ){ |
| 929 | + return; /* We don't want unicode warnings for this file. */ |
| 930 | + } |
| 924 | 931 | zWarning = "Unicode"; |
| 925 | 932 | } |
| 926 | 933 | file_relative_name(zFilename, &fname, 0); |
| 927 | 934 | blob_zero(&ans); |
| 928 | 935 | zMsg = mprintf( |
| | @@ -1016,10 +1023,11 @@ |
| 1016 | 1023 | const char *zComment; /* Check-in comment */ |
| 1017 | 1024 | Stmt q; /* Query to find files that have been modified */ |
| 1018 | 1025 | char *zUuid; /* UUID of the new check-in */ |
| 1019 | 1026 | int noSign = 0; /* True to omit signing the manifest using GPG */ |
| 1020 | 1027 | int isAMerge = 0; /* True if checking in a merge */ |
| 1028 | + int noWarningFlag = 0; /* True if skipping all warnings */ |
| 1021 | 1029 | int forceFlag = 0; /* Force a fork */ |
| 1022 | 1030 | int forceDelta = 0; /* Force a delta-manifest */ |
| 1023 | 1031 | int forceBaseline = 0; /* Force a baseline-manifest */ |
| 1024 | 1032 | int allowConflict = 0; /* Allow unresolve merge conflicts */ |
| 1025 | 1033 | int binaryOk = 0; /* The --binary-ok flag */ |
| | @@ -1054,10 +1062,11 @@ |
| 1054 | 1062 | fossil_fatal("cannot use --delta and --baseline together"); |
| 1055 | 1063 | } |
| 1056 | 1064 | testRun = find_option("test",0,0)!=0; |
| 1057 | 1065 | zComment = find_option("comment","m",1); |
| 1058 | 1066 | forceFlag = find_option("force", "f", 0)!=0; |
| 1067 | + noWarningFlag = find_option("no-warnings", 0, 0)!=0; |
| 1059 | 1068 | zBranch = find_option("branch","b",1); |
| 1060 | 1069 | zColor = find_option("bgcolor",0,1); |
| 1061 | 1070 | zBrClr = find_option("branchcolor",0,1); |
| 1062 | 1071 | binaryOk = find_option("binary-ok",0,0)!=0; |
| 1063 | 1072 | while( (zTag = find_option("tag",0,1))!=0 ){ |
| | @@ -1251,36 +1260,42 @@ |
| 1251 | 1260 | /* Step 1: Insert records for all modified files into the blob |
| 1252 | 1261 | ** table. If there were arguments passed to this command, only |
| 1253 | 1262 | ** the identified files are inserted (if they have been modified). |
| 1254 | 1263 | */ |
| 1255 | 1264 | db_prepare(&q, |
| 1256 | | - "SELECT id, %Q || pathname, mrid, %s, chnged, %s FROM vfile " |
| 1265 | + "SELECT id, %Q || pathname, mrid, %s, chnged, %s, %s FROM vfile " |
| 1257 | 1266 | "WHERE chnged==1 AND NOT deleted AND is_selected(id)", |
| 1258 | | - g.zLocalRoot, glob_expr("pathname", db_get("crnl-glob","")), |
| 1259 | | - glob_expr("pathname", db_get("binary-glob","")) |
| 1267 | + g.zLocalRoot, |
| 1268 | + glob_expr("pathname", db_get("crnl-glob","")), |
| 1269 | + glob_expr("pathname", db_get("binary-glob","")), |
| 1270 | + glob_expr("pathname", db_get("unicode-glob","")) |
| 1260 | 1271 | ); |
| 1261 | 1272 | while( db_step(&q)==SQLITE_ROW ){ |
| 1262 | 1273 | int id, rid; |
| 1263 | 1274 | const char *zFullname; |
| 1264 | 1275 | Blob content; |
| 1265 | | - int crnlOk, binOk, chnged; |
| 1276 | + int crnlOk, binOk, unicodeOk, chnged; |
| 1266 | 1277 | |
| 1267 | 1278 | id = db_column_int(&q, 0); |
| 1268 | 1279 | zFullname = db_column_text(&q, 1); |
| 1269 | 1280 | rid = db_column_int(&q, 2); |
| 1270 | 1281 | crnlOk = db_column_int(&q, 3); |
| 1271 | 1282 | chnged = db_column_int(&q, 4); |
| 1272 | 1283 | binOk = binaryOk || db_column_int(&q, 5); |
| 1284 | + unicodeOk = db_column_int(&q, 6); |
| 1273 | 1285 | |
| 1274 | 1286 | blob_zero(&content); |
| 1275 | 1287 | if( file_wd_islink(zFullname) ){ |
| 1276 | 1288 | /* Instead of file content, put link destination path */ |
| 1277 | 1289 | blob_read_link(&content, zFullname); |
| 1278 | 1290 | }else{ |
| 1279 | 1291 | blob_read_from_file(&content, zFullname); |
| 1280 | 1292 | } |
| 1281 | | - commit_warning(&content, crnlOk, binOk, zFullname); |
| 1293 | + /* Do not emit any warnings when they are disabled. */ |
| 1294 | + if( !noWarningFlag ){ |
| 1295 | + commit_warning(&content, crnlOk, binOk, unicodeOk, zFullname); |
| 1296 | + } |
| 1282 | 1297 | if( chnged==1 && contains_merge_marker(&content) ){ |
| 1283 | 1298 | Blob fname; /* Relative pathname of the file */ |
| 1284 | 1299 | |
| 1285 | 1300 | nConflict++; |
| 1286 | 1301 | file_relative_name(zFullname, &fname, 0); |
| 1287 | 1302 | |