Changes On Branch bellon-unicode
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch bellon-unicode Excluding Merge-Ins

This is equivalent to a diff from 7a8938ab84 to e9954e588b

2012-11-26
18:55
Merge commit warning enhancements (i.e. the 'unicode-glob' setting and the '--no-warnings' option to commit). check-in: cb856ccdb1 user: mistachkin tags: trunk
12:23
- Make --force imply --no-warnings - Add --no-warnings to "fossil scrub" and "fossil clean" - Remove "--conflict" option for "fossil merge", use --force for that. Closed-Leaf check-in: 06e1b67270 user: jan.nijtmans tags: bellon-unicode-v2
2012-11-25
22:58
Merge commit warning enhancements (i.e. the 'unicode-glob' setting and the '--no-warnings' option to commit). Not yet approved for trunk. Closed-Leaf check-in: 02062c2b6a user: mistachkin tags: mistake
22:31
During commit, instead of using the '--force' option to bypass file type warnings, add a new option '--no-warnings'. Closed-Leaf check-in: e9954e588b user: mistachkin tags: bellon-unicode
22:01
Adjust check for bypassing Unicode/CR/NL warning. check-in: be15485aa6 user: mistachkin tags: bellon-unicode
21:42
Patch provided by Stefan Bellon, >Attached you'll find a patch that adds the "unicode-glob" to the >settings and respects its setting in the check-in. Additionally I >disabled all the check-in warnings (crnl, binary and unicode) in case >--force/-f is set on commit. check-in: 0c2f705c80 user: jan.nijtmans tags: bellon-unicode
20:44
merge trunk check-in: 22a543bcf5 user: jan.nijtmans tags: ticket-d17d6e5b17
18:06
Fix formatting of the Login Group screen. Ticket [f687f1eb987148]. check-in: 7a8938ab84 user: drh tags: trunk
17:05
Fix an out-of-order variable declaration. check-in: 77dc754b98 user: drh tags: trunk

Changes to src/checkin.c.

   888    888   ** if a Unicode (UTF-16) byte-order-mark (BOM) or a \r\n line ending
   889    889   ** is seen in a text file.
   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 */
   900    901     Blob fname;             /* Relative pathname of the file */
   901    902     static int allOk = 0;   /* Set to true to disable this routine */
................................................................................
   905    906     eType = fUnicode ? looks_like_utf16(p) : looks_like_utf8(p);
   906    907     if( eType==0 || eType==-1 || fUnicode ){
   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         }
   917    921         zWarning = "CR/NL line endings";
   918    922       }else if( eType==0 ){
   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(
   929    936            "%s contains %s.  commit anyhow (a=all/y/N)? ",
   930    937            blob_str(&fname), zWarning);
................................................................................
  1014   1021     int nvid;              /* Blob-id of the new check-in */
  1015   1022     Blob comment;          /* Check-in comment */
  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 */
  1026   1034     char *zManifestFile;   /* Name of the manifest file */
  1027   1035     int useCksum;          /* True if checksums should be computed and verified */
................................................................................
  1052   1060     forceBaseline = find_option("baseline",0,0)!=0;
  1053   1061     if( forceDelta && forceBaseline ){
  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 ){
  1064   1073       if( zTag[0]==0 ) continue;
  1065   1074       azTag = fossil_realloc((void *)azTag, sizeof(char*)*(nTag+2));
................................................................................
  1249   1258     }
  1250   1259   
  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         fossil_print("possible unresolved merge conflict in %s\n",
  1288   1303                      blob_str(&fname));

Changes to src/configure.c.

   101    101   
   102    102     { "project-name",           CONFIGSET_PROJ },
   103    103     { "project-description",    CONFIGSET_PROJ },
   104    104     { "manifest",               CONFIGSET_PROJ },
   105    105     { "binary-glob",            CONFIGSET_PROJ },
   106    106     { "ignore-glob",            CONFIGSET_PROJ },
   107    107     { "crnl-glob",              CONFIGSET_PROJ },
          108  +  { "unicode-glob",           CONFIGSET_PROJ },
   108    109     { "empty-dirs",             CONFIGSET_PROJ },
   109    110     { "allow-symlinks",         CONFIGSET_PROJ },
   110    111   
   111    112     { "ticket-table",           CONFIGSET_TKT  },
   112    113     { "ticket-common",          CONFIGSET_TKT  },
   113    114     { "ticket-change",          CONFIGSET_TKT  },
   114    115     { "ticket-newpage",         CONFIGSET_TKT  },

Changes to src/db.c.

  2083   2083     { "ssl-identity",  0,               40, 0, ""                    },
  2084   2084     { "ssh-command",   0,               40, 0, ""                    },
  2085   2085     { "th1-setup",     0,               40, 0, ""                    },
  2086   2086   #ifdef FOSSIL_ENABLE_TCL
  2087   2087     { "tcl",           0,                0, 0, "off"                 },
  2088   2088     { "tcl-setup",     0,               40, 0, ""                    },
  2089   2089   #endif
         2090  +  { "unicode-glob",  0,               40, 1, ""                    },
  2090   2091     { "web-browser",   0,               32, 0, ""                    },
  2091   2092     { "white-foreground", 0,             0, 0, "off"                 },
  2092   2093     { 0,0,0,0,0 }
  2093   2094   };
  2094   2095   
  2095   2096   /*
  2096   2097   ** COMMAND: settings
................................................................................
  2260   2261   **    tcl-setup        This is the setup script to be evaluated after creating
  2261   2262   **                     and initializing the Tcl interpreter.  By default, this
  2262   2263   **                     is empty and no extra setup is performed.
  2263   2264   **
  2264   2265   **    th1-setup        This is the setup script to be evaluated after creating
  2265   2266   **                     and initializing the TH1 interpreter.  By default, this
  2266   2267   **                     is empty and no extra setup is performed.
         2268  +**
         2269  +**    unicode-glob     The VALUE is a comma or newline-separated list of
         2270  +**     (versionable)   GLOB patterns of files that should not produce a Unicode
         2271  +**                     warning.  Set to "*" to disable Unicode checking.
  2267   2272   **
  2268   2273   **    web-browser      A shell command used to launch your preferred
  2269   2274   **                     web browser when given a URL as an argument.
  2270   2275   **                     Defaults to "start" on windows, "open" on Mac,
  2271   2276   **                     and "firefox" on Unix.
  2272   2277   **
  2273   2278   ** Options: