Fossil SCM

Leave the -original, -baseline, and -merge files around when an update or merge conflicts due to binary files.

drh 2012-03-01 13:40 trunk
Commit 471044f66417daddc61cd0b16b3208da43e9de65
2 files changed +10 -4 +1 -1
+10 -4
--- src/merge3.c
+++ src/merge3.c
@@ -395,25 +395,29 @@
395395
Blob *pV2, /* Version merging from (yours) */
396396
Blob *pOut /* Output written here */
397397
){
398398
Blob v1; /* Content of zV1 */
399399
int rc; /* Return code of subroutines and this routine */
400
+ char *zPivot; /* Name of the pivot file */
401
+ char *zOrig; /* Name of the original content file */
402
+ char *zOther; /* Name of the merge file */
400403
401404
blob_read_from_file(&v1, zV1);
402405
rc = blob_merge(pPivot, &v1, pV2, pOut);
403
- if( rc>0 ){
404
- char *zPivot; /* Name of the pivot file */
405
- char *zOrig; /* Name of the original content file */
406
- char *zOther; /* Name of the merge file */
406
+ if( rc!=0 ){
407407
const char *zGMerge; /* Name of the gmerge command */
408408
409409
zPivot = file_newname(zV1, "baseline", 1);
410410
blob_write_to_file(pPivot, zPivot);
411411
zOrig = file_newname(zV1, "original", 1);
412412
blob_write_to_file(&v1, zOrig);
413413
zOther = file_newname(zV1, "merge", 1);
414414
blob_write_to_file(pV2, zOther);
415
+ }
416
+ if( rc>0 ){
417
+ const char *zGMerge; /* Name of the gmerge command */
418
+
415419
zGMerge = db_get("gmerge-command", 0);
416420
if( zGMerge && zGMerge[0] ){
417421
char *zOut; /* Temporary output file */
418422
char *zCmd; /* Command to invoke */
419423
const char *azSubst[8]; /* Strings to be substituted */
@@ -434,12 +438,14 @@
434438
file_delete(zOut);
435439
}
436440
fossil_free(zCmd);
437441
fossil_free(zOut);
438442
}
443
+ }
444
+ if( rc!=0 ){
439445
fossil_free(zPivot);
440446
fossil_free(zOrig);
441447
fossil_free(zOther);
442448
}
443449
blob_reset(&v1);
444450
return rc;
445451
}
446452
--- src/merge3.c
+++ src/merge3.c
@@ -395,25 +395,29 @@
395 Blob *pV2, /* Version merging from (yours) */
396 Blob *pOut /* Output written here */
397 ){
398 Blob v1; /* Content of zV1 */
399 int rc; /* Return code of subroutines and this routine */
 
 
 
400
401 blob_read_from_file(&v1, zV1);
402 rc = blob_merge(pPivot, &v1, pV2, pOut);
403 if( rc>0 ){
404 char *zPivot; /* Name of the pivot file */
405 char *zOrig; /* Name of the original content file */
406 char *zOther; /* Name of the merge file */
407 const char *zGMerge; /* Name of the gmerge command */
408
409 zPivot = file_newname(zV1, "baseline", 1);
410 blob_write_to_file(pPivot, zPivot);
411 zOrig = file_newname(zV1, "original", 1);
412 blob_write_to_file(&v1, zOrig);
413 zOther = file_newname(zV1, "merge", 1);
414 blob_write_to_file(pV2, zOther);
 
 
 
 
415 zGMerge = db_get("gmerge-command", 0);
416 if( zGMerge && zGMerge[0] ){
417 char *zOut; /* Temporary output file */
418 char *zCmd; /* Command to invoke */
419 const char *azSubst[8]; /* Strings to be substituted */
@@ -434,12 +438,14 @@
434 file_delete(zOut);
435 }
436 fossil_free(zCmd);
437 fossil_free(zOut);
438 }
 
 
439 fossil_free(zPivot);
440 fossil_free(zOrig);
441 fossil_free(zOther);
442 }
443 blob_reset(&v1);
444 return rc;
445 }
446
--- src/merge3.c
+++ src/merge3.c
@@ -395,25 +395,29 @@
395 Blob *pV2, /* Version merging from (yours) */
396 Blob *pOut /* Output written here */
397 ){
398 Blob v1; /* Content of zV1 */
399 int rc; /* Return code of subroutines and this routine */
400 char *zPivot; /* Name of the pivot file */
401 char *zOrig; /* Name of the original content file */
402 char *zOther; /* Name of the merge file */
403
404 blob_read_from_file(&v1, zV1);
405 rc = blob_merge(pPivot, &v1, pV2, pOut);
406 if( rc!=0 ){
 
 
 
407 const char *zGMerge; /* Name of the gmerge command */
408
409 zPivot = file_newname(zV1, "baseline", 1);
410 blob_write_to_file(pPivot, zPivot);
411 zOrig = file_newname(zV1, "original", 1);
412 blob_write_to_file(&v1, zOrig);
413 zOther = file_newname(zV1, "merge", 1);
414 blob_write_to_file(pV2, zOther);
415 }
416 if( rc>0 ){
417 const char *zGMerge; /* Name of the gmerge command */
418
419 zGMerge = db_get("gmerge-command", 0);
420 if( zGMerge && zGMerge[0] ){
421 char *zOut; /* Temporary output file */
422 char *zCmd; /* Command to invoke */
423 const char *azSubst[8]; /* Strings to be substituted */
@@ -434,12 +438,14 @@
438 file_delete(zOut);
439 }
440 fossil_free(zCmd);
441 fossil_free(zOut);
442 }
443 }
444 if( rc!=0 ){
445 fossil_free(zPivot);
446 fossil_free(zOrig);
447 fossil_free(zOther);
448 }
449 blob_reset(&v1);
450 return rc;
451 }
452
+1 -1
--- src/update.c
+++ src/update.c
@@ -474,11 +474,11 @@
474474
if( nConflict ){
475475
if( internalUpdate ){
476476
internalConflictCnt = nConflict;
477477
nConflict = 0;
478478
}else{
479
- fossil_print("WARNING: %d merge conflicts", nConflict);
479
+ fossil_warning("WARNING: %d merge conflicts", nConflict);
480480
}
481481
}
482482
if( nOverwrite ){
483483
fossil_warning("WARNING: %d unmanaged files were overwritten",
484484
nOverwrite);
485485
--- src/update.c
+++ src/update.c
@@ -474,11 +474,11 @@
474 if( nConflict ){
475 if( internalUpdate ){
476 internalConflictCnt = nConflict;
477 nConflict = 0;
478 }else{
479 fossil_print("WARNING: %d merge conflicts", nConflict);
480 }
481 }
482 if( nOverwrite ){
483 fossil_warning("WARNING: %d unmanaged files were overwritten",
484 nOverwrite);
485
--- src/update.c
+++ src/update.c
@@ -474,11 +474,11 @@
474 if( nConflict ){
475 if( internalUpdate ){
476 internalConflictCnt = nConflict;
477 nConflict = 0;
478 }else{
479 fossil_warning("WARNING: %d merge conflicts", nConflict);
480 }
481 }
482 if( nOverwrite ){
483 fossil_warning("WARNING: %d unmanaged files were overwritten",
484 nOverwrite);
485

Keyboard Shortcuts

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