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.
Commit
9c28bca430e4eae1feea9d0cd252f28e9c2ced0e
Parent
b6710a0143974b7…
2 files changed
+11
-2
+2
-1
+11
-2
| --- src/merge.c | ||
| +++ src/merge.c | ||
| @@ -554,11 +554,20 @@ | ||
| 554 | 554 | |
| 555 | 555 | /* |
| 556 | 556 | ** Clean up the mid and pid VFILE entries. Then commit the changes. |
| 557 | 557 | */ |
| 558 | 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); | |
| 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 | + ); | |
| 561 | 570 | } |
| 562 | 571 | undo_finish(); |
| 563 | 572 | db_end_transaction(nochangeFlag); |
| 564 | 573 | } |
| 565 | 574 |
| --- 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 @@ | ||
| 474 | 474 | @ |
| 475 | 475 | @ -- This table holds a record of uncommitted merges in the local |
| 476 | 476 | @ -- file tree. If a VFILE entry with id has merged with another |
| 477 | 477 | @ -- record, there is an entry in this table with (id,merge) where |
| 478 | 478 | @ -- 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. | |
| 480 | 481 | @ |
| 481 | 482 | @ CREATE TABLE vmerge( |
| 482 | 483 | @ id INTEGER REFERENCES vfile, -- VFILE entry that has been merged |
| 483 | 484 | @ merge INTEGER, -- Merged with this record |
| 484 | 485 | @ UNIQUE(id, merge) |
| 485 | 486 |
| --- 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 |