Fossil SCM

Record --backout and --cherrypick merges in the VMERGE table with IDs -2 and -1, respectively. On a --cherrypick merge, make the default check-in comment be the same as the check-in comment for the cherrypicked change.

drh 2012-02-10 23:37 trunk
Commit 9c28bca430e4eae1feea9d0cd252f28e9c2ced0e
2 files changed +11 -2 +2 -1
+11 -2
--- src/merge.c
+++ src/merge.c
@@ -554,11 +554,20 @@
554554
555555
/*
556556
** Clean up the mid and pid VFILE entries. Then commit the changes.
557557
*/
558558
db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid);
559
- if( !pickFlag && !backoutFlag ){
560
- db_multi_exec("INSERT OR IGNORE INTO vmerge(id,merge) VALUES(0,%d)", mid);
559
+ db_multi_exec("INSERT OR IGNORE INTO vmerge(id,merge) VALUES(%d,%d)",
560
+ pickFlag ? -1 : (backoutFlag ? -2 : 0), mid);
561
+ if( pickFlag ){
562
+ /* For a cherry-pick merge, make the default check-in comment the same
563
+ ** as the check-in comment on the check-in that is being merged in. */
564
+ db_multi_exec(
565
+ "REPLACE INTO vvar(name,value)"
566
+ " SELECT 'ci-comment', coalesce(ecomment,comment) FROM event"
567
+ " WHERE type='ci' AND objid=%d",
568
+ mid
569
+ );
561570
}
562571
undo_finish();
563572
db_end_transaction(nochangeFlag);
564573
}
565574
--- src/merge.c
+++ src/merge.c
@@ -554,11 +554,20 @@
554
555 /*
556 ** Clean up the mid and pid VFILE entries. Then commit the changes.
557 */
558 db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid);
559 if( !pickFlag && !backoutFlag ){
560 db_multi_exec("INSERT OR IGNORE INTO vmerge(id,merge) VALUES(0,%d)", mid);
 
 
 
 
 
 
 
 
 
561 }
562 undo_finish();
563 db_end_transaction(nochangeFlag);
564 }
565
--- src/merge.c
+++ src/merge.c
@@ -554,11 +554,20 @@
554
555 /*
556 ** Clean up the mid and pid VFILE entries. Then commit the changes.
557 */
558 db_multi_exec("DELETE FROM vfile WHERE vid!=%d", vid);
559 db_multi_exec("INSERT OR IGNORE INTO vmerge(id,merge) VALUES(%d,%d)",
560 pickFlag ? -1 : (backoutFlag ? -2 : 0), mid);
561 if( pickFlag ){
562 /* For a cherry-pick merge, make the default check-in comment the same
563 ** as the check-in comment on the check-in that is being merged in. */
564 db_multi_exec(
565 "REPLACE INTO vvar(name,value)"
566 " SELECT 'ci-comment', coalesce(ecomment,comment) FROM event"
567 " WHERE type='ci' AND objid=%d",
568 mid
569 );
570 }
571 undo_finish();
572 db_end_transaction(nochangeFlag);
573 }
574
+2 -1
--- src/schema.c
+++ src/schema.c
@@ -474,11 +474,12 @@
474474
@
475475
@ -- This table holds a record of uncommitted merges in the local
476476
@ -- file tree. If a VFILE entry with id has merged with another
477477
@ -- record, there is an entry in this table with (id,merge) where
478478
@ -- merge is the RECORD table entry that the file merged against.
479
-@ -- An id of 0 here means the version record itself.
479
+@ -- An id of 0 here means the version record itself. When id==(-1)
480
+@ -- that is a cherrypick merge and id==(-2) is a backout merge.
480481
@
481482
@ CREATE TABLE vmerge(
482483
@ id INTEGER REFERENCES vfile, -- VFILE entry that has been merged
483484
@ merge INTEGER, -- Merged with this record
484485
@ UNIQUE(id, merge)
485486
--- src/schema.c
+++ src/schema.c
@@ -474,11 +474,12 @@
474 @
475 @ -- This table holds a record of uncommitted merges in the local
476 @ -- file tree. If a VFILE entry with id has merged with another
477 @ -- record, there is an entry in this table with (id,merge) where
478 @ -- merge is the RECORD table entry that the file merged against.
479 @ -- An id of 0 here means the version record itself.
 
480 @
481 @ CREATE TABLE vmerge(
482 @ id INTEGER REFERENCES vfile, -- VFILE entry that has been merged
483 @ merge INTEGER, -- Merged with this record
484 @ UNIQUE(id, merge)
485
--- src/schema.c
+++ src/schema.c
@@ -474,11 +474,12 @@
474 @
475 @ -- This table holds a record of uncommitted merges in the local
476 @ -- file tree. If a VFILE entry with id has merged with another
477 @ -- record, there is an entry in this table with (id,merge) where
478 @ -- merge is the RECORD table entry that the file merged against.
479 @ -- An id of 0 here means the version record itself. When id==(-1)
480 @ -- that is a cherrypick merge and id==(-2) is a backout merge.
481 @
482 @ CREATE TABLE vmerge(
483 @ id INTEGER REFERENCES vfile, -- VFILE entry that has been merged
484 @ merge INTEGER, -- Merged with this record
485 @ UNIQUE(id, merge)
486

Keyboard Shortcuts

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