Diffs Code Module in progress

Page deleted - discussion not relevant to this forum


Pity there isn't a diffs code module so we could see what was censored;-)


KBK Please, can both of you try to keep this civilised? Robert - The material is indeed available in the history, at [L1 ]. There's a rudimentary diff functionality there, and more could be added fairly easily.

The Python code was not, alas, terribly useful, because, you see, the underlying algorithm has already been implemented in Tcl; there's a rough draft over at diff in Tcl and a more finished version in tcllib. Given this implementation, the Python sequence comparison is simply not very informative. I don't see MR's action as disagree by deleting but rather removing redundancy. (And I don't insist you agree.) Incidentally, jcw is well aware that diff in Tcl is there - we've exchanged email about it, and discussed it at the 2002 Tcl conference in Vancouver.

In any case, if you actually trouble to read what jcw has written on the subject, you'll learn that the priblem is not one of implementing the comparator, but rather an issue with the internal file structure. This Wiki, as implemented, does not maintain a change history itself; rather, modified files are checked into an external CVS repository - by an external program - on a periodic basis. The comparisons that we have, including wikidiff and http://mini.net/tclhist/ work off either this external repository or off some other external files.

There are advantages to this approach. One key one is that it's possible to take a complete snapshot of this Wiki as a single executable file and burn it on a CD-ROM. It comes up as a fully-functional local browser - GUI and all - and can be used off line. In fact, it's been included on the CD-ROM in the proceedings of the last two Tcl conferences. With full history, it's a trifle heavyweight for that approach to work.

The problem could be addressed by placing the change history in a separate place within the Wikit virtual file system, or by giving Wikit the ability to work with an external repository. The question arises whether the advantages to be gained are worth the programmer time spent. This Wiki, and Tcl as a whole, are maintained by a very small community, and we tend to choose our priorities carefully. In particular, we spend a lot more time preparing information to put here than we do on managing fancy features of the Wiki itself - "ugly but serviceable" suits us fine.

Now, if you want to download Wikit and have a whirl at implementing the functionality, I'm certain that jcw would be delighted. Please remember though, that actually getting the implementation complete is only half the work of actually incorporating a change. Don't expect immediate service. In general, using foul language and harrassing the developers serves only to get you ignored. The general principle at work is, "you catch more flies with honey than vinegar."


If anyone is interested, I have a port of wikidiff into wikit at [L2 ]. I have had it running for over a year now, sorry for not contributing sooner ;-).

It still uses diff/patch from the filesystem, either the standard unix ones or cygwin versions, it should be easily changed to tcllib/diff (does it have patch too?).

There are some bugs in the display code, but it *does* store the history in a chain of diffs either in wikit.tkd or a separate history.tkd flawlessly.

 Usage:

 tclkit wikit-hist.kit my-wikit.tkd -history internal

 or 

 tclkit wikit-hist.kit my-wikit.tkd -history /somewhere/history.tkd

Hope this helps.

-- PS

Update

To access the revision history, you need to run it as a CGI (no internal httpd in this version), you will find that the 'Updated on somedate' at the bottom of each wiki page is now augmented with a revision X link, click on that and you can get at the diffs. And you also need to set WIKIT_CSS=http://pascal.scheffers.net/pascal.css in your wiki.cgi file to have the colours in the diff show.


GJS Every time i try to save a page for the first time i get an error. I set debug to -on in the cgi module and here is the error that i got.

   couldn't open "/tmp/wikitdiff.1272.old": no such file or directory
       while executing
   "open "/tmp/wikitdiff.[pid].old" w"
       (procedure "Wikit::doDiff" line 3)
       invoked from within
   "Wikit::doDiff $newpage $oldpage"
       (procedure "AddDiffEntry" line 5)
       invoked from within
   "AddDiffEntry $id $oldpage $text $olddate $oldwho $revision"
       (procedure "SavePage" line 57)
       invoked from within
   "SavePage $N $C $host $name"

Does anyone know a way to fix this? I am currently using Windows XP Pro with Apache 2.0.


Category Wikit