Bug: Using RCS subdirectory fails to work properly
I am using the
RCS directory and I have set $useRcsDir = 1 in my TWiki.cfg. I expect
I will get some speed improvements since there are fewer files for readdir to go through
on accesses for topic retrievals, edits and searches.
After editing a page whose
RCS file lives in
RCS/, I see the metadata reporting version 1.1,
There are no diffs/versions except for version 1.1. The topic's rcs file is properly updated
though. Logging into the system and running rlog or rcsdiff manually on the original .txt file
works properly.
I don't see any errors in the http error logs from rcs. Moving the ,v file back to the main directory
makes things work properly again.
Now I do have some pages in the top level (the default ones that come with TWiki so I can stay in sync
with the releases), but I think I have narrowed down the problem, but I have no clue where to go from here.
I was hoping to go live with my new site Monday, but this is a showstopper. I would rather not go
back to putting all the files into one directory if I can help it.
It appears that Store::RcsFile::_settings is trying to determine if we should use
RCS directories
by looking into the %settings has for the key "useRcsDir". However, this key doesn't seem to be getting set.
Other keys such as "dataDir" and "pubDir" are being set. I haven't figured out where in the code this key
should be created. If anybody can narrow down the code a bit, I would appreciate it.
Also it looks like the Store::RcsFile::_makeFileName function doesn't check to see if the file
exists before it returns the ,v filename. Since
RCS files can exist in two places, same directory
or
RCS subdirectory, rcs will search both (with the
RCS directory preferred I think) and work fine.
However I suspect that split installations with files being stored in both possible directories will
have the issues describe above with the non
RCS directory ,v files once this bug is fixed.
Maybe a warning note in the documentation that ,v files must be located in only one directory for twiki to
work properly.
Test case
Enable $useRcsDir. Put your ,v file for a topic into the
RCS subdirectory. Edit the topic. You will
see the problem.
Environment
| TWiki version: |
Current Alpha |
| TWiki plugins: |
many |
| Server OS: |
Linux RH 7.2 |
| Web server: |
Apache 1.3.2 |
| Perl version: |
5.6.1 |
| Client OS: |
Any |
| Web Browser: |
Any |
--
JohnRouillard - 15 Aug 2002
Follow up
The bug is in TWiki.cfg in the
@storeSettings
array. This patch fixes it for
RCS
files in the
RCS subdirectory, but then break
RCS files in the parent directory as
I mentioned above. To work around this breakage, the following item from the
ci
man page comes to the rescue:
ci never changes an RCS or working file. Normally, ci
unlinks the file and creates a new one; but instead of
breaking a chain of one or more symbolic links to an RCS
file, it unlinks the destination file instead. Therefore,
ci breaks any hard or symbolic links to any working file
it changes; and hard links to RCS files are ineffective,
but symbolic links to RCS files are preserved.
So to fix it for the ,v files in the base $dataDir/$web, create a symbolic link
in the
RCS directory to the ,v file in the parent.
This could be fixed by changing _makeFileName to always check for file existence,
but this requires a stat for every access. This will really slow down cygwin, and
the symbolic link trick works for cygwin
ci as well. I just don't know how it
will work for direct access from a non-cygwin server such as a native apache.
My guess is that it will break, probably worse than above.
Another possible fix is to have a failure to find the ,v file force a stat of both
places and possible updating of the rcs filename, but this would require internal
changes to the code.
This patch and links work fine in my testing and allows me to
cvs update the
installed twiki to merge changes in from the twiki releases.
Index: TWiki.cfg
===================================================================
RCS file: /twiki/src/cvsroot/twiki/lib/TWiki.cfg,v
retrieving revision 1.7
diff -c -r1.7 TWiki.cfg
*** TWiki.cfg 8 Aug 2002 18:37:57 -0000 1.7
--- TWiki.cfg 15 Aug 2002 19:11:16 -0000
***************
*** 195,200 ****
--- 195,201 ----
@storeSettings =
( dataDir => $TWiki::dataDir,
pubDir => $TWiki::pubDir,
+ useRcsDir => $TWiki::useRcsDir,
attachAsciiPath => "\.(txt|html|xml|pl)\$",
dirPermission => 0775,
--
JohnRouillard - 15 Aug 2002
Fix record
This is now fixed and in
TWikiAlphaRelease. See also duplicate
DiffsRevertsToOneError. Please reopen this bug in case there are other
RCS dir related issues.
--
PeterThoeny - 02 Sep 2003