* templates/classic/file.ezt,
* templates/default/file.ezt
Set the page's <title> attribute to "Annotation of ..." or "Contents
of ...", depending on whether the output is annotated.
Patch by: John McNally <jmcnally{__AT__}collab.net>
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2796 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/viewvc.py
(DiffSource._get_row): Pass the "extra" line information through the
formatter code so that, at a minimum, it's HTML-escaped.
Patch by: Nicolás Alvarez <nicolas.alvarez{__AT__}gmail.com>
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2792 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/viewvc.py
(view_diff): Add 'cfg' convenience variable (to avoid a stack trace
caused by using such a thing a few lines later).
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2790 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/viewvc.py
(view_log): Preserve the 'log_pagestart' query value when generating
the 'select for diff' links so that clicking the link returns you to
the same page (modulo repagination due to new commits in the race
window ... but let's not think about that). Also, preserve the
'r1' query parameter when generating the paging form.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2788 8cb11bc2-c004-0410-86c3-e597b4017df7
* bin/cgi/viewvc.cgi
Add some commented-out logic for renice-ing the ViewVC CGI process.
Inspired by: Karl Berry <karl{__AT__}freefriends.org>
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2786 8cb11bc2-c004-0410-86c3-e597b4017df7
Add a new configuration option 'binary_mime_types' which accepts a
comma-delimited list of MIME content type patterns ('text/plain', or
'image/*', etc.) against which versioned file MIME types are
compared for the purposes of deciding whether to allow their display
in the 'markup', 'annotate', 'diff' and 'patch' views.
* conf/viewvc.conf.dist
(binary_mime_types): Describe new option.
* lib/config.py
(_force_multi_value): Add 'binary_file_types' to the list of
multi-value options.
(Config.set_defaults): Initialize cfg.options.binary_mime_types.
* lib/viewvc.py
(is_binary_file_mime_type): New function.
(get_file_view_info): Use is_binary_file_mime_type() to determine
whether to return links to content-ful views of the input file.
(markup_or_annotate, view_diff): Use is_binary_file_mime_type() to
deny display of so-deemed binary files.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2784 8cb11bc2-c004-0410-86c3-e597b4017df7
(RemoteSubversionRepository.itemlog): Only fetch lock and size
information for files, not directories.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2781 8cb11bc2-c004-0410-86c3-e597b4017df7
New icon file.
* templates/default/directory.ezt,
* templates/default/docroot/styles.css
Add template bits for displaying a lock-icon "overlay" for locked
items in the directory view.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2774 8cb11bc2-c004-0410-86c3-e597b4017df7
(LogFormatter.get): Fix a regression introduced in 1.1.14's handling
of log messages when not HTML-ifying them (for example, when serving
them up via RSS).
Patch by: Christoph Sommer <christoph.sommer{__AT__}uibk.ac.at>
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2771 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/viewvc.py
(markup_or_annotate): Don't forget to cross copies when requesting
the item's log.
* lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository.itemlog): Treat 'svn_latest_log' option
specially, as in the svn_repos case. (Ugh.)
(RemoteSubversionRepository.annotate): Pass 'svn_show_all_dir_logs'
option to itemlog(). Also, upgrade to svn_client_blame2() API.
(RemoteSubversionRepository._get_last_history_rev): Now return both
the info-provided create_rev, and the more accurate
last_history_rev. Callers updated.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2770 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository._revinfo_fetch): New. Holds the guts of
the revision info harvesting (plus some bugfixes thereto) from...
(RemoteSubversionRepository._revinfo): ...this, which now calls the
helper function. Also, don't tuple-ize the already-tupled cache
info.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2768 8cb11bc2-c004-0410-86c3-e597b4017df7
unnecessary (and somewhat expensive) work.
* lib/vclib/svn/svn_ra.py
(client_log): Add 'include_changes' parameter, pass to the
Subversion log APIs. Callers updated.
(_revinfo): Was _revinfo_raw(). Add 'include_changed_paths'
parameter. Now handles the revinfo cache, only fetches changed
paths when required, and bails out early of authz checks when
possible. All internal callers of revinfo() have been updated to
use this interface instead.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2765 8cb11bc2-c004-0410-86c3-e597b4017df7
annotate view recently introduced.
* lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository.annotate): Pass 'svn_cross_copies'
option to itemlog() so that annotation history isn't unnaturally
truncated.
(RemoteSubversionRepository._blame_cb): Only consult the revinfo
cache when authz checks are required. This improves the speed of
the operation when universal read access is granted to the user.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2763 8cb11bc2-c004-0410-86c3-e597b4017df7
fully honoring authz rules"). In doing so, this makes the svn_ra
module the most accurate it has ever been, hopefully without too
terribly much extra cost.
* lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository.listdir): No longer check access here.
That's handled down in _get_dirents() now.
(RemoteSubversionRepository.dirlogs): Don't check dirent access here.
Just ensure that the returned entries are those which are
represented in the (filtered) set return from _get_dirents().
Also, replace the revision metadata stored on each dirent with
values from the revinfo cache (which does authz sanitizing).
(RemoteSubversionRepository._get_dirents): Do authz-checking of
dirents here, and use _get_last_history_rev() to populate a useful
created_rev.
(RemoteSubversionRepository._get_last_history_rev): Because
Subversion's RA layer doesn't consider copy events when
determining an item's last-committed-rev, compensate for this with
a bounded log operation which does. This brings created-rev
parity with the svn_repos module (at the cost of the extra RA
work, but with the benefit of, you know, accuracy.
(RemoteSubversionRepository._revinfo_raw): Leave a TODO about a
future optimization.
(RemoteSubversionRepository._log_cb): Set found_unreadable when
sanitizing an unreadable copyfrom path, too.
(RemoteSubversionRepository.created_rev): Now just a thin wrapper
around the beefed-up _get_last_history_rev() function.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2760 8cb11bc2-c004-0410-86c3-e597b4017df7
(LogCollector.add_log): Allow the access_check_func to be None (and
avoid trying to call it in that case).
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2759 8cb11bc2-c004-0410-86c3-e597b4017df7
unreadable one, Subversion will obscure the fact that the operation
was a copy (by removing copyfrom info) and will deem the log message
for the revision in which the copy occurred to be unreadable. ViewVC
was only doing the former bit; now it does the latter, too.
* lib/vclib/svn/svn_repos.py
(LocalSubversionRepository._get_changed_paths): Set found_unreadable
when we have to hide a copyfrom path, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2758 8cb11bc2-c004-0410-86c3-e597b4017df7
remote SVN repositories.
* lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository.annotate): Examine revision logs to
determine the legal annotation range we are allowed to request,
and use the revinfo cache to strip sensitive author/data info from
the annotation data.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2757 8cb11bc2-c004-0410-86c3-e597b4017df7
authz rules"):
* lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository.get_locations): Check authz on the
result of a get_locations lookup (being sure to use the original
path in the error message, if any).
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2756 8cb11bc2-c004-0410-86c3-e597b4017df7
log view for remote SVN repositories.
* lib/vclib/svn/svn_ra.py
(LogCollector.__init__): Add 'access_check_func' parameter, stashed
away as a member variable. Initialize 'done' variable to False.
(LogCollector.add_log): Use access_check_func() to test for access.
If access is denied, set 'done' to True and ignore future
invocations.
(RemoteSubversionRepository.itemlog): Add _access_checker inner
function, passed as a callback to LogCollector.__init__().
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2755 8cb11bc2-c004-0410-86c3-e597b4017df7
viewer").
NOTE: There are some limitations here, most prominantly that commas
can't be used in the regular expressions which define replacements,
and that only match groupings 0-9 can be used in the replacement
format string.
* conf/viewvc.conf.dist
(custom_log_formatting): New configuration option.
* lib/config.py
(Config._force_multi_value, Config.set_defaults): Add handling of
new 'custom_log_formatting' option.
* lib/viewvc.py
(ViewVCHtmlFormatter.format_custom_url): New formatter callback.
(LogFormatter.get): Register the new formatter callback for rules
found in the 'custom_log_formatting' option value.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2746 8cb11bc2-c004-0410-86c3-e597b4017df7
for better performance").
* lib/viewvc.py
Replace uses of format_log() throughout with calls to LogFormatter()
(to get a formatter "lf") then lf.get() (to get the formatted log
string). Also...
(format_log): Remove as unused.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2741 8cb11bc2-c004-0410-86c3-e597b4017df7
better performance"), make the first step of two in trying to avoid
parsing log messages twice when once will suffice.
* lib/viewvc.py
(ViewVCHtmlFormatterTokens): New class for generating HTML-formatted
text from a set of provided ViewVCHtmlFormatter tokens.
(ViewVCHtmlFormatter.get_result): Track renamed function, and defer
the work of the text generation to the token object's get_result()
method.
(ViewVCHtmlFormatter.tokenize_text): Renamed from _tokenize_text(),
and now return a ViewVCHtmlFormatterTokens object.
(LogFormatter): New class for encapsulating the log formatting logic.
(format_log): Make a wrapper around LogFormatter for now.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2740 8cb11bc2-c004-0410-86c3-e597b4017df7
anonymously").
* lib/vcauth/svnauthz/__init__.py
(ViewVCAuthorizer.__init__): Don't try to convert a None username to
lower- or upper-case.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2738 8cb11bc2-c004-0410-86c3-e597b4017df7
time.
* lib/vclib/svn/__init__.py
(_canonicalize_path): New helper function.
(canonicalize_rootpath): Rework this to perform the URL -> absolute
path conversion any time it can, not only when using really old
Subversion versions.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2735 8cb11bc2-c004-0410-86c3-e597b4017df7
won't hit AttributeError's on account of svn_path_canonicalize() not
being exposed through Subversion's Python bindings.
* lib/vclib/svn/svn_repos.py
(_canonicalize_path): New helper function.
(_rootpath2url): Use _canonicalize_path() instead of
core.svn_path_canonicalize().
* lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository._geturl): Use (imported)
_canonicalize_path() instead of core.svn_path_canonicalize().
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2733 8cb11bc2-c004-0410-86c3-e597b4017df7
characters in their names"), another in a long string of annotate view
brokennesses. (Is that word?) This time, the problem was a disparity
between Python's urllib encoding and what Subversion deems canonical.
* lib/vclib/svn/svn_repos.py
(_rootpath2url): Canonicalize URLs for use with Subversion.
* lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository._geturl): Canonicalize URLs for use with
Subversion.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2731 8cb11bc2-c004-0410-86c3-e597b4017df7
(update_license): Remove.
(bump_years): Print reminder about amending the change history
section of the LICENSE.html file.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2722 8cb11bc2-c004-0410-86c3-e597b4017df7
(_rootpath2url): Get the absolute path before splitting off the
drive, not afterward. Otherwise, (some) drive letter will just get
tacked back onto the path! As we now verify elsewhere that
rootpaths aren't relative, we needn't worry that .splitdrive() will
return a relative rootpath.
Suggested by: Jens Peters <jp7677{__AT__}gmail.com>
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2714 8cb11bc2-c004-0410-86c3-e597b4017df7
what kind of chaos may ensue otherwise.
* conf/viewvc.conf.dist
Note that paths should be absolute filesystem paths.
* lib/vclib/svn/__init__.py
(canonicalize_rootpath, expand_root_parent): Assert that local
repository paths are absolute.
* lib/vclib/ccvs/__init__.py
(canonicalize_rootpath, expand_root_parent): Assert that local
repository paths are absolute.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2713 8cb11bc2-c004-0410-86c3-e597b4017df7
against the upstream version of this module.
* lib/common.py
(TemplateData): Moved here...
* lib/ezt.py
...from here.
* lib/query.py,
* lib/viewvc.py
Import 'TemplateData' from 'common' now, and update references to this
relocated class.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2711 8cb11bc2-c004-0410-86c3-e597b4017df7