Fossil SCM
Editing forum posts now applies delta compression to the edits.
Commit
5b7888c9940aed49a52e506d9d362d604bc17314bf384e536cdf4d0904947949
Parent
e0fc98caa11249c…
6 files changed
+1
-1
+3
-1
+1
-1
+1
-1
+1
+1
+1
-1
| --- src/content.c | ||
| +++ src/content.c | ||
| @@ -805,11 +805,11 @@ | ||
| 805 | 805 | ** artifact. Otherwise, when we go to send the public artifact on a |
| 806 | 806 | ** sync operation, the other end of the sync will never be able to receive |
| 807 | 807 | ** the source of the delta. It is OK to delta private->private and |
| 808 | 808 | ** public->private and public->public. Just no private->public delta. |
| 809 | 809 | ** |
| 810 | -** If aSrc[bestSrc] is already a dleta that depends on rid, then it is | |
| 810 | +** If aSrc[bestSrc] is already a delta that depends on rid, then it is | |
| 811 | 811 | ** converted to undeltaed text before the aSrc[bestSrc]->rid delta is |
| 812 | 812 | ** created, in order to prevent a delta loop. |
| 813 | 813 | ** |
| 814 | 814 | ** If either rid or aSrc[i] contain less than 50 bytes, or if the |
| 815 | 815 | ** resulting delta does not achieve a compression of at least 25% |
| 816 | 816 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -805,11 +805,11 @@ | |
| 805 | ** artifact. Otherwise, when we go to send the public artifact on a |
| 806 | ** sync operation, the other end of the sync will never be able to receive |
| 807 | ** the source of the delta. It is OK to delta private->private and |
| 808 | ** public->private and public->public. Just no private->public delta. |
| 809 | ** |
| 810 | ** If aSrc[bestSrc] is already a dleta that depends on rid, then it is |
| 811 | ** converted to undeltaed text before the aSrc[bestSrc]->rid delta is |
| 812 | ** created, in order to prevent a delta loop. |
| 813 | ** |
| 814 | ** If either rid or aSrc[i] contain less than 50 bytes, or if the |
| 815 | ** resulting delta does not achieve a compression of at least 25% |
| 816 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -805,11 +805,11 @@ | |
| 805 | ** artifact. Otherwise, when we go to send the public artifact on a |
| 806 | ** sync operation, the other end of the sync will never be able to receive |
| 807 | ** the source of the delta. It is OK to delta private->private and |
| 808 | ** public->private and public->public. Just no private->public delta. |
| 809 | ** |
| 810 | ** If aSrc[bestSrc] is already a delta that depends on rid, then it is |
| 811 | ** converted to undeltaed text before the aSrc[bestSrc]->rid delta is |
| 812 | ** created, in order to prevent a delta loop. |
| 813 | ** |
| 814 | ** If either rid or aSrc[i] contain less than 50 bytes, or if the |
| 815 | ** resulting delta does not achieve a compression of at least 25% |
| 816 |
+3
-1
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -993,11 +993,13 @@ | ||
| 993 | 993 | @ <pre>%h(blob_str(&x))</pre> |
| 994 | 994 | @ </div> |
| 995 | 995 | blob_reset(&x); |
| 996 | 996 | return 0; |
| 997 | 997 | }else{ |
| 998 | - int nrid = wiki_put(&x, 0, forum_need_moderation()); | |
| 998 | + int nrid = wiki_put(&x, iEdit>0 ? iEdit : 0, | |
| 999 | + forum_need_moderation()); | |
| 1000 | + blob_reset(&x); | |
| 999 | 1001 | cgi_redirectf("%R/forumpost/%S", rid_to_uuid(nrid)); |
| 1000 | 1002 | return 1; |
| 1001 | 1003 | } |
| 1002 | 1004 | } |
| 1003 | 1005 | |
| 1004 | 1006 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -993,11 +993,13 @@ | |
| 993 | @ <pre>%h(blob_str(&x))</pre> |
| 994 | @ </div> |
| 995 | blob_reset(&x); |
| 996 | return 0; |
| 997 | }else{ |
| 998 | int nrid = wiki_put(&x, 0, forum_need_moderation()); |
| 999 | cgi_redirectf("%R/forumpost/%S", rid_to_uuid(nrid)); |
| 1000 | return 1; |
| 1001 | } |
| 1002 | } |
| 1003 | |
| 1004 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -993,11 +993,13 @@ | |
| 993 | @ <pre>%h(blob_str(&x))</pre> |
| 994 | @ </div> |
| 995 | blob_reset(&x); |
| 996 | return 0; |
| 997 | }else{ |
| 998 | int nrid = wiki_put(&x, iEdit>0 ? iEdit : 0, |
| 999 | forum_need_moderation()); |
| 1000 | blob_reset(&x); |
| 1001 | cgi_redirectf("%R/forumpost/%S", rid_to_uuid(nrid)); |
| 1002 | return 1; |
| 1003 | } |
| 1004 | } |
| 1005 | |
| 1006 |
+1
-1
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -573,11 +573,11 @@ | ||
| 573 | 573 | */ |
| 574 | 574 | int wiki_put(Blob *pWiki, int parent, int needMod){ |
| 575 | 575 | int nrid; |
| 576 | 576 | if( !needMod ){ |
| 577 | 577 | nrid = content_put_ex(pWiki, 0, 0, 0, 0); |
| 578 | - if( parent) content_deltify(parent, &nrid, 1, 0); | |
| 578 | + if( parent ) content_deltify(parent, &nrid, 1, 0); | |
| 579 | 579 | }else{ |
| 580 | 580 | nrid = content_put_ex(pWiki, 0, 0, 0, 1); |
| 581 | 581 | moderation_table_create(); |
| 582 | 582 | db_multi_exec("INSERT INTO modreq(objid) VALUES(%d)", nrid); |
| 583 | 583 | } |
| 584 | 584 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -573,11 +573,11 @@ | |
| 573 | */ |
| 574 | int wiki_put(Blob *pWiki, int parent, int needMod){ |
| 575 | int nrid; |
| 576 | if( !needMod ){ |
| 577 | nrid = content_put_ex(pWiki, 0, 0, 0, 0); |
| 578 | if( parent) content_deltify(parent, &nrid, 1, 0); |
| 579 | }else{ |
| 580 | nrid = content_put_ex(pWiki, 0, 0, 0, 1); |
| 581 | moderation_table_create(); |
| 582 | db_multi_exec("INSERT INTO modreq(objid) VALUES(%d)", nrid); |
| 583 | } |
| 584 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -573,11 +573,11 @@ | |
| 573 | */ |
| 574 | int wiki_put(Blob *pWiki, int parent, int needMod){ |
| 575 | int nrid; |
| 576 | if( !needMod ){ |
| 577 | nrid = content_put_ex(pWiki, 0, 0, 0, 0); |
| 578 | if( parent ) content_deltify(parent, &nrid, 1, 0); |
| 579 | }else{ |
| 580 | nrid = content_put_ex(pWiki, 0, 0, 0, 1); |
| 581 | moderation_table_create(); |
| 582 | db_multi_exec("INSERT INTO modreq(objid) VALUES(%d)", nrid); |
| 583 | } |
| 584 |
+1
-1
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -573,11 +573,11 @@ | ||
| 573 | 573 | */ |
| 574 | 574 | int wiki_put(Blob *pWiki, int parent, int needMod){ |
| 575 | 575 | int nrid; |
| 576 | 576 | if( !needMod ){ |
| 577 | 577 | nrid = content_put_ex(pWiki, 0, 0, 0, 0); |
| 578 | - if( parent) content_deltify(parent, &nrid, 1, 0); | |
| 578 | + if( parent ) content_deltify(parent, &nrid, 1, 0); | |
| 579 | 579 | }else{ |
| 580 | 580 | nrid = content_put_ex(pWiki, 0, 0, 0, 1); |
| 581 | 581 | moderation_table_create(); |
| 582 | 582 | db_multi_exec("INSERT INTO modreq(objid) VALUES(%d)", nrid); |
| 583 | 583 | } |
| 584 | 584 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -573,11 +573,11 @@ | |
| 573 | */ |
| 574 | int wiki_put(Blob *pWiki, int parent, int needMod){ |
| 575 | int nrid; |
| 576 | if( !needMod ){ |
| 577 | nrid = content_put_ex(pWiki, 0, 0, 0, 0); |
| 578 | if( parent) content_deltify(parent, &nrid, 1, 0); |
| 579 | }else{ |
| 580 | nrid = content_put_ex(pWiki, 0, 0, 0, 1); |
| 581 | moderation_table_create(); |
| 582 | db_multi_exec("INSERT INTO modreq(objid) VALUES(%d)", nrid); |
| 583 | } |
| 584 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -573,11 +573,11 @@ | |
| 573 | */ |
| 574 | int wiki_put(Blob *pWiki, int parent, int needMod){ |
| 575 | int nrid; |
| 576 | if( !needMod ){ |
| 577 | nrid = content_put_ex(pWiki, 0, 0, 0, 0); |
| 578 | if( parent ) content_deltify(parent, &nrid, 1, 0); |
| 579 | }else{ |
| 580 | nrid = content_put_ex(pWiki, 0, 0, 0, 1); |
| 581 | moderation_table_create(); |
| 582 | db_multi_exec("INSERT INTO modreq(objid) VALUES(%d)", nrid); |
| 583 | } |
| 584 |
+1
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -4,10 +4,11 @@ | ||
| 4 | 4 | <h2>Changes for Version 2.12 (pending)</h2> |
| 5 | 5 | |
| 6 | 6 | * Added <tt>--reset</tt> flag to the "[/help?cmd=add|fossil add]", |
| 7 | 7 | "[/help?cmd=rm|fossil rm]", and |
| 8 | 8 | "[/help?cmd=addremove|fossil addremove]" commands. |
| 9 | + * Editing forum posts now applies delta compression to the edits. | |
| 9 | 10 | |
| 10 | 11 | <a name='v2_11'></a> |
| 11 | 12 | <h2>Changes for Version 2.11 (2020-05-25)</h2> |
| 12 | 13 | |
| 13 | 14 | * Support [/md_rules|Markdown] in the default ticket configuration. |
| 14 | 15 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -4,10 +4,11 @@ | |
| 4 | <h2>Changes for Version 2.12 (pending)</h2> |
| 5 | |
| 6 | * Added <tt>--reset</tt> flag to the "[/help?cmd=add|fossil add]", |
| 7 | "[/help?cmd=rm|fossil rm]", and |
| 8 | "[/help?cmd=addremove|fossil addremove]" commands. |
| 9 | |
| 10 | <a name='v2_11'></a> |
| 11 | <h2>Changes for Version 2.11 (2020-05-25)</h2> |
| 12 | |
| 13 | * Support [/md_rules|Markdown] in the default ticket configuration. |
| 14 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -4,10 +4,11 @@ | |
| 4 | <h2>Changes for Version 2.12 (pending)</h2> |
| 5 | |
| 6 | * Added <tt>--reset</tt> flag to the "[/help?cmd=add|fossil add]", |
| 7 | "[/help?cmd=rm|fossil rm]", and |
| 8 | "[/help?cmd=addremove|fossil addremove]" commands. |
| 9 | * Editing forum posts now applies delta compression to the edits. |
| 10 | |
| 11 | <a name='v2_11'></a> |
| 12 | <h2>Changes for Version 2.11 (2020-05-25)</h2> |
| 13 | |
| 14 | * Support [/md_rules|Markdown] in the default ticket configuration. |
| 15 |
+1
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -4,10 +4,11 @@ | ||
| 4 | 4 | <h2>Changes for Version 2.12 (pending)</h2> |
| 5 | 5 | |
| 6 | 6 | * Added <tt>--reset</tt> flag to the "[/help?cmd=add|fossil add]", |
| 7 | 7 | "[/help?cmd=rm|fossil rm]", and |
| 8 | 8 | "[/help?cmd=addremove|fossil addremove]" commands. |
| 9 | + * Editing forum posts now applies delta compression to the edits. | |
| 9 | 10 | |
| 10 | 11 | <a name='v2_11'></a> |
| 11 | 12 | <h2>Changes for Version 2.11 (2020-05-25)</h2> |
| 12 | 13 | |
| 13 | 14 | * Support [/md_rules|Markdown] in the default ticket configuration. |
| 14 | 15 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -4,10 +4,11 @@ | |
| 4 | <h2>Changes for Version 2.12 (pending)</h2> |
| 5 | |
| 6 | * Added <tt>--reset</tt> flag to the "[/help?cmd=add|fossil add]", |
| 7 | "[/help?cmd=rm|fossil rm]", and |
| 8 | "[/help?cmd=addremove|fossil addremove]" commands. |
| 9 | |
| 10 | <a name='v2_11'></a> |
| 11 | <h2>Changes for Version 2.11 (2020-05-25)</h2> |
| 12 | |
| 13 | * Support [/md_rules|Markdown] in the default ticket configuration. |
| 14 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -4,10 +4,11 @@ | |
| 4 | <h2>Changes for Version 2.12 (pending)</h2> |
| 5 | |
| 6 | * Added <tt>--reset</tt> flag to the "[/help?cmd=add|fossil add]", |
| 7 | "[/help?cmd=rm|fossil rm]", and |
| 8 | "[/help?cmd=addremove|fossil addremove]" commands. |
| 9 | * Editing forum posts now applies delta compression to the edits. |
| 10 | |
| 11 | <a name='v2_11'></a> |
| 12 | <h2>Changes for Version 2.11 (2020-05-25)</h2> |
| 13 | |
| 14 | * Support [/md_rules|Markdown] in the default ticket configuration. |
| 15 |