(download_tarball): Throw a 403 Forbidden area if a tarball request
is for a forbidden module. Patch by Olaf Hering <olh@suse.de>.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1065 8cb11bc2-c004-0410-86c3-e597b4017df7
Also protect pointers with auto_ptr to ensure cleanup.
Note: Before this change exceptions *could* occur, but all pointer-referenced
memory would be leaked.
* tparse/tparse.h: Change #include-s to C++ names.
(RCSParseError): Change to be a public descendant of exception. Use
string datatype to ensure automatic cleanup. Implement a destructor
as required by exception.
(RCSExpected): Use string datatype to ensure automatic cleanup. Add
constructor for expected characters.
(Branche): Removed. Replaced with std::list<>.
(Sink): Change method definition to reflect switch to exceptions.
(TokenParser::match): Add method for matching characters.
(TokenParser::semicol, TokenParser::matchsemicol): Removed.
Obsolete because we're now able to match single characters.
(tparseParser): Change method definition to reflect the switch
to exceptions.
(tparseParser::parse): Adapt to changed method definitions.
* tparse/tparse.cpp: Change #include-s to C++ names.
(TokenParser::get): Space changes and conversion to auto_ptr.
(tparseParser::parse_rcs_admin,
tparseParser::parse_rcs_description,
tparseParser::parse_rcs_deltatext): Conversion to auto_ptr and exceptions.
(tparseParser::parse_rcs_tree): Conversion to auto_ptr and exceptions. Also
adjust for removal of Branche class.
* tparse/tparsemodule.h: Include Python.h, since
we,re actually using python types.
* tparse/tparsemodule.cpp (pyobject, pystring):
New classes. Used to anchor python objects ensuring their refcounts
are decremented.
(chkpy): New. Function to check python return value and act appropriately.
(initparse): Correctly anchor python strings.
(rcstoken_to_pystring): Removed. Now integrated into the pystring class.
(PythonSink): Claim ownership for the duration of the instance lifetime.
Also adjust all methods for the switch to exceptions.
(tparse): Adapt to the switch to exceptions. Also prevent memory leakage
when an exception occurs.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1060 8cb11bc2-c004-0410-86c3-e597b4017df7
binary files).
At the same time reduce processing time by ~50% (in my measurements).
* tparse/tparse.h: Remove deprecated (and now unused) strstream header.
(rcstoken): New class. Used to hold parser output.
(Branche, Sink, TokenParser): Use rcstoken class whereever char* was
used for holding parser output.
* tparse/tparse.cpp (rcstoken::init, rcstoken::append,
rcstoken::grow,rcstoken::copy_begin_end, rcstoken::copy_begin_len): New.
(TokenParser::get): Change return type to rcstoken and adapt accordingly.
(TokenParser::unget): Change argument type.
(tparseParser::parse_rcs_admin,tparseParser::parse_rcs_tree,
tparseParser::parse_rcs_description,
tparseParser::parse_rcs_deltatext): Adjust to use rcstoken class.
* tparse/tparsemodule.cpp (rcstoken_to_pystring): New. Helper function
to do token to python string transformation.
(PythonSink): Adjust all methods to use the rcstoken class.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1059 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/viewcvs.py
(raw_diff): Rootpath only shows up in Subversion diffs, not CVS. So
look for headers in a slightly less demanding way, replacing the
rootpath if it appears, but certainly not caching the whole diff
in memory if it doesn't.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1056 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/viewcvs.py
(view_diff): Little comment fix.
* lib/vclib/svn_ra/__init__.py
(ChangedPath): Remove; use the one from vclib.svn.
* lib/ezt.py
Update to latest upstream version, but reapply "the LongType fix".
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1054 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/vclib/svn_ra/__init__.py
(_datestr_to_date): Remove, and pull in the one from vclib.svn instead.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1053 8cb11bc2-c004-0410-86c3-e597b4017df7
While this would appear to fix the problems Aaron Craven
<viewcvs@vickerscraven.net> has been seeing with respect to HTML
escaping levels of diff output, this is a fluke. A real problem (not
addressed here) is that raw_diff() is that basically, any time
raw_diff() is called with 'parseheader' set, it is treating the whole
diff output as headers (the early outs aren't firing). This is
broken, and rather defeats the point of attempting streamy diffs since
we're collecting the whole thing into an array in memory.
* lib/viewcvs.py
(raw_diff): Don't forget to htmlize() headers if so requested.
(view_diff): Use 'unidiff' as the diff format choice if asked to
make a patch for 'side-by-side' mode. 'Unidiff' and 'context
diff' are the only valid patch formats, as far as we are
concerned. Also, fix a little comment typo. Finally, revert my
previous change, where I added an extra MarkupPipeWrapper around
the file object returned from raw_diff() -- this was bogus, as
raw_diff() should have been htmlifying stuff anyway.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1052 8cb11bc2-c004-0410-86c3-e597b4017df7
htmlize()'d. Reported (with patience, thankfully) by Aaron Craven
<viewcvs@vickerscraven.net>
* lib/viewcvs.py
(view_diff): Wrap the raw diff FP object with an htmlize()ing class.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1051 8cb11bc2-c004-0410-86c3-e597b4017df7
supports logs on directories, too, ya know). And make some other
little documentation changes.
* viewcvs/lib/vclib/__init__.py
(Repository.itemlog): Was Repository.filelog().
(Revision.__init__): Document the input parameters.
* viewcvs/lib/vclib/bincvs/__init__.py
(BinCVSRepository.itemlog): Was BinCVSRepository.filelog().
* viewcvs/lib/vclib/ccvs/__init__.py
(CCVSRepository.itemlog): Was CCVSRepository.filelog().
* viewcvs/lib/vclib/svn/__init__.py
(SubversionRepository.itemlog): Was SubversionRepository.filelog().
* viewcvs/lib/vclib/svn_ra/__init__.py
(SubversionRepository.itemlog): Was SubversionRepository.filelog().
* viewcvs/lib/viewcvs.py
(view_markup, view_log): Update calls to Repository.itemlog() (from
Repository.filelog()).
* viewcvs/lib/cvsdb.py
(GetCommitListFromRCSFile): Update calls to Repository.itemlog()
(from Repository.filelog()).
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1050 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/blame.py
(CVSParser.is_branch): Tighten up regular expression with '^'/'$'.
Revisions like "11.0.2.2.0.1" were matching not with groups
"11.0.2.2" and "1", but with "11" and "2.2.0.1".
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1049 8cb11bc2-c004-0410-86c3-e597b4017df7
(view_log): Fix a bug where use of the diff form via branch
selection resulted in a log view instead of a diff view. Reported
by Amy Langenhorst <arl@noaa.gov>.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1048 8cb11bc2-c004-0410-86c3-e597b4017df7
grouping directories in the directory view. Now, make that behavior
optional (though, the default), but also fix it so that the directory
group itself is internally sorted by the current sort key. This more
accurately mimics the likes of the Windows Explorer.
* viewcvs/viewcvs.conf.dist
(sort_group_dirs): New option.
* viewcvs/lib/config.py
(Config.set_defaults): Set default value for sort_group_dirs.
* viewcvs/lib/viewcvs.py
(file_sort_cmp): If grouping directories, sorts dirs higher than
files. Otherwise, use normal sorting rules.
* viewcvs/website/upgrading.html
Note the new option.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1047 8cb11bc2-c004-0410-86c3-e597b4017df7
* templates/docroot/images/cvsgraph_16x16.png
* templates/docroot/images/cvsgraph_32x32.png
More PNG background fixes from Jordan Russell <jr-list-2005@quo.to>.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1046 8cb11bc2-c004-0410-86c3-e597b4017df7
PNG files to have white backgrounds so that wussie browsers that don't
support PNG transparency (like Internet Explorer) can deal with them.
* templates/docroot/images/back_small.png
* templates/docroot/images/logo.png
* templates/docroot/images/text.png
Tweaked.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1045 8cb11bc2-c004-0410-86c3-e597b4017df7
directory view. This is pretty common request, the most recent by
Sergio Rua <srua@plus.net>.
* viewcvs/lib/vclib/svn_ra/__init__.py
(get_youngest_revision): New.
* viewcvs/lib/vclib/svn/__init__.py
(get_youngest_revision): New.
* viewcvs/lib/viewcvs.py
(view_directory): Re-organize some data dictionary stuffing (I
really wish that *all* data dictionary parameters were initialized
at the head of each view function so we can see a canonical list
of those params, but maybe another day...). Also, for 'svn'
roottypes, populate a new 'youngest_rev' and 'youngest_rev_href'
dictionary items.
* viewcvs/website/upgrading.html
Document the new 'youngest_rev' and 'youngest_rev_href' template keys.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1044 8cb11bc2-c004-0410-86c3-e597b4017df7
This template was on crack. The absence of a revision log was
enough to turn of the display of almost all of the other interesting
data, and turn on the display of data that was in one half redundant,
and in the other half non-existant. Good Lord...
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1043 8cb11bc2-c004-0410-86c3-e597b4017df7
(enscript_extensions): Add '.cs', '.bas', and '.cls' extensions,
mapping to 'csharp', 'vba', and 'vba', respectivelyly, at the
request of Bo Berglund <bo.berglund@telia.com> and Hern��n Mart��nez
Foffani <hernan@orgmf.com.ar>.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1042 8cb11bc2-c004-0410-86c3-e597b4017df7
* tparse/tparsemodule.cpp: Stop freeing parameters passed into the sink.
* tparse/tparse.cpp: Dispose of allocated memory after use.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1040 8cb11bc2-c004-0410-86c3-e597b4017df7
vtable structure), update the ViewCVS 'svn_ra' module to use it. This
module now almost has total functional parity with the 'svn' module.
* viewcvs/lib/vclib/svn_ra/__init__.py
Import the svn.ra module.
(date_from_rev, created_rev): Actually flesh out these functions
using the new RA capabilities.
(LastHistoryCollector.add_history): Remove leading slashes from
paths used to make ChangedPath items.
(either_binary): Leave a TODO, with some optimization ideas.
(SubversionRepository.__init__): Use the RA interface to fetch the
youngest revision instead of a really kludgy (and more expensive)
algorithm based on dirents.
(FileDiff.get_files, SubversionRepository.openfile): Fixup the use
of streams.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1038 8cb11bc2-c004-0410-86c3-e597b4017df7
checkout_magic is disabled by changing the default view for file URLs from
"log" to "checkout"
This causes some URL compatibility to be lost when checkout_magic is disabled.
Bookmarks which pointed to log pages but don't have explicit view=log
parameters will point to checkout pages instead.
* lib/viewcvs.py
(Request.run_viewcvs):
change default view for files from "log" to "checkout" when checkout_magic
is disabled
(Request.get_link):
don't add explicit view=checkout parameters for checkout links when
checkout_magic is disabled
don't drop explicit view=log parameters for log links
* website/upgrading.html
add note about URL compatibility
* INSTALL
update section on access control
* viewcvs.conf.dist
update documentation for "root_as_url_component" and "checkout_magic"
move "checkout_magic" option directly underneath "root_as_url" component
because the two options are related
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1037 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/viewcvs.py
(view_directory):
add new row.viewable attribute so it is possible to tell whether a file
link goes to a checkout or markup page
* templates/directory.ezt:
add title attributes
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1036 8cb11bc2-c004-0410-86c3-e597b4017df7
* tparse/tparse.h (tparseParser::tparseParser, tparseParser::parse):
Split the actual parsing out of the constructor, into a parse() function.
* tparse/tparsemodule.cpp (PythonException): Move earlier in the file.
(tparse): Call tparseParser::parse(). Do not INCREF and then DECREF the
parameters - our caller must by definition be holding a reference in order
to pass the objects in, and we are finished with them before we return.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1035 8cb11bc2-c004-0410-86c3-e597b4017df7
big std::string-izing patch, and also toss some code I noticed was unused.
* tparse/tparse.cpp
(Whitespace, Token_term, TokenParser::unget, tparseParser::parse_rcs_tree):
Whitespace adjustments.
* tparse/tparsemodule.cpp (tparse): Whitespace adjustments.
* tparse/tparse.h (RCSParseError.getvalue, RCSExpected.getvalue):
Remove some unused code, which includes one use case of the deprecated
ostrstream class.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1034 8cb11bc2-c004-0410-86c3-e597b4017df7
* tparse/tparse.h: #include <strstream>, not <strstream.h>,
and add "using namespace std;".
* tparse/tparsemodule.cpp: Do not #include <stdiostream.h>.
If a version of GNU C++ with the stdio_filebuf extension to the STL is
detected, then use it to allow the passing of a filehandle from Python
to the parser. Otherwise, throw a NotImplementedError when a filehandle
is passed.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1033 8cb11bc2-c004-0410-86c3-e597b4017df7
(enscript_extensions): Add '.f90' as an extension mapping to
'fortran'. Suggestion by Ed Zaron <ezaron@coas.oregonstate.edu>.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1032 8cb11bc2-c004-0410-86c3-e597b4017df7
of "template sets."
I'm introducing a new configuration variable ('template_dir') which is
the parent directory of all ViewCVS templates. Those templates have
names which match the views they describe (directory.ezt,
revision.ezt, graph.ezt, etc.). The 'docroot' variable will now
default to "<template_dir>/docroot". Finally, the [templates] section
will continue to work as before, save that all configuration therein
(and templates not configured will fallback to
"<template_dir>/<view_name>.ezt").
The beauty of this is that folks can start whipping up (and
maintaining themselves) ViewCVS template sets which can be traded and
shared, like themes for Mozilla or Windows XP. EZT is super-powerful,
and there are some really fun things you can do with it to serve up
interesting and unique ViewCVS views. But while we want to encourage
creativity and innovation, we don't want the ViewCVS project itself
having to maintain everyone's fun little themes. Anyway, so now
installing a new template set is just a matter of dropping that set
directory somewhere (anywhere, really) on your system and pointing
'template_dir' to that directory tree. No (very annoying) template
modification conflicts to deal with every time you update ViewCVS on
your system.
And the best part is that existing ViewCVS configurations should all
continue to work compatibly.
* viewcvs/viewcvs.conf.dist
Add a new option, "template_dir". Tweak documentation on the
"docroot" option. And make the whole [templates] section work a
little differently.
* viewcvs/lib/config.py
(Config.set_defaults): Use 'None' as the default value for the
self.templates.directory, self.templates.log,
self.templates.query, self.templates.diff, self.templates.graph,
self.templates.annotate, self.templates.markup,
self.templates.error, self.templates.query_form,
self.templates.query_results, and self.templates.roots options.
Add a new default value for self.options.template_dir.
* viewcvs/lib/viewcvs.py
(get_view_template): New.
(generate_page): Instead of taking a template name, take a view
name. Also, call get_view_template() to generate the full
template path.
(view_markup, view_roots, view_directory, view_log, view_annotate,
view_cvsgraph, view_diff, view_revision_svn, view_queryform,
view_queryform, view_error): Update calls to generate_page().
* viewcvs/lib/query.py
(main): Use viewcvs.get_view_template().
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1029 8cb11bc2-c004-0410-86c3-e597b4017df7
easier to change the default view.
* lib/viewcvs.py
(Request.run_viewcvs):
move code that handles the magic markup mimetype.
remove unneccessary special case code for log pages with revisions
selected for diffs
(Request.get_link):
consolidate code that determines whether to skip sticky variables
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1028 8cb11bc2-c004-0410-86c3-e597b4017df7
* INSTALL
update cvsgraph revision number and cgi directory path
* CHANGES
mention "root_as_url_component" and fix the way a date is formatted
* website/upgrading.html
fix stutter
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1027 8cb11bc2-c004-0410-86c3-e597b4017df7
view because I'm not really sure where they would fit best in the UI.
So for now, the view is only visible when viewcvs.cgi is loaded
with no trailing path in the URL and either root_as_url mode is
enabled or default_root is not set.
* lib/viewcvs.py
(Request.run_viewcvs, Request.get_link, nav_path, common_template_data,
_views):
add support for new view
(view_roots):
new function
* lib/config.py
(Config.set_defaults):
set default templates.roots option
* templates/roots.ezt
new template
* viewcvs.conf.dist
(templates/roots):
new option
(general/default_root, options/root_as_url_component):
update documentation
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1023 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/blame.py
(BlameSource.__init__):
set "revision" member to revision being annotated
* lib/viewcvs.py
(view_annotate):
use "revision" member
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1021 8cb11bc2-c004-0410-86c3-e597b4017df7
* standalone.py
(ViewCVS_Handler.run_viewcvs):
don't duplicate file descriptors inside an assert, asserts shouldn't
be used to handle runtime errors, only to detect logic errors, and
anyway, the code needs to run with asserts disabled
call dup2() instead of dup() to explicitly set the standard out,
instead of just hoping that the standard out is the first available
descriptor
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1019 8cb11bc2-c004-0410-86c3-e597b4017df7