Fossil SCM

Promote the "test-3-way-merge" command to a "3-way-merge". Add better help text.

drh 2013-07-19 12:49 trunk
Commit e5c634b1eaa537bf7f8a11510d2540672962ffd5
1 file changed +23 -4
+23 -4
--- src/merge3.c
+++ src/merge3.c
@@ -340,16 +340,35 @@
340340
blob_reset(&file);
341341
return rc;
342342
}
343343
344344
/*
345
-** COMMAND: test-3-way-merge
345
+** COMMAND: 3-way-merge*
346
+**
347
+** Usage: %fossil 3-way-merge BASELINE V1 V2 MERGED
348
+**
349
+** Inputs are files BASELINE, V1, and V2. The file MERGED is generated
350
+** as output.
351
+**
352
+** BASELINE is a common ancestor of two files V1 and V2 that have diverging
353
+** edits. The generated output file MERGED is the combination of all
354
+** changes in both V1 and V2.
355
+**
356
+** This command has no effect on the Fossil repository. It is a utility
357
+** command made available for the convenience of users. This command can
358
+** be used, for example, to help import changes from an upstream project.
346359
**
347
-** Usage: %fossil test-3-way-merge PIVOT V1 V2 MERGED
360
+** Suppose an upstream project has a file named "Xup.c" which is imported
361
+** with modifications to the local project as "Xlocal.c". Suppose further
362
+** that the "Xbase.c" is an exact copy of the last imported "Xup.c".
363
+** Then to import the latest "Xup.c" while preserving all the local changes:
348364
**
349
-** Combine change in going from PIVOT->VERSION1 with the change going
350
-** from PIVOT->VERSION2 and write the combined changes into MERGED.
365
+** fossil 3-way-merge Xbase.c Xlocal.c Xup.c Xlocal.c
366
+** cp Xup.c Xbase.c
367
+** # Verify that everything still works
368
+** fossil commit
369
+**
351370
*/
352371
void delta_3waymerge_cmd(void){
353372
Blob pivot, v1, v2, merged;
354373
if( g.argc!=6 ){
355374
usage("PIVOT V1 V2 MERGED");
356375
--- src/merge3.c
+++ src/merge3.c
@@ -340,16 +340,35 @@
340 blob_reset(&file);
341 return rc;
342 }
343
344 /*
345 ** COMMAND: test-3-way-merge
 
 
 
 
 
 
 
 
 
 
 
 
 
346 **
347 ** Usage: %fossil test-3-way-merge PIVOT V1 V2 MERGED
 
 
 
348 **
349 ** Combine change in going from PIVOT->VERSION1 with the change going
350 ** from PIVOT->VERSION2 and write the combined changes into MERGED.
 
 
 
351 */
352 void delta_3waymerge_cmd(void){
353 Blob pivot, v1, v2, merged;
354 if( g.argc!=6 ){
355 usage("PIVOT V1 V2 MERGED");
356
--- src/merge3.c
+++ src/merge3.c
@@ -340,16 +340,35 @@
340 blob_reset(&file);
341 return rc;
342 }
343
344 /*
345 ** COMMAND: 3-way-merge*
346 **
347 ** Usage: %fossil 3-way-merge BASELINE V1 V2 MERGED
348 **
349 ** Inputs are files BASELINE, V1, and V2. The file MERGED is generated
350 ** as output.
351 **
352 ** BASELINE is a common ancestor of two files V1 and V2 that have diverging
353 ** edits. The generated output file MERGED is the combination of all
354 ** changes in both V1 and V2.
355 **
356 ** This command has no effect on the Fossil repository. It is a utility
357 ** command made available for the convenience of users. This command can
358 ** be used, for example, to help import changes from an upstream project.
359 **
360 ** Suppose an upstream project has a file named "Xup.c" which is imported
361 ** with modifications to the local project as "Xlocal.c". Suppose further
362 ** that the "Xbase.c" is an exact copy of the last imported "Xup.c".
363 ** Then to import the latest "Xup.c" while preserving all the local changes:
364 **
365 ** fossil 3-way-merge Xbase.c Xlocal.c Xup.c Xlocal.c
366 ** cp Xup.c Xbase.c
367 ** # Verify that everything still works
368 ** fossil commit
369 **
370 */
371 void delta_3waymerge_cmd(void){
372 Blob pivot, v1, v2, merged;
373 if( g.argc!=6 ){
374 usage("PIVOT V1 V2 MERGED");
375

Keyboard Shortcuts

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