Fossil SCM

merge trunk

jan.nijtmans 2012-11-26 20:03 ticket-d17d6e5b17 merge
Commit 1772f8b895ec340c1b69608ad32314adc54cee55
+20 -5
--- src/checkin.c
+++ src/checkin.c
@@ -890,10 +890,11 @@
890890
*/
891891
static void commit_warning(
892892
const Blob *p, /* The content of the file being committed. */
893893
int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */
894894
int binOk, /* Non-zero if binary warnings should be disabled. */
895
+ int unicodeOk, /* Non-zero if unicode warnings should be disabled. */
895896
const char *zFilename /* The full name of the file being committed. */
896897
){
897898
int eType; /* return value of looks_like_utf8/utf16() */
898899
int fUnicode; /* return value of starts_with_utf16_bom() */
899900
char *zMsg; /* Warning message */
@@ -907,10 +908,13 @@
907908
const char *zWarning;
908909
Blob ans;
909910
char cReply;
910911
911912
if( eType==-1 && fUnicode ){
913
+ if ( crnlOk && unicodeOk ){
914
+ return; /* We don't want Unicode/CR/NL warnings for this file. */
915
+ }
912916
zWarning = "Unicode and CR/NL line endings";
913917
}else if( eType==-1 ){
914918
if( crnlOk ){
915919
return; /* We don't want CR/NL warnings for this file. */
916920
}
@@ -919,10 +923,13 @@
919923
if( binOk ){
920924
return; /* We don't want binary warnings for this file. */
921925
}
922926
zWarning = "binary data";
923927
}else{
928
+ if ( unicodeOk ){
929
+ return; /* We don't want unicode warnings for this file. */
930
+ }
924931
zWarning = "Unicode";
925932
}
926933
file_relative_name(zFilename, &fname, 0);
927934
blob_zero(&ans);
928935
zMsg = mprintf(
@@ -1016,10 +1023,11 @@
10161023
const char *zComment; /* Check-in comment */
10171024
Stmt q; /* Query to find files that have been modified */
10181025
char *zUuid; /* UUID of the new check-in */
10191026
int noSign = 0; /* True to omit signing the manifest using GPG */
10201027
int isAMerge = 0; /* True if checking in a merge */
1028
+ int noWarningFlag = 0; /* True if skipping all warnings */
10211029
int forceFlag = 0; /* Force a fork */
10221030
int forceDelta = 0; /* Force a delta-manifest */
10231031
int forceBaseline = 0; /* Force a baseline-manifest */
10241032
int allowConflict = 0; /* Allow unresolve merge conflicts */
10251033
int binaryOk = 0; /* The --binary-ok flag */
@@ -1054,10 +1062,11 @@
10541062
fossil_fatal("cannot use --delta and --baseline together");
10551063
}
10561064
testRun = find_option("test",0,0)!=0;
10571065
zComment = find_option("comment","m",1);
10581066
forceFlag = find_option("force", "f", 0)!=0;
1067
+ noWarningFlag = find_option("no-warnings", 0, 0)!=0;
10591068
zBranch = find_option("branch","b",1);
10601069
zColor = find_option("bgcolor",0,1);
10611070
zBrClr = find_option("branchcolor",0,1);
10621071
binaryOk = find_option("binary-ok",0,0)!=0;
10631072
while( (zTag = find_option("tag",0,1))!=0 ){
@@ -1251,36 +1260,42 @@
12511260
/* Step 1: Insert records for all modified files into the blob
12521261
** table. If there were arguments passed to this command, only
12531262
** the identified files are inserted (if they have been modified).
12541263
*/
12551264
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 "
12571266
"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",""))
12601271
);
12611272
while( db_step(&q)==SQLITE_ROW ){
12621273
int id, rid;
12631274
const char *zFullname;
12641275
Blob content;
1265
- int crnlOk, binOk, chnged;
1276
+ int crnlOk, binOk, unicodeOk, chnged;
12661277
12671278
id = db_column_int(&q, 0);
12681279
zFullname = db_column_text(&q, 1);
12691280
rid = db_column_int(&q, 2);
12701281
crnlOk = db_column_int(&q, 3);
12711282
chnged = db_column_int(&q, 4);
12721283
binOk = binaryOk || db_column_int(&q, 5);
1284
+ unicodeOk = db_column_int(&q, 6);
12731285
12741286
blob_zero(&content);
12751287
if( file_wd_islink(zFullname) ){
12761288
/* Instead of file content, put link destination path */
12771289
blob_read_link(&content, zFullname);
12781290
}else{
12791291
blob_read_from_file(&content, zFullname);
12801292
}
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
+ }
12821297
if( chnged==1 && contains_merge_marker(&content) ){
12831298
Blob fname; /* Relative pathname of the file */
12841299
12851300
nConflict++;
12861301
file_relative_name(zFullname, &fname, 0);
12871302
--- src/checkin.c
+++ src/checkin.c
@@ -890,10 +890,11 @@
890 */
891 static void commit_warning(
892 const Blob *p, /* The content of the file being committed. */
893 int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */
894 int binOk, /* Non-zero if binary warnings should be disabled. */
 
895 const char *zFilename /* The full name of the file being committed. */
896 ){
897 int eType; /* return value of looks_like_utf8/utf16() */
898 int fUnicode; /* return value of starts_with_utf16_bom() */
899 char *zMsg; /* Warning message */
@@ -907,10 +908,13 @@
907 const char *zWarning;
908 Blob ans;
909 char cReply;
910
911 if( eType==-1 && fUnicode ){
 
 
 
912 zWarning = "Unicode and CR/NL line endings";
913 }else if( eType==-1 ){
914 if( crnlOk ){
915 return; /* We don't want CR/NL warnings for this file. */
916 }
@@ -919,10 +923,13 @@
919 if( binOk ){
920 return; /* We don't want binary warnings for this file. */
921 }
922 zWarning = "binary data";
923 }else{
 
 
 
924 zWarning = "Unicode";
925 }
926 file_relative_name(zFilename, &fname, 0);
927 blob_zero(&ans);
928 zMsg = mprintf(
@@ -1016,10 +1023,11 @@
1016 const char *zComment; /* Check-in comment */
1017 Stmt q; /* Query to find files that have been modified */
1018 char *zUuid; /* UUID of the new check-in */
1019 int noSign = 0; /* True to omit signing the manifest using GPG */
1020 int isAMerge = 0; /* True if checking in a merge */
 
1021 int forceFlag = 0; /* Force a fork */
1022 int forceDelta = 0; /* Force a delta-manifest */
1023 int forceBaseline = 0; /* Force a baseline-manifest */
1024 int allowConflict = 0; /* Allow unresolve merge conflicts */
1025 int binaryOk = 0; /* The --binary-ok flag */
@@ -1054,10 +1062,11 @@
1054 fossil_fatal("cannot use --delta and --baseline together");
1055 }
1056 testRun = find_option("test",0,0)!=0;
1057 zComment = find_option("comment","m",1);
1058 forceFlag = find_option("force", "f", 0)!=0;
 
1059 zBranch = find_option("branch","b",1);
1060 zColor = find_option("bgcolor",0,1);
1061 zBrClr = find_option("branchcolor",0,1);
1062 binaryOk = find_option("binary-ok",0,0)!=0;
1063 while( (zTag = find_option("tag",0,1))!=0 ){
@@ -1251,36 +1260,42 @@
1251 /* Step 1: Insert records for all modified files into the blob
1252 ** table. If there were arguments passed to this command, only
1253 ** the identified files are inserted (if they have been modified).
1254 */
1255 db_prepare(&q,
1256 "SELECT id, %Q || pathname, mrid, %s, chnged, %s FROM vfile "
1257 "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",""))
 
 
1260 );
1261 while( db_step(&q)==SQLITE_ROW ){
1262 int id, rid;
1263 const char *zFullname;
1264 Blob content;
1265 int crnlOk, binOk, chnged;
1266
1267 id = db_column_int(&q, 0);
1268 zFullname = db_column_text(&q, 1);
1269 rid = db_column_int(&q, 2);
1270 crnlOk = db_column_int(&q, 3);
1271 chnged = db_column_int(&q, 4);
1272 binOk = binaryOk || db_column_int(&q, 5);
 
1273
1274 blob_zero(&content);
1275 if( file_wd_islink(zFullname) ){
1276 /* Instead of file content, put link destination path */
1277 blob_read_link(&content, zFullname);
1278 }else{
1279 blob_read_from_file(&content, zFullname);
1280 }
1281 commit_warning(&content, crnlOk, binOk, zFullname);
 
 
 
1282 if( chnged==1 && contains_merge_marker(&content) ){
1283 Blob fname; /* Relative pathname of the file */
1284
1285 nConflict++;
1286 file_relative_name(zFullname, &fname, 0);
1287
--- src/checkin.c
+++ src/checkin.c
@@ -890,10 +890,11 @@
890 */
891 static void commit_warning(
892 const Blob *p, /* The content of the file being committed. */
893 int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */
894 int binOk, /* Non-zero if binary warnings should be disabled. */
895 int unicodeOk, /* Non-zero if unicode warnings should be disabled. */
896 const char *zFilename /* The full name of the file being committed. */
897 ){
898 int eType; /* return value of looks_like_utf8/utf16() */
899 int fUnicode; /* return value of starts_with_utf16_bom() */
900 char *zMsg; /* Warning message */
@@ -907,10 +908,13 @@
908 const char *zWarning;
909 Blob ans;
910 char cReply;
911
912 if( eType==-1 && fUnicode ){
913 if ( crnlOk && unicodeOk ){
914 return; /* We don't want Unicode/CR/NL warnings for this file. */
915 }
916 zWarning = "Unicode and CR/NL line endings";
917 }else if( eType==-1 ){
918 if( crnlOk ){
919 return; /* We don't want CR/NL warnings for this file. */
920 }
@@ -919,10 +923,13 @@
923 if( binOk ){
924 return; /* We don't want binary warnings for this file. */
925 }
926 zWarning = "binary data";
927 }else{
928 if ( unicodeOk ){
929 return; /* We don't want unicode warnings for this file. */
930 }
931 zWarning = "Unicode";
932 }
933 file_relative_name(zFilename, &fname, 0);
934 blob_zero(&ans);
935 zMsg = mprintf(
@@ -1016,10 +1023,11 @@
1023 const char *zComment; /* Check-in comment */
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 */
@@ -1054,10 +1062,11 @@
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 ){
@@ -1251,36 +1260,42 @@
1260 /* Step 1: Insert records for all modified files into the blob
1261 ** table. If there were arguments passed to this command, only
1262 ** the identified files are inserted (if they have been modified).
1263 */
1264 db_prepare(&q,
1265 "SELECT id, %Q || pathname, mrid, %s, chnged, %s, %s FROM vfile "
1266 "WHERE chnged==1 AND NOT deleted AND is_selected(id)",
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",""))
1271 );
1272 while( db_step(&q)==SQLITE_ROW ){
1273 int id, rid;
1274 const char *zFullname;
1275 Blob content;
1276 int crnlOk, binOk, unicodeOk, chnged;
1277
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 */
1289 blob_read_link(&content, zFullname);
1290 }else{
1291 blob_read_from_file(&content, zFullname);
1292 }
1293 /* Do not emit any warnings when they are disabled. */
1294 if( !noWarningFlag ){
1295 commit_warning(&content, crnlOk, binOk, unicodeOk, zFullname);
1296 }
1297 if( chnged==1 && contains_merge_marker(&content) ){
1298 Blob fname; /* Relative pathname of the file */
1299
1300 nConflict++;
1301 file_relative_name(zFullname, &fname, 0);
1302
--- src/configure.c
+++ src/configure.c
@@ -103,10 +103,11 @@
103103
{ "project-description", CONFIGSET_PROJ },
104104
{ "manifest", CONFIGSET_PROJ },
105105
{ "binary-glob", CONFIGSET_PROJ },
106106
{ "ignore-glob", CONFIGSET_PROJ },
107107
{ "crnl-glob", CONFIGSET_PROJ },
108
+ { "unicode-glob", CONFIGSET_PROJ },
108109
{ "empty-dirs", CONFIGSET_PROJ },
109110
{ "allow-symlinks", CONFIGSET_PROJ },
110111
111112
{ "ticket-table", CONFIGSET_TKT },
112113
{ "ticket-common", CONFIGSET_TKT },
113114
--- src/configure.c
+++ src/configure.c
@@ -103,10 +103,11 @@
103 { "project-description", CONFIGSET_PROJ },
104 { "manifest", CONFIGSET_PROJ },
105 { "binary-glob", CONFIGSET_PROJ },
106 { "ignore-glob", CONFIGSET_PROJ },
107 { "crnl-glob", CONFIGSET_PROJ },
 
108 { "empty-dirs", CONFIGSET_PROJ },
109 { "allow-symlinks", CONFIGSET_PROJ },
110
111 { "ticket-table", CONFIGSET_TKT },
112 { "ticket-common", CONFIGSET_TKT },
113
--- src/configure.c
+++ src/configure.c
@@ -103,10 +103,11 @@
103 { "project-description", CONFIGSET_PROJ },
104 { "manifest", CONFIGSET_PROJ },
105 { "binary-glob", CONFIGSET_PROJ },
106 { "ignore-glob", CONFIGSET_PROJ },
107 { "crnl-glob", CONFIGSET_PROJ },
108 { "unicode-glob", CONFIGSET_PROJ },
109 { "empty-dirs", CONFIGSET_PROJ },
110 { "allow-symlinks", CONFIGSET_PROJ },
111
112 { "ticket-table", CONFIGSET_TKT },
113 { "ticket-common", CONFIGSET_TKT },
114
+6
--- src/db.c
+++ src/db.c
@@ -2085,10 +2085,11 @@
20852085
{ "th1-setup", 0, 40, 0, "" },
20862086
#ifdef FOSSIL_ENABLE_TCL
20872087
{ "tcl", 0, 0, 0, "off" },
20882088
{ "tcl-setup", 0, 40, 0, "" },
20892089
#endif
2090
+ { "unicode-glob", 0, 40, 1, "" },
20902091
{ "web-browser", 0, 32, 0, "" },
20912092
{ "white-foreground", 0, 0, 0, "off" },
20922093
{ 0,0,0,0,0 }
20932094
};
20942095
@@ -2263,10 +2264,15 @@
22632264
**
22642265
** th1-setup This is the setup script to be evaluated after creating
22652266
** and initializing the TH1 interpreter. By default, this
22662267
** is empty and no extra setup is performed.
22672268
**
2269
+** unicode-glob The VALUE is a comma or newline-separated list of GLOB
2270
+** (versionable) patterns specifying files that the "commit" command will
2271
+** ignore when issuing warnings about text files that may
2272
+** contain Unicode. Set to "*" to disable Unicode checking.
2273
+**
22682274
** web-browser A shell command used to launch your preferred
22692275
** web browser when given a URL as an argument.
22702276
** Defaults to "start" on windows, "open" on Mac,
22712277
** and "firefox" on Unix.
22722278
**
22732279
--- src/db.c
+++ src/db.c
@@ -2085,10 +2085,11 @@
2085 { "th1-setup", 0, 40, 0, "" },
2086 #ifdef FOSSIL_ENABLE_TCL
2087 { "tcl", 0, 0, 0, "off" },
2088 { "tcl-setup", 0, 40, 0, "" },
2089 #endif
 
2090 { "web-browser", 0, 32, 0, "" },
2091 { "white-foreground", 0, 0, 0, "off" },
2092 { 0,0,0,0,0 }
2093 };
2094
@@ -2263,10 +2264,15 @@
2263 **
2264 ** th1-setup This is the setup script to be evaluated after creating
2265 ** and initializing the TH1 interpreter. By default, this
2266 ** is empty and no extra setup is performed.
2267 **
 
 
 
 
 
2268 ** web-browser A shell command used to launch your preferred
2269 ** web browser when given a URL as an argument.
2270 ** Defaults to "start" on windows, "open" on Mac,
2271 ** and "firefox" on Unix.
2272 **
2273
--- src/db.c
+++ src/db.c
@@ -2085,10 +2085,11 @@
2085 { "th1-setup", 0, 40, 0, "" },
2086 #ifdef FOSSIL_ENABLE_TCL
2087 { "tcl", 0, 0, 0, "off" },
2088 { "tcl-setup", 0, 40, 0, "" },
2089 #endif
2090 { "unicode-glob", 0, 40, 1, "" },
2091 { "web-browser", 0, 32, 0, "" },
2092 { "white-foreground", 0, 0, 0, "off" },
2093 { 0,0,0,0,0 }
2094 };
2095
@@ -2263,10 +2264,15 @@
2264 **
2265 ** th1-setup This is the setup script to be evaluated after creating
2266 ** and initializing the TH1 interpreter. By default, this
2267 ** is empty and no extra setup is performed.
2268 **
2269 ** unicode-glob The VALUE is a comma or newline-separated list of GLOB
2270 ** (versionable) patterns specifying files that the "commit" command will
2271 ** ignore when issuing warnings about text files that may
2272 ** contain Unicode. Set to "*" to disable Unicode checking.
2273 **
2274 ** web-browser A shell command used to launch your preferred
2275 ** web browser when given a URL as an argument.
2276 ** Defaults to "start" on windows, "open" on Mac,
2277 ** and "firefox" on Unix.
2278 **
2279

Keyboard Shortcuts

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