Make it easier for folks to show/hide binary file contents in the
markup/annotate views.
* templates/file.ezt
Add some customizable template logic to hide the contents of file's with
non-human-readable file formats. Were Greg Stein dead, he'd be rolling
over in his grave right now.
Also:
* CHANGES
Note this change.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2229 8cb11bc2-c004-0410-86c3-e597b4017df7
Fix issue #422: syntax coloration dropping initial blank lines from
files.
* lib/viewvc.py
(markup_stream_pygments): Pass stripnl=False to Pygments lexers so
they won't strip out leading blank lines from the files they are
colorizing.
Also:
* CHANGES
Note this change.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2224 8cb11bc2-c004-0410-86c3-e597b4017df7
Try to avoid content spoofing errors. Prior to this change, a URL
like this:
http://localhost/viewvc/subversion/?view=foo%22)%20was%20passed\
%20as%20a%20parameter.20%20Visit%20http://www.baddy.com%20to%20\
figure%20out%20why%20(%22foo
Would result in an error page that read as follows:
An illegal value ("foo") was passed as a parameter. Visit
http://www.baddy.com to figure out why ("foo") was passed as a
parameter.
(where "http://www.baddy.com" was linkified, and could potentially
point to a malicious website.)
With this change, we will avoid printing unknown parameter names, and
will show the parameter name rather its value when a bogus value is
detected. Yes, there's admittedly some information loss here that
might be useful to the well-meaning but fat-fingered user, but the
security aspect is more important.
* lib/viewvc.py
(_validate_param): Don't print illegal parameter names, and show the
(legal) parameter name rather than its value when that value is
illegal.
Also:
* CHANGES
Note this change.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2218 8cb11bc2-c004-0410-86c3-e597b4017df7
might have read as follows:
* lib/viewvc.py
(_validate_view, _validate_mimetype): New validation functions.
(_re_validate_mimetype): Removed as unused.
(_legal_params): Tweak the validation routines for 'view' and
'content-type' to point to _validate_view() and _validate_mimetype(),
respectively.
(_validate_param): Now check for non-zero result from validation
functions as the "valid" indicator, rather than requiring each of
them to raise an exception in troubled times.
(Request.run_viewvc): Use an intermediate variable to simplify some
logic around input parameter validation. Move the logic that maps
view=rev to view=revision into the parameter validation loop.
Lose now-unnecessary validation of 'content-type' parameter -- the
normal parameter validation stuff should catch problems there.
Also:
* CHANGES
Record the relevant bits of these changes.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2215 8cb11bc2-c004-0410-86c3-e597b4017df7
* conf/viewvc.conf.dist
Comment out all the options here, forcing folks to uncomment the
stuff they want to modify. This allows the parsing of this file to
be optimized toward doing less work, while maintaining a consistent
initial presentation.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2208 8cb11bc2-c004-0410-86c3-e597b4017df7
Finish issue #415 - ModPythonServer shouldn't call sys.exit().
(This doesn't really fix anything, and hopefully doesn't break anything
either, but is merely a "good programming practice" cleanup item.)
* lib/viewvc.py
(Request.run_viewvc): Ensure that server.redirect() is the last
thing this function does (when it does it).
* lib/sapi.py
(CgiServer.redirect): Avoid calling sys.exit(). Also, fix a use of
print() that should be sys.stdout.write() (for consistency).
(AspServer.redirect, ModPythonServer.redirect): Avoid calling sys.exit().
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2206 8cb11bc2-c004-0410-86c3-e597b4017df7
Tighten up some input validation.
* lib/viewvc.py
(_re_validate_boolint): New.
(_legal_params): Switch the validation function to _re_validate_boolint
for the following: 'hideattic', 'makeimage', 'parent', 'tarball',
and 'hidecvsroot'.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2200 8cb11bc2-c004-0410-86c3-e597b4017df7
read like so:
Finish issue #420 - "cvsdbadmin rebuild" and "svndbadmin rebuild"
complain about unknown repositories.
* lib/cvsdb.py
(UnknownRepositoryError, DatabaseVersionError): New Exception classes.
(CheckinDatabase.Connect): Raise DatabaseVersionError instead of a
generic Exception.
(CheckinDatabase.PurgeRepository): Raise UnknownRepositoryError
instead of a generic Exception.
* bin/svndbadmin
(main): When rebuilding, ignore the UnknownRepositoryError; when
purging, turn that sucker into something readable.
* bin/cvsdbadmin
(__main__): When rebuilding, ignore the UnknownRepositoryError; when
purging, turn that sucker into something readable.
Also:
* CHANGES
Record this change.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2196 8cb11bc2-c004-0410-86c3-e597b4017df7
Finish issue #419: svnauthz module doesn't match Subversion's
case-handling semantics.
* conf/viewvc.conf.dist
(force_username_case): New option.
* lib/vcauth/svnauthz/__init__.py
(ViewVCAuthorizer.__init__): Find and handle new force_username_case
authorizer option.
(ViewVCAuthorizer._get_paths_for_root): Replace ConfigParser.optionxform()
(which does normalization of option names) with an identity function
of sorts.
Additionally:
* CHANGES
Record this change.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2193 8cb11bc2-c004-0410-86c3-e597b4017df7
Fix issue #400: Allow ViewVC to (optionally) use the 'chardet' module
during syntax coloration to perform character encoding detection (and
subsequent translation to UTF-8).
* conf/viewvc.conf.dist
(options.detect_encoding): New.
* lib/config.py
(Config.set_defaults): Initialize the 'detect_encoding' parameter.
* lib/viewvc.py
(markup_stream_pygments): If the configuration asks for character
encoding detection, try to import the 'chardet' module and -- if all
goes well -- tell Pygments to use it.
* CHANGES
Note this change.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2188 8cb11bc2-c004-0410-86c3-e597b4017df7
* templates/file.ezt
Use "Contents of /path/to/file" instead of "Annotate of /path/to/file" as
the page title.
Also:
* CHANGES
Record this change.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2182 8cb11bc2-c004-0410-86c3-e597b4017df7
Fix issue #417 - "cvsdbadmin rebuild" fails to record some of the
commit/repository info.
* lib/cvsdb.py
(CheckinDatabase.PurgeRepository): Clear all the ID caches after
running a purge operation so that, if the purge is actually part
of a rebuild, the subsequent update doesn't merely pull IDs from
the cache (with the side-effect of not readding them to the database).
Reported by: Naran Babhu <naranbabhu{_AT_}tigris.org
Martin Dessureault <martin{_AT_}austin.rr.com>
...and r2179, which went like so:
* lib/cvsdb.py
(CheckinDatabase.PurgeRepository): Don't allow the purge operation
to actually *create* a "repositories" table entry.
And while we're at it:
* CHANGES
Record these changes.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2180 8cb11bc2-c004-0410-86c3-e597b4017df7
Fix issue #416 - Can't see query form due to missing template variables.
* lib/viewvc.py
(view_queryform): Add 'query_action' and 'query_hidden_values' back
to the data dictionary, as they were accidentally dropped in r2123.
Reported by: Naran Babhu <naranbabhu{_AT_}tigris.org>
Also:
* CHANGES
Record this change.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2176 8cb11bc2-c004-0410-86c3-e597b4017df7
Try to make ViewVC provide a consistent, predictable data dictionary
in all of its templated views. Do this with a custom, dictionary-like
class that prevents the creation of new keys after an initial
instantiation of keys and (possibly dummy) values.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2144 8cb11bc2-c004-0410-86c3-e597b4017df7
Finish issue #402: Split the 'use_pagesize' configuration directive
into two: 'log_pagesize' and 'dir_pagesize', individually controlling
the size of pages used (if at all) for the revision log and directory
views, respectively.
* conf/viewvc.conf.dist
(use_pagesize): Removed, in favor of...
(dir_pagesize, log_pagesize): ...these.
* lib/viewvc.py,
* lib/config.py,
* bin/standalone.py
Replace the use and tooling around 'use_pagesize' with
'dir_pagesize' and 'log_pagesize' as appropriate.
* templates/include/paging.ezt,
* templates/include/dir_header.ezt
Stop using the option value to determine whether or not to show
pagination UI. Use the presence of some pages instead.
* docs/upgrading-howto.html
Note the changes in options.
Patch by: Lei Zhang <thestig{_AT_}google.com>
(Tweaked by me.)
Also:
* CHANGES
Note this change.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2143 8cb11bc2-c004-0410-86c3-e597b4017df7
Fix the GUI mode of standalone.py -- it wasn't even starting
correctly, and we don't need a toggle for 'enscript' any more.
* bin/standalone.py
(GUI.__init__): Pass the configuration file to handle_config().
Lose 'enscript'-related stuff.
(GUI.toggle_use_enscript): Remove.
(cli): Fix call to gui(), dropping bogus parameter.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2141 8cb11bc2-c004-0410-86c3-e597b4017df7
Fix issue #409, an exception thrown when sorting by revision in a
remote Subversion directory view.
* lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository.dirlogs): Store the entry's revision as
a string, for consistency with other vclib modules.
Reported by: Wojciech Wróblewski <wojtek{_AT_}elmi.pl>
Also:
* CHANGES
Note this change.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2139 8cb11bc2-c004-0410-86c3-e597b4017df7
Fix an exception in log views of Subversion repositories with 0
revisions.
* lib/vclib/svn/svn_repos.py
(_get_history): Add easy-out for repositories with 0 revisions.
Reported by: Wojciech Wróblewski <wojtek{_AT_}elmi.pl>
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2135 8cb11bc2-c004-0410-86c3-e597b4017df7
* templates/include/file_header.ezt
Lose template reference of 'log_href_rev', which was removed in
r2116 as unused.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2122 8cb11bc2-c004-0410-86c3-e597b4017df7
Clutterkiller! Put the default configuration files into a conf/
subdirectory.
* conf/
New subdirectory.
* cvsgraph.conf.dist,
* mimetypes.conf.dist,
* viewvc.conf.dist
Move these from here ...
* conf/cvsgraph.conf.dist,
* conf/mimetypes.conf.dist,
* conf/viewvc.conf.dist
... to here.
* viewvc-install
(FILE_INFO_LIST): Track new locations of configuration files.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2120 8cb11bc2-c004-0410-86c3-e597b4017df7
Finish issue #401: Support MIME type overrides in ViewVC configuration.
Trade the 'mime_types_file' option for 'mime_types_files' -- an
ordered list of MIME mapping files to consult. And provide our own
(empty) mapping file that folks can use to override the mappings
provided by other such files.
* mimetypes.conf.dist
New file.
* viewvc.conf.dist
(mime_types_files): Was mime_types_file, and now accepts multiple values.
* lib/config.py
(Config._force_multi_value): Add "mime_types_files" to the list of
multi-value configuration options.
(Config.set_defaults): Track rename of mime_types_file parameter,
now setting the default to a list containing only "mimetypes.conf".
* lib/viewvc.py
(load_config): Track new name and format of mime_types_files option.
* viewvc-install
(FILE_INFO_LIST): Also install mimetypes.conf.dist as itself and as
mimetypes.conf.
* INSTALL
(INSTALLING VIEWVC): Update reference to renamed configuration option.
* docs/upgrading-howto.html
Update this document.
Also:
* CHANGES
Note this change.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2102 8cb11bc2-c004-0410-86c3-e597b4017df7
ViewVC doesn't "do" directory entry sorting by revision for CVS, so
don't imply that it does in the UI.
* lib/viewvc.py
(view_directory): Don't provide sortby_rev_href to the template.
* templates/directory.ezt
Only offer sort links when those links are provided by ViewVC.
* templates/dir_new.ezt
Only offer sort links when those links are provided by ViewVC. Use
date-based sorting if rev-based sorting isn't available.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2092 8cb11bc2-c004-0410-86c3-e597b4017df7
Remove dead code.
* lib/popen.py
(pipe_cmds, _copy): Remove as unused.
* bin/standalone.py
(StandaloneServer.run_viewvc): Tweak comment that referred to pipe_cmds().
Found by: Rune Halvorsen <runeh {AT} sanedefaults.net>
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2089 8cb11bc2-c004-0410-86c3-e597b4017df7
Fix issue #398 (File Log Viewer Shows Wrong Log Message) by asking the
vclib layer for revision-sorted output rather than "whatever you want
to give me".
* lib/viewvc.py
(markup_or_annotate): Pass vclib.SORTBY_REV instead of vclib.SORTBY_DEFAULT
to the itemlog() interface.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2087 8cb11bc2-c004-0410-86c3-e597b4017df7
Allow admins to enable/disable diff/patch views via the allowed_views
configuration bit.
* lib/viewvc.py
(view_diff, view_patch): Only show diffs if 'diff' is one of the
allowed views.
* lib/config.py
(Config.set_defaults): Add 'diff' to the set of allowed_views (and
sort the values alphabetically where here).
* viewvc.conf.dist
(allowed_views): Add 'diff' to the set of views you can specify, and
include it in the default values. While here, sort the values
alphabetically.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2062 8cb11bc2-c004-0410-86c3-e597b4017df7
Avoid returning huge lists of variables from get_file_view_info(), and
use an ad-hoc class to hold all that stuff instead.
* lib/viewvc.py
(get_file_view_info): Now return an object with interesting
member variables instead of a nasty long list of values in an
easy-to-goof-up order.
(common_template_data, view_directory, view_log, view_diff): Update
uses of get_file_view_info to track new calling semantics.
Why? Just trying to avoid unnecessary branch divergence.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2057 8cb11bc2-c004-0410-86c3-e597b4017df7
Add a configuration option for telling ViewVC to *not* honor the
svn:mime-type property.
* lib/config.py
(Config.set_defaults): Set options.svn_ignore_mimetype default value.
* viewvc.conf.dist
(svn_ignore_mimetype): New.
* lib/viewvc.py
(calculate_mime_type): Consult cfg.options.svn_ignore_mimetype
before looking up the 'svn:mime-type' property.
* docs/upgrading-howto.html
Add a note about the new configuration option.
Patch (mostly) by: JJ <eggsgloriouseggs {_AT_} gmail.com>
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2056 8cb11bc2-c004-0410-86c3-e597b4017df7
It's very confusing to comment out the authorizer configuration line
and have that mean "use an authorizer". So let's just prevent that
confusion right now, okay?
* lib/config.py
(Config.set_defaults): Set 'authorizer' by default to None.
* viewvc.conf.dist
(authorizer): Update comments for correctness, and don't imply that
"forbidden" is the default authorizer.
* docs/upgrading-howto.html
Stop saying that "forbidden" is the default authorizer.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2054 8cb11bc2-c004-0410-86c3-e597b4017df7
Finish issue #384 - repos._revinfo_raw() is doing far too much work
when no authz is in use. Vastly improves performance of
repos.itemlog() for local Subversion repositories *not* protected by
an authorizer.
* lib/vclib/svn/svn_repos.py
(LocalSubversionRepository._revinfo): Was ._revinfo_raw(). Now
encapsulates the caching logic that used to live in .revinfo(), plus
the old logic of _revinfo_raw() modified to avoid changed-path
processing when that processing isn't strictly required by callers.
(LocalSubversionRepository.revinfo): Make this just a thin wrapper
around ._revinfo() now. Internal callers of this function updated
to use ._revinfo() instead.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2052 8cb11bc2-c004-0410-86c3-e597b4017df7
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.