Fossil SCM

Editing forum posts now applies delta compression to the edits.

stephan 2020-05-28 08:55 trunk merge
Commit 5b7888c9940aed49a52e506d9d362d604bc17314bf384e536cdf4d0904947949
+1 -1
--- src/content.c
+++ src/content.c
@@ -805,11 +805,11 @@
805805
** artifact. Otherwise, when we go to send the public artifact on a
806806
** sync operation, the other end of the sync will never be able to receive
807807
** the source of the delta. It is OK to delta private->private and
808808
** public->private and public->public. Just no private->public delta.
809809
**
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
811811
** converted to undeltaed text before the aSrc[bestSrc]->rid delta is
812812
** created, in order to prevent a delta loop.
813813
**
814814
** If either rid or aSrc[i] contain less than 50 bytes, or if the
815815
** resulting delta does not achieve a compression of at least 25%
816816
--- 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 @@
993993
@ <pre>%h(blob_str(&x))</pre>
994994
@ </div>
995995
blob_reset(&x);
996996
return 0;
997997
}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);
9991001
cgi_redirectf("%R/forumpost/%S", rid_to_uuid(nrid));
10001002
return 1;
10011003
}
10021004
}
10031005
10041006
--- 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 @@
573573
*/
574574
int wiki_put(Blob *pWiki, int parent, int needMod){
575575
int nrid;
576576
if( !needMod ){
577577
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);
579579
}else{
580580
nrid = content_put_ex(pWiki, 0, 0, 0, 1);
581581
moderation_table_create();
582582
db_multi_exec("INSERT INTO modreq(objid) VALUES(%d)", nrid);
583583
}
584584
--- 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 @@
573573
*/
574574
int wiki_put(Blob *pWiki, int parent, int needMod){
575575
int nrid;
576576
if( !needMod ){
577577
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);
579579
}else{
580580
nrid = content_put_ex(pWiki, 0, 0, 0, 1);
581581
moderation_table_create();
582582
db_multi_exec("INSERT INTO modreq(objid) VALUES(%d)", nrid);
583583
}
584584
--- 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
--- www/changes.wiki
+++ www/changes.wiki
@@ -4,10 +4,11 @@
44
<h2>Changes for Version 2.12 (pending)</h2>
55
66
* Added <tt>--reset</tt> flag to the "[/help?cmd=add|fossil add]",
77
"[/help?cmd=rm|fossil rm]", and
88
"[/help?cmd=addremove|fossil addremove]" commands.
9
+ * Editing forum posts now applies delta compression to the edits.
910
1011
<a name='v2_11'></a>
1112
<h2>Changes for Version 2.11 (2020-05-25)</h2>
1213
1314
* Support [/md_rules|Markdown] in the default ticket configuration.
1415
--- 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
--- www/changes.wiki
+++ www/changes.wiki
@@ -4,10 +4,11 @@
44
<h2>Changes for Version 2.12 (pending)</h2>
55
66
* Added <tt>--reset</tt> flag to the "[/help?cmd=add|fossil add]",
77
"[/help?cmd=rm|fossil rm]", and
88
"[/help?cmd=addremove|fossil addremove]" commands.
9
+ * Editing forum posts now applies delta compression to the edits.
910
1011
<a name='v2_11'></a>
1112
<h2>Changes for Version 2.11 (2020-05-25)</h2>
1213
1314
* Support [/md_rules|Markdown] in the default ticket configuration.
1415
--- 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

Keyboard Shortcuts

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