Fossil

Check-in [3527aa44]
Login

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

Overview
Comment:Fix a couple line length issues and modify an error message.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:3527aa4474e893387017086634ec639c7546a99c
User & Date: mistachkin 2012-11-29 07:56:39
Context
2012-11-29
13:15
Translate decomposed-UTF8 filenames on MacOS into precomposed-UTF8. Fix for ticket [e399bc1edfe45b] check-in: ca728447 user: drh tags: trunk
07:57
This change is intended to detect, during commit, whether some file contents cannot be interpreted as either UTF-8 or ASCII. This typically happens when the file is in the iso8859-1 (UNIX) or cp1252 (win32) encoding. Nothing very bad happens, only fossil cannot display the characters. For example, see: http://core.tcl.tk/tcl/info/7559185e9a

It would be nice if fossil detects this situation, so the user has the choice to change the encoding to utf-8, or answer 'y' if this is intended.

Probably missing is a 'latin-glob', 'non-utf8-glob' (any ideas for a better name?) setting.

An improvement would be to allow the 'c' response, which aborts the commit but first converts it to utf-8 (assuming iso8859-1 on UNIX and cp1252 on win32)

Another thing this change does is warn if the file contains long lines which cannot be handled by fossil. The user is given the chance to break the long lines into shorter ones. This cannot be done automatically. Maybe add a "longlines-glob" setting as well.

Feedback welcome! check-in: 609ea54f user: mistachkin tags: improve_commit_warning

07:56
Fix a couple line length issues and modify an error message. check-in: 3527aa44 user: mistachkin tags: trunk
01:45
Give the user the option to convert file into UTF8 if they are in some other encoding when committed. The commit aborts regardless, to give the operator an opportunity to retest the changes before committing again. check-in: 22b570f4 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/checkin.c.

1337
1338
1339
1340
1341
1342
1343
1344

1345
1346
1347
1348
1349
1350
1351
....
1361
1362
1363
1364
1365
1366
1367

1368
1369
1370
1371
1372
1373
1374
1375
      /* Instead of file content, put link destination path */
      blob_read_link(&content, zFullname);
    }else{
      blob_read_from_file(&content, zFullname);
    }
    /* Do not emit any warnings when they are disabled. */
    if( !noWarningFlag ){
      abortCommit |= commit_warning(&content, crnlOk, binOk, unicodeOk, zFullname);

    }
    if( chnged==1 && contains_merge_marker(&content) ){
      Blob fname; /* Relative pathname of the file */

      nConflict++;
      file_relative_name(zFullname, &fname, 0);
      fossil_print("possible unresolved merge conflict in %s\n",
................................................................................
    db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nrid);
  }
  db_finalize(&q);
  if( nConflict && !allowConflict ){
    fossil_fatal("abort due to unresolved merge conflicts; "
                 "use --allow-conflict to override");
  } else if( abortCommit ){

    fossil_fatal("files are converted on your request. Please re-test before committing");
  }

  /* Create the new manifest */
  if( blob_size(&comment)==0 ){
    blob_append(&comment, "(no comment)", -1);
  }
  if( forceDelta ){







|
>







 







>
|







1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
....
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
      /* Instead of file content, put link destination path */
      blob_read_link(&content, zFullname);
    }else{
      blob_read_from_file(&content, zFullname);
    }
    /* Do not emit any warnings when they are disabled. */
    if( !noWarningFlag ){
      abortCommit |= commit_warning(&content, crnlOk, binOk,
                                    unicodeOk, zFullname);
    }
    if( chnged==1 && contains_merge_marker(&content) ){
      Blob fname; /* Relative pathname of the file */

      nConflict++;
      file_relative_name(zFullname, &fname, 0);
      fossil_print("possible unresolved merge conflict in %s\n",
................................................................................
    db_multi_exec("INSERT OR IGNORE INTO unsent VALUES(%d)", nrid);
  }
  db_finalize(&q);
  if( nConflict && !allowConflict ){
    fossil_fatal("abort due to unresolved merge conflicts; "
                 "use --allow-conflict to override");
  } else if( abortCommit ){
    fossil_fatal("one or more files were converted on your request; "
                 "please re-test before committing");
  }

  /* Create the new manifest */
  if( blob_size(&comment)==0 ){
    blob_append(&comment, "(no comment)", -1);
  }
  if( forceDelta ){