There's a better way to implement this. Much better, and already mostly done. My previous remarks about db load and such are wrong. There's a device called the "editor's history" that shows the history of changes by editors. I think we should make all edits show up on that history, and make it visible to all.

Cons: more db use, there's no way for editors to hide things without additional effort/code. Non-cons: no additional overhead per view. Very little new code to write. Editors can't hide things without additional effort/code (yes, that is both). (The pros are obvious. The non-cons above are more of non-issues -- things which may appear to be pros or cons, but are in fact no different from the current state.)

As to taking up more db space, the current implementation of this featuere is hugely innefficent. Each edit stores the complete pre/post state. The poststate is redundant -- it is the same as the prestate of the next edit, or in the case of the last edit, the current node (which has sepperate storage). Additionaly, for most edits, most of the content is unchanged. Storing a diff instead of the prestate would alleviate this, and diff -u is easy enough to process (if edits should be reversed), or simply read.

(There is a similar innefficency in the patch system, bu it isn't as bad, and is a less important system.)


Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).


In reply to Re: Storing node revision history by theorbtwo
in thread Storing node revision history by BUU

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.