[dokuwiki] Re: Fw: Dokuwiki patch - synchronize changelog
- From: Ben Coburn <btcoburn@xxxxxxxxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Mon, 23 Oct 2006 13:49:12 -0700
On Oct 23, 2006, at 12:48 PM, Andreas Gohr wrote:
On Sun, 22 Oct 2006 23:19:59 -0700
Ben Coburn <btcoburn@xxxxxxxxxxxxx> wrote:
Please carefully consider the "synchronize changelog, attic, and
external edits" patch. The patch resolves the changelog and attic
issues while maintaining the efficiency of the redesigned changelog
code. This is accomplished by using a small amount of extra disk
space to pre-save the current revision to the attic. By synchronizing
the attic and changelog, the patch is also able to automatically
generate changelog entries for external edits. I think the ability to
incorporate external edits into the changelog more than offsets the
extra disk space consumed by this approach. (This is also something
the current code can not do.) The behavior of this patch is best seen
on a running instance of Dokuwiki.
Before I apply this I want to make sure I (and others, hence
the reply to list) understand it.
As soon as a page edit is saved, you store a copy of it in the attic.
When an edit to this page is saved the next time, you check if an
attic file with the same timestamp as the current version exists. If it
does not exist, you know that the current version was not created
within DokuWiki and add a changelog entry for it.
There are two things going on in the first part:
1) The old revision is saved into the attic if it is missing. This
"catches up" the attic with the changelog. This is done as a transition
from the old logic (and to help with external edits, see #2).
2) The timestamp of the page is compared with the last saved changelog
line. If they do no match something must have edited the page since
that last dokuwiki edit. The changelog line is constructed (to match
the revision saved in #1) and the dokuwiki page saving logic continues
as normal.
Did I understand that correctly? Do others see any flaw in that logic?
One thing is that this could destroy the order in the changelog. Is
this an issue in the changelog parsing code?
This would only happen if something caused the page to have a
modification time in the past. I will update the patch so that this
kind of "bogus edit" is ignored and does not break the changelog line
order.
As you say your self this means usually each page is stored twice,
once in pages and once in attic. Should we maybe store a 0-byte version
in the attic instead?
No. The whole point is that when a page is edited outside dokuwiki the
current revision and page data are already correctly stored in the
attic. This is what the second save to the attic is for.
Regards, Ben Coburn
-------------------
silicodon.net
-------------------
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist
- Follow-Ups:
- [dokuwiki] Re: Fw: Dokuwiki patch - synchronize changelog
- From: Andreas Gohr
- References:
- [dokuwiki] Fw: Dokuwiki patch - synchronize changelog
- From: Andreas Gohr
Other related posts:
- » [dokuwiki] Fw: Dokuwiki patch - synchronize changelog
- » [dokuwiki] Re: Fw: Dokuwiki patch - synchronize changelog
- » [dokuwiki] Re: Fw: Dokuwiki patch - synchronize changelog
- » [dokuwiki] Re: Fw: Dokuwiki patch - synchronize changelog
- » [dokuwiki] Re: Fw: Dokuwiki patch - synchronize changelog
- » [dokuwiki] Re: Fw: Dokuwiki patch - synchronize changelog
On Oct 23, 2006, at 12:48 PM, Andreas Gohr wrote:
On Sun, 22 Oct 2006 23:19:59 -0700 Ben Coburn <btcoburn@xxxxxxxxxxxxx> wrote:
Please carefully consider the "synchronize changelog, attic, and external edits" patch. The patch resolves the changelog and attic issues while maintaining the efficiency of the redesigned changelog code. This is accomplished by using a small amount of extra disk space to pre-save the current revision to the attic. By synchronizing the attic and changelog, the patch is also able to automatically generate changelog entries for external edits. I think the ability to incorporate external edits into the changelog more than offsets the extra disk space consumed by this approach. (This is also something the current code can not do.) The behavior of this patch is best seen on a running instance of Dokuwiki.
Before I apply this I want to make sure I (and others, hence the reply to list) understand it.
As soon as a page edit is saved, you store a copy of it in the attic. When an edit to this page is saved the next time, you check if an attic file with the same timestamp as the current version exists. If it does not exist, you know that the current version was not created within DokuWiki and add a changelog entry for it.
There are two things going on in the first part:
Did I understand that correctly? Do others see any flaw in that logic?
One thing is that this could destroy the order in the changelog. Is this an issue in the changelog parsing code?
As you say your self this means usually each page is stored twice, once in pages and once in attic. Should we maybe store a 0-byte version in the attic instead?
------------------- silicodon.net -------------------
- [dokuwiki] Re: Fw: Dokuwiki patch - synchronize changelog
- From: Andreas Gohr
- [dokuwiki] Fw: Dokuwiki patch - synchronize changelog
- From: Andreas Gohr