Fossil SCM

Fix issues in the graphical merge conflict resolution reported on the mailing list.

drh 2011-02-22 12:18 trunk
Commit 60f09863327dadb3d7cb851e6175005a8ae93747
2 files changed +2 -2 +9 -4
+2 -2
--- src/db.c
+++ src/db.c
@@ -1688,12 +1688,12 @@
16881688
** gdiff-command External command to run when performing a graphical
16891689
** diff. If undefined, text diff will be used.
16901690
**
16911691
** gmerge-command A graphical merge conflict resolver command operating
16921692
** 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"
16951695
**
16961696
** http-port The TCP/IP port number to use by the "server"
16971697
** and "ui" commands. Default: 8080
16981698
**
16991699
** ignore-glob The VALUE is a comma-separated list of GLOB patterns
17001700
--- 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 @@
348348
for(i=0; zInput[i] && zInput[i]!='%'; i++){}
349349
if( i>0 ){
350350
blob_append(&x, zInput, i);
351351
zInput += i;
352352
}
353
- if( zInput[i]==0 ) break;
353
+ if( zInput[0]==0 ) break;
354354
for(j=0; j<nSubst; j+=2){
355355
int n = strlen(azSubst[j]);
356
- if( memcmp(zInput, azSubst[j], n)==0 ){
356
+ if( strncmp(zInput, azSubst[j], n)==0 ){
357357
blob_append(&x, azSubst[j+1], -1);
358358
zInput += n;
359359
break;
360360
}
361361
}
@@ -420,12 +420,17 @@
420420
azSubst[4] = "%merge"; azSubst[5] = zOther;
421421
azSubst[6] = "%output"; azSubst[7] = zOut;
422422
zCmd = string_subst(zGMerge, 8, azSubst);
423423
printf("%s\n", zCmd); fflush(stdout);
424424
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
+ }
427432
fossil_free(zCmd);
428433
fossil_free(zOut);
429434
}
430435
fossil_free(zPivot);
431436
fossil_free(zOrig);
432437
--- 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

Keyboard Shortcuts

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