Fossil SCM
REPLACE into the event table rather than INSERT.
Commit
7aa9a2e206454f9d4e4f71660ef0b2c03ec2300c
Parent
e60ba158215dea5…
1 file changed
+3
-3
+3
-3
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -783,11 +783,11 @@ | ||
| 783 | 783 | int cid = db_column_int(&q, 0); |
| 784 | 784 | add_mlink(rid, &m, cid, 0); |
| 785 | 785 | } |
| 786 | 786 | db_finalize(&q); |
| 787 | 787 | db_multi_exec( |
| 788 | - "INSERT INTO event(type,mtime,objid,user,comment," | |
| 788 | + "REPLACE INTO event(type,mtime,objid,user,comment," | |
| 789 | 789 | " bgcolor,brbgcolor,euser,ecomment)" |
| 790 | 790 | "VALUES('ci',%.17g,%d,%Q,%Q," |
| 791 | 791 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype=1)," |
| 792 | 792 | "(SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype!=1)," |
| 793 | 793 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| @@ -845,11 +845,11 @@ | ||
| 845 | 845 | if( prior ){ |
| 846 | 846 | content_deltify(prior, rid, 0); |
| 847 | 847 | } |
| 848 | 848 | zComment = mprintf("Changes to wiki page [%h]", m.zWikiTitle); |
| 849 | 849 | db_multi_exec( |
| 850 | - "INSERT INTO event(type,mtime,objid,user,comment," | |
| 850 | + "REPLACE INTO event(type,mtime,objid,user,comment," | |
| 851 | 851 | " bgcolor,brbgcolor,euser,ecomment)" |
| 852 | 852 | "VALUES('w',%.17g,%d,%Q,%Q," |
| 853 | 853 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype=1)," |
| 854 | 854 | "(SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype!=1)," |
| 855 | 855 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| @@ -870,15 +870,15 @@ | ||
| 870 | 870 | zTag = mprintf("tkt-%s", m.zTicketUuid); |
| 871 | 871 | tag_insert(zTag, 1, 0, rid, m.rDate, rid); |
| 872 | 872 | free(zTag); |
| 873 | 873 | zComment = mprintf("Changes to ticket [%.10s]", m.zTicketUuid); |
| 874 | 874 | db_multi_exec( |
| 875 | - "INSERT INTO event(type,mtime,objid,user,comment)" | |
| 875 | + "REPLACE INTO event(type,mtime,objid,user,comment)" | |
| 876 | 876 | "VALUES('t',%.17g,%d,%Q,%Q)", |
| 877 | 877 | m.rDate, rid, m.zUser, zComment |
| 878 | 878 | ); |
| 879 | 879 | free(zComment); |
| 880 | 880 | } |
| 881 | 881 | db_end_transaction(0); |
| 882 | 882 | manifest_clear(&m); |
| 883 | 883 | return 1; |
| 884 | 884 | } |
| 885 | 885 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -783,11 +783,11 @@ | |
| 783 | int cid = db_column_int(&q, 0); |
| 784 | add_mlink(rid, &m, cid, 0); |
| 785 | } |
| 786 | db_finalize(&q); |
| 787 | db_multi_exec( |
| 788 | "INSERT INTO event(type,mtime,objid,user,comment," |
| 789 | " bgcolor,brbgcolor,euser,ecomment)" |
| 790 | "VALUES('ci',%.17g,%d,%Q,%Q," |
| 791 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype=1)," |
| 792 | "(SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype!=1)," |
| 793 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| @@ -845,11 +845,11 @@ | |
| 845 | if( prior ){ |
| 846 | content_deltify(prior, rid, 0); |
| 847 | } |
| 848 | zComment = mprintf("Changes to wiki page [%h]", m.zWikiTitle); |
| 849 | db_multi_exec( |
| 850 | "INSERT INTO event(type,mtime,objid,user,comment," |
| 851 | " bgcolor,brbgcolor,euser,ecomment)" |
| 852 | "VALUES('w',%.17g,%d,%Q,%Q," |
| 853 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype=1)," |
| 854 | "(SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype!=1)," |
| 855 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| @@ -870,15 +870,15 @@ | |
| 870 | zTag = mprintf("tkt-%s", m.zTicketUuid); |
| 871 | tag_insert(zTag, 1, 0, rid, m.rDate, rid); |
| 872 | free(zTag); |
| 873 | zComment = mprintf("Changes to ticket [%.10s]", m.zTicketUuid); |
| 874 | db_multi_exec( |
| 875 | "INSERT INTO event(type,mtime,objid,user,comment)" |
| 876 | "VALUES('t',%.17g,%d,%Q,%Q)", |
| 877 | m.rDate, rid, m.zUser, zComment |
| 878 | ); |
| 879 | free(zComment); |
| 880 | } |
| 881 | db_end_transaction(0); |
| 882 | manifest_clear(&m); |
| 883 | return 1; |
| 884 | } |
| 885 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -783,11 +783,11 @@ | |
| 783 | int cid = db_column_int(&q, 0); |
| 784 | add_mlink(rid, &m, cid, 0); |
| 785 | } |
| 786 | db_finalize(&q); |
| 787 | db_multi_exec( |
| 788 | "REPLACE INTO event(type,mtime,objid,user,comment," |
| 789 | " bgcolor,brbgcolor,euser,ecomment)" |
| 790 | "VALUES('ci',%.17g,%d,%Q,%Q," |
| 791 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype=1)," |
| 792 | "(SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype!=1)," |
| 793 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| @@ -845,11 +845,11 @@ | |
| 845 | if( prior ){ |
| 846 | content_deltify(prior, rid, 0); |
| 847 | } |
| 848 | zComment = mprintf("Changes to wiki page [%h]", m.zWikiTitle); |
| 849 | db_multi_exec( |
| 850 | "REPLACE INTO event(type,mtime,objid,user,comment," |
| 851 | " bgcolor,brbgcolor,euser,ecomment)" |
| 852 | "VALUES('w',%.17g,%d,%Q,%Q," |
| 853 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype=1)," |
| 854 | "(SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype!=1)," |
| 855 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| @@ -870,15 +870,15 @@ | |
| 870 | zTag = mprintf("tkt-%s", m.zTicketUuid); |
| 871 | tag_insert(zTag, 1, 0, rid, m.rDate, rid); |
| 872 | free(zTag); |
| 873 | zComment = mprintf("Changes to ticket [%.10s]", m.zTicketUuid); |
| 874 | db_multi_exec( |
| 875 | "REPLACE INTO event(type,mtime,objid,user,comment)" |
| 876 | "VALUES('t',%.17g,%d,%Q,%Q)", |
| 877 | m.rDate, rid, m.zUser, zComment |
| 878 | ); |
| 879 | free(zComment); |
| 880 | } |
| 881 | db_end_transaction(0); |
| 882 | manifest_clear(&m); |
| 883 | return 1; |
| 884 | } |
| 885 |