Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch use-blob_strip_bom Excluding Merge-Ins
This is equivalent to a diff from ea2598e447 to af4d780446
2013-04-05
| ||
07:44 | Branches "use-blob_strip_bom" and "improve_commit_warning" go together in a single new (experimental) branch check-in: a7e77a66b0 user: jan.nijtmans tags: ui-no-utf8 | |
2013-03-19
| ||
14:12 | take over new testcases from bomRefactor branch. check-in: f58bc2dfc7 user: jan.nijtmans tags: trunk | |
10:06 | merge trunk (still experimental) Closed-Leaf check-in: af4d780446 user: jan.nijtmans tags: use-blob_strip_bom | |
08:59 | Merge "cr-warning" branch to trunk: Fossil now warns before committing files with CR line-endings and offers to convert them to LF line-endings; fossil's diff cannot handle those. In checkin.c, use LOOK_BINARY in stead of LOOK_NUL, in case more flags are added to the BINARY detection. Rename LOOK_LENGTH to LOOK_LONG. check-in: ea2598e447 user: jan.nijtmans tags: trunk | |
2013-03-18
| ||
12:37 | Adapt test-case 112 such that it contains a reversed CR/LF, a case not covered before. Fix detection of reversed CR/LF and lone CR in reversed UTF-16 case, broken by [e3f9a42b58]. check-in: a4cdc7235a user: jan.nijtmans tags: trunk | |
2013-03-15
| ||
12:53 | (expirimental) First implementation of "CR line endings" warning. Closed-Leaf check-in: 5a886cfd9b user: jan.nijtmans tags: cr-warning | |
2013-02-27
| ||
11:30 | comment fix check-in: f78a487f43 user: jan.nijtmans tags: use-blob_strip_bom | |
Changes to src/blob.c.
︙ | |||
1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 | 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 | + + | } /* ** Strip a possible byte-order-mark (BOM) from the blob. On Windows, if there ** is either no BOM at all or an (le/be) UTF-16 BOM, a conversion to UTF-8 is ** done. If useMbcs is false and there is no BOM, the input string is assumed ** to be UTF-8 already, so no conversion is done. ** If useMbcs is 2, any BOM is replaced by the UTF-8 BOM */ void blob_to_utf8_no_bom(Blob *pBlob, int useMbcs){ char *zUtf8; int bomSize = 0; int bomReverse = 0; if( starts_with_utf8_bom(pBlob, &bomSize) ){ struct Blob temp; zUtf8 = blob_str(pBlob) + bomSize; blob_zero(&temp); blob_append(&temp, zUtf8, -1); blob_swap(pBlob, &temp); blob_reset(&temp); |
︙ | |||
1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 | 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 | + + + + | } } /* Make sure the blob contains two terminating 0-bytes */ blob_append(pBlob, "", 1); zUtf8 = blob_str(pBlob) + bomSize; zUtf8 = fossil_unicode_to_utf8(zUtf8); blob_zero(pBlob); if( useMbcs>1 ){ const unsigned char *bom = get_utf8_bom(&bomSize); blob_append(pBlob, (char*)bom, bomSize); } blob_append(pBlob, zUtf8, -1); fossil_unicode_free(zUtf8); #endif /* _WIN32 || __CYGWIN__ */ #if defined(_WIN32) }else if( useMbcs ){ zUtf8 = fossil_mbcs_to_utf8(blob_str(pBlob)); blob_reset(pBlob); blob_append(pBlob, zUtf8, -1); fossil_mbcs_free(zUtf8); #endif /* _WIN32 */ } } |
Changes to src/checkin.c.
︙ | |||
917 918 919 920 921 922 923 | 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 | - + - + - + - + | if( allOk ) return 0; fUnicode = could_be_utf16(p, &bReverse); if( fUnicode ){ lookFlags = looks_like_utf16(p, bReverse); }else{ lookFlags = looks_like_utf8(p); } |
︙ |
Changes to src/diff.c.
︙ | |||
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | + + + - - + + + + + + + + - + + + + - - - - - - - - + + + + + + + + + - | /* ** These error messages are shared in multiple locations. They are defined ** here for consistency. */ #define DIFF_CANNOT_COMPUTE_BINARY \ "cannot compute difference between binary files\n" #define DIFF_CANNOT_COMPUTE_ENCODING \ "cannot compute difference between files with different encodings\n" #define DIFF_CANNOT_COMPUTE_SYMLINK \ "cannot compute difference between symlink and regular file\n" #define DIFF_TOO_MANY_CHANGES_TXT \ "more than 10,000 changes\n" #define DIFF_TOO_MANY_CHANGES_HTML \ "<p class='generalError'>More than 10,000 changes</p>\n" /* |
︙ | |||
233 234 235 236 237 238 239 | 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | - + - + - + | ** officially unspecified. ** ************************************ WARNING ********************************** */ int looks_like_utf8(const Blob *pContent){ const char *z = blob_buffer(pContent); unsigned int n = blob_size(pContent); |
︙ | |||
288 289 290 291 292 293 294 | 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | - - - + + + + - - + | # define WCHAR_T wchar_t # else # define WCHAR_T unsigned short # endif #endif /* |
︙ | |||
336 337 338 339 340 341 342 | 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | - + - - - + + + - - - + + + | ** officially unspecified. ** ************************************ WARNING ********************************** */ int looks_like_utf16(const Blob *pContent, int bReverse){ const WCHAR_T *z = (WCHAR_T *)blob_buffer(pContent); unsigned int n = blob_size(pContent); |
︙ | |||
2534 2535 2536 2537 2538 2539 2540 | 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 | - - + + | lookFlags = fUnicode ? looks_like_utf16(&blob, bReverse) : looks_like_utf8(&blob); fossil_print("File \"%s\" has %d bytes.\n",g.argv[2],blob_size(&blob)); fossil_print("Starts with UTF-8 BOM: %s\n",fUtf8?"yes":"no"); fossil_print("Starts with UTF-16 BOM: %s\n", fUtf16?(bReverse?"reversed":"yes"):"no"); fossil_print("Looks like UTF-%s: %s\n",fUnicode?"16":"8", |
Changes to src/diffcmd.c.
︙ | |||
74 75 76 77 78 79 80 | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | - + + + + - + + + + + + - + - + + | ** ** When using an external diff program, zBinGlob contains the GLOB patterns ** for file names to treat as binary. If fIncludeBinary is zero, these files ** will be skipped in addition to files that may contain binary content. */ void diff_file( Blob *pFile1, /* In memory content to compare from */ |
︙ | |||
195 196 197 198 199 200 201 | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | - + - + + - + | ** When using an external diff program, zBinGlob contains the GLOB patterns ** for file names to treat as binary. If fIncludeBinary is zero, these files ** will be skipped in addition to files that may contain binary content. */ void diff_file_mem( Blob *pFile1, /* In memory content to compare from */ Blob *pFile2, /* In memory content to compare to */ |
︙ | |||
280 281 282 283 284 285 286 | 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | - + - + - + | int fIncludeBinary, /* Include binary files for external diff */ u64 diffFlags, /* Diff control flags */ const char *zFileTreeName ){ Blob fname; Blob content; int isLink; |
︙ | |||
387 388 389 390 391 392 393 | 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | - + - + + + - + | }else if( isChnged==3 ){ fossil_print("ADDED_BY_MERGE %s\n", zPathname); srcid = 0; if( !asNewFile ){ showDiff = 0; } } if( showDiff ){ Blob content; |
︙ | |||
435 436 437 438 439 440 441 | 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | - + - + - + + + + - + | u64 diffFlags, const char *zFileTreeName ){ char *zName; Blob fname; Blob v1, v2; int isLink1, isLink2; |
︙ | |||
475 476 477 478 479 480 481 | 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 | - + - - - - + + + + + + + + + + + | struct ManifestFile *pTo, const char *zDiffCmd, const char *zBinGlob, int fIncludeBinary, u64 diffFlags ){ Blob f1, f2; |
︙ |
Changes to src/stash.c.
︙ | |||
305 306 307 308 309 310 311 | 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 | - + - - - + + + + - - - + + + + + - - - - + + + + + + + + + + + - + | " FROM stashfile WHERE stashid=%d", stashid ); while( db_step(&q)==SQLITE_ROW ){ int rid = db_column_int(&q, 0); int isRemoved = db_column_int(&q, 1); int isLink = db_column_int(&q, 3); |
︙ |
Changes to src/update.c.
︙ | |||
611 612 613 614 615 616 617 | 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 | - + | */ int historical_version_of_file( const char *revision, /* The checkin containing the file */ const char *file, /* Full treename of the file */ Blob *content, /* Put the content here */ int *pIsLink, /* Set to true if file is link. */ int *pIsExe, /* Set to true if file is executable */ |
︙ | |||
638 639 640 641 642 643 644 | 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 | - - + + | if( pFile ){ int rc; rid = uuid_to_rid(pFile->zUuid, 0); if( pIsExe ) *pIsExe = ( manifest_file_mperm(pFile)==PERM_EXE ); if( pIsLink ) *pIsLink = ( manifest_file_mperm(pFile)==PERM_LNK ); manifest_destroy(pManifest); rc = content_get(rid, content); |
︙ |
Changes to win/Makefile.mingw.
︙ | |||
11 12 13 14 15 16 17 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | - + - + | # This is a makefile for use on Cygwin/Darwin/FreeBSD/Linux/Windows using # MinGW or MinGW-w64. # #### Select one of MinGW, MinGW-w64 (32-bit) or MinGW-w64 (64-bit) compilers. # By default, this is an empty string (i.e. use the native compiler). # |
︙ |