Fossil SCM
Fix issues in the graphical merge conflict resolution reported on the mailing list.
Commit
60f09863327dadb3d7cb851e6175005a8ae93747
Parent
184500e46a020cb…
2 files changed
+2
-2
+9
-4
M
src/db.c
+2
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1688,12 +1688,12 @@ | ||
| 1688 | 1688 | ** gdiff-command External command to run when performing a graphical |
| 1689 | 1689 | ** diff. If undefined, text diff will be used. |
| 1690 | 1690 | ** |
| 1691 | 1691 | ** gmerge-command A graphical merge conflict resolver command operating |
| 1692 | 1692 | ** on four files. |
| 1693 | -** Ex: kdiff3 %baseline %original %merge -o %output | |
| 1694 | -** Ex: xxdiff %original %baseline %merge -M %output | |
| 1693 | +** Ex: kdiff3 "%baseline" "%original" "%merge" -o "%output" | |
| 1694 | +** Ex: xxdiff "%original" "%baseline" "%merge" -M "%output" | |
| 1695 | 1695 | ** |
| 1696 | 1696 | ** http-port The TCP/IP port number to use by the "server" |
| 1697 | 1697 | ** and "ui" commands. Default: 8080 |
| 1698 | 1698 | ** |
| 1699 | 1699 | ** ignore-glob The VALUE is a comma-separated list of GLOB patterns |
| 1700 | 1700 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1688,12 +1688,12 @@ | |
| 1688 | ** gdiff-command External command to run when performing a graphical |
| 1689 | ** diff. If undefined, text diff will be used. |
| 1690 | ** |
| 1691 | ** gmerge-command A graphical merge conflict resolver command operating |
| 1692 | ** on four files. |
| 1693 | ** Ex: kdiff3 %baseline %original %merge -o %output |
| 1694 | ** Ex: xxdiff %original %baseline %merge -M %output |
| 1695 | ** |
| 1696 | ** http-port The TCP/IP port number to use by the "server" |
| 1697 | ** and "ui" commands. Default: 8080 |
| 1698 | ** |
| 1699 | ** ignore-glob The VALUE is a comma-separated list of GLOB patterns |
| 1700 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1688,12 +1688,12 @@ | |
| 1688 | ** gdiff-command External command to run when performing a graphical |
| 1689 | ** diff. If undefined, text diff will be used. |
| 1690 | ** |
| 1691 | ** gmerge-command A graphical merge conflict resolver command operating |
| 1692 | ** on four files. |
| 1693 | ** Ex: kdiff3 "%baseline" "%original" "%merge" -o "%output" |
| 1694 | ** Ex: xxdiff "%original" "%baseline" "%merge" -M "%output" |
| 1695 | ** |
| 1696 | ** http-port The TCP/IP port number to use by the "server" |
| 1697 | ** and "ui" commands. Default: 8080 |
| 1698 | ** |
| 1699 | ** ignore-glob The VALUE is a comma-separated list of GLOB patterns |
| 1700 |
+9
-4
| --- src/merge3.c | ||
| +++ src/merge3.c | ||
| @@ -348,14 +348,14 @@ | ||
| 348 | 348 | for(i=0; zInput[i] && zInput[i]!='%'; i++){} |
| 349 | 349 | if( i>0 ){ |
| 350 | 350 | blob_append(&x, zInput, i); |
| 351 | 351 | zInput += i; |
| 352 | 352 | } |
| 353 | - if( zInput[i]==0 ) break; | |
| 353 | + if( zInput[0]==0 ) break; | |
| 354 | 354 | for(j=0; j<nSubst; j+=2){ |
| 355 | 355 | int n = strlen(azSubst[j]); |
| 356 | - if( memcmp(zInput, azSubst[j], n)==0 ){ | |
| 356 | + if( strncmp(zInput, azSubst[j], n)==0 ){ | |
| 357 | 357 | blob_append(&x, azSubst[j+1], -1); |
| 358 | 358 | zInput += n; |
| 359 | 359 | break; |
| 360 | 360 | } |
| 361 | 361 | } |
| @@ -420,12 +420,17 @@ | ||
| 420 | 420 | azSubst[4] = "%merge"; azSubst[5] = zOther; |
| 421 | 421 | azSubst[6] = "%output"; azSubst[7] = zOut; |
| 422 | 422 | zCmd = string_subst(zGMerge, 8, azSubst); |
| 423 | 423 | printf("%s\n", zCmd); fflush(stdout); |
| 424 | 424 | fossil_system(zCmd); |
| 425 | - if( file_size(zOut)>=0 ) blob_read_from_file(pOut, zOut); | |
| 426 | - unlink(zOut); | |
| 425 | + if( file_size(zOut)>=0 ){ | |
| 426 | + blob_read_from_file(pOut, zOut); | |
| 427 | + unlink(zPivot); | |
| 428 | + unlink(zOrig); | |
| 429 | + unlink(zOther); | |
| 430 | + unlink(zOut); | |
| 431 | + } | |
| 427 | 432 | fossil_free(zCmd); |
| 428 | 433 | fossil_free(zOut); |
| 429 | 434 | } |
| 430 | 435 | fossil_free(zPivot); |
| 431 | 436 | fossil_free(zOrig); |
| 432 | 437 |
| --- src/merge3.c | |
| +++ src/merge3.c | |
| @@ -348,14 +348,14 @@ | |
| 348 | for(i=0; zInput[i] && zInput[i]!='%'; i++){} |
| 349 | if( i>0 ){ |
| 350 | blob_append(&x, zInput, i); |
| 351 | zInput += i; |
| 352 | } |
| 353 | if( zInput[i]==0 ) break; |
| 354 | for(j=0; j<nSubst; j+=2){ |
| 355 | int n = strlen(azSubst[j]); |
| 356 | if( memcmp(zInput, azSubst[j], n)==0 ){ |
| 357 | blob_append(&x, azSubst[j+1], -1); |
| 358 | zInput += n; |
| 359 | break; |
| 360 | } |
| 361 | } |
| @@ -420,12 +420,17 @@ | |
| 420 | azSubst[4] = "%merge"; azSubst[5] = zOther; |
| 421 | azSubst[6] = "%output"; azSubst[7] = zOut; |
| 422 | zCmd = string_subst(zGMerge, 8, azSubst); |
| 423 | printf("%s\n", zCmd); fflush(stdout); |
| 424 | fossil_system(zCmd); |
| 425 | if( file_size(zOut)>=0 ) blob_read_from_file(pOut, zOut); |
| 426 | unlink(zOut); |
| 427 | fossil_free(zCmd); |
| 428 | fossil_free(zOut); |
| 429 | } |
| 430 | fossil_free(zPivot); |
| 431 | fossil_free(zOrig); |
| 432 |
| --- src/merge3.c | |
| +++ src/merge3.c | |
| @@ -348,14 +348,14 @@ | |
| 348 | for(i=0; zInput[i] && zInput[i]!='%'; i++){} |
| 349 | if( i>0 ){ |
| 350 | blob_append(&x, zInput, i); |
| 351 | zInput += i; |
| 352 | } |
| 353 | if( zInput[0]==0 ) break; |
| 354 | for(j=0; j<nSubst; j+=2){ |
| 355 | int n = strlen(azSubst[j]); |
| 356 | if( strncmp(zInput, azSubst[j], n)==0 ){ |
| 357 | blob_append(&x, azSubst[j+1], -1); |
| 358 | zInput += n; |
| 359 | break; |
| 360 | } |
| 361 | } |
| @@ -420,12 +420,17 @@ | |
| 420 | azSubst[4] = "%merge"; azSubst[5] = zOther; |
| 421 | azSubst[6] = "%output"; azSubst[7] = zOut; |
| 422 | zCmd = string_subst(zGMerge, 8, azSubst); |
| 423 | printf("%s\n", zCmd); fflush(stdout); |
| 424 | fossil_system(zCmd); |
| 425 | if( file_size(zOut)>=0 ){ |
| 426 | blob_read_from_file(pOut, zOut); |
| 427 | unlink(zPivot); |
| 428 | unlink(zOrig); |
| 429 | unlink(zOther); |
| 430 | unlink(zOut); |
| 431 | } |
| 432 | fossil_free(zCmd); |
| 433 | fossil_free(zOut); |
| 434 | } |
| 435 | fossil_free(zPivot); |
| 436 | fossil_free(zOrig); |
| 437 |