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
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
(_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
(_rootpath2url): Try a different approach that should actually
handle spaces in the "in-repos" path, too, and maybe (if I'm super
lucky) also work on Windows.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2707 8cb11bc2-c004-0410-86c3-e597b4017df7
### "annotate view without syntax coloration" codepath. ###
On the 'issue-495-dev' branch: Let vclib API consumers request that
annotation data come with or without the associated text.
* lib/vclib/__init__.py
(Repository.annotate): Add optional 'include_text' parameter.
* lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository.annotate): Add 'include_text' parameter
and, if False, have the annotation callback drop the text on the floor.
* lib/vclib/svn/svn_repos.py
(BlameSource.__init__): Add 'include_text' param; squirrel away the value.
(BlameSource._blame_cb): Don't keep text we're asked not to keep.
(LocalSubversionRepository.annotate): Add 'include_text' parameter,
passed to BlameSource.__init__.
* lib/vclib/ccvs/bincvs.py
(BinCVSRepository.annotate): Add 'include_text' parameter, passed to
blame.BlameSource().
* lib/vclib/ccvs/ccvs.py
(CCVSRepository.annotate): Add 'include_text' parameter, passed to
blame.BlameSource().
* lib/vclib/ccvs/blame.py
(BlameSource.__init__): Add 'include_text' param; squirrel away the value.
(BlameSource.__getitem__): Don't keep text we're asked not to keep.
* lib/blame.py
(HTMLBlameSource.__init__): Update call to repos.annotate().
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/issue-495-dev@2696 8cb11bc2-c004-0410-86c3-e597b4017df7
contain non-URI-safe characters (spaces, non-ASCII stuff, etc.)
* lib/vclib/svn/svn_repos.py
(_rootpath2url): Use urllib.pathname2url to URL-encode the path
portion of the URL we are building.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2674 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository._getrev): Re-raise all exceptions as
InvalidRevision exceptions.
* lib/vclib/svn/svn_repos.py
(LocalSubversionRepository._getrev): Re-raise all exceptions as
InvalidRevision exceptions.
Found by: Daniel Shahaf <d.s@daniel.shahaf.name>
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2586 8cb11bc2-c004-0410-86c3-e597b4017df7
CVS-keywords"). This changes causes the checkout of CVS file
contents -- when used as part of the markup/annotate logic -- to not
expand keywords. This helps it to be consistent with the results of
the annotate information query.
* lib/vclib/__init__.py,
* lib/vclib/svn/svn_ra.py,
* lib/vclib/svn/svn_repos.py
* lib/vclib/ccvs/ccvs.py
(openfile): Add 'options' parameter (unused). Callers updated.
* lib/vclib/ccvs/bincvs.py
(openfile): Add 'options' parameter, and look for a 'cvs_oldkeywords'
option to govern the use of -kkv or -ko in the 'co' command.
Callers updated.
* lib/viewvc.py
(markup_or_annotate): Pass 'cvs_oldkeywords' option to repos.openfile().
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2545 8cb11bc2-c004-0410-86c3-e597b4017df7
root") and issue #476 ("Stack trace for some users if last commit
deleted a file or folder") by preventing ViewVC from trying to look up
the path type of a deleted path at an invalid location.
* lib/vclib/svn/svn_repos.py
(LocalSubversionRepository._gettype): New helper function.
(LocalSubversionRepository.itemtype): Now use _gettype() helper.
(_get_change_copyinfo): New helper.
(_simple_auth_check): Rework this function to definitively resolve
the path type of paths it passes through the authz system,
handling the complication of determining the path of a now-deleted
path by consulting its last location prior to deletion.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2531 8cb11bc2-c004-0410-86c3-e597b4017df7
Subversion revision metadata harvesting logic.
* lib/vclib/svn/svn_repos.py
(LocalSubversionRepository._revinfo): Split this into two logical
codepaths, one that needs changed-path information along with the
revision metadata, one which does not. (Because if we don't need
it, there are faster ways to get what we *do* need.)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2509 8cb11bc2-c004-0410-86c3-e597b4017df7
Give the 'vcauth' subsystem a way to make universal access
determinations, which can seriously improve performance in situations
where a user has universal read access to a repository.
* lib/vcauth/__init__.py
(GenericViewVCAuthorizer.check_universal_access): New skeletal function.
(ViewVCAuthorizer.check_universal_access): New function.
* lib/vcauth/svnauthz/__init__.py (ViewVCAuthorizer.check_universal_access),
* lib/vcauth/forbidden/__init__.py (ViewVCAuthorizer.check_universal_access),
* lib/vcauth/forbiddenre/__init__.py (ViewVCAuthorizer.check_universal_access)
New functions.
* lib/vclib/ccvs/bincvs.py
(BaseCVSRepository.open): New function.
* lib/vclib/svn/svn_repos.py
(LocalSubversionRepository.open): Now check for universal read access.
* lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository.open): Now check for universal read access.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2496 8cb11bc2-c004-0410-86c3-e597b4017df7
Subversion client, as ViewVC no longer uses that information.
* lib/vclib/svn/svn_repos.py
(LocalSubversionRepository.__init__): Don't look for svn client path
in the 'utilities' dictionary. We don't use it anyway.
* lib/config.py
(Config.set_defaults): Don't populate utilities.svn any more.
* conf/viewvc.conf.dist
(utilities/svn): Remove as unused.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2493 8cb11bc2-c004-0410-86c3-e597b4017df7
(BlameSource.__init__): Use client.create_context() instead of
client.ctx_t() to avoid "NULL proxy object pool" error.
(I should have done this with the changes in r2421, but overlooked it,
I guess.)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2435 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/vclib/svn/svn_repos.py (LocalSubversionRepository._getrev),
* lib/vclib/svn/svn_ra.py (RemoteSubversionRepository._getrev):
Now accept revision strings that begin with 'r'.
Patch by: Daniel Shahaf <d.s{__AT__}daniel.shahaf.name>
(Tweaked by me.)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2405 8cb11bc2-c004-0410-86c3-e597b4017df7
Subversion revision properties.
NOTE: The svn_ra logic attempts to do the right thing when
pre-Subversion 1.5 libraries are install, but I haven't had the
chance to actually test this out myself.
* templates/revision.ezt
Include the props.ezt property handler template fragment for use
with revision props. Also, minor markup change to a header.
* templates/docroot/styles.css
Lose some unnecessary stylation.
* lib/viewvc.py
(get_itemprops): Lose unused variable has_binary_props.
(view_revision): Handle new return value from repos.revinfo(),
processing extra revision props similarly to the way that file/dir
props are processed and passing them to the template data
dictionary.
* lib/vclib/svn/svn_ra.py
Import _split_revprops() from svn_repos.
(client_log): New compatibility wrapper.
(add_log): Reformat as an svn_log_entry_receiver_t callback.
(RemoteSubversionRepository.dirlogs, _date_from_rev): Track changes
to self.revinfo().
(RemoteSubversionRepository.itemlog): Now use client_log().
(RemoteSubversionRepository._revinfo_raw): Now use client_log() and
return revprops dict, too.
(_log_cb): Reformat as an svn_log_entry_receiver_t callback.
* lib/vclib/svn/svn_repos.py
(_split_revprops): New helper.
(_log_helper, LocalSubversionRepository.dirlogs, _date_from_rev):
Track changes to repos._revinfo().
(_revinfo): Use _split_revprops(), and now return revprops, too.
(_revinfo_helper): Now return revprops dict, too.
(_date_from_rev):
* lib/vclib/__init__.py
(Repository.revinfo): Update docstring to indicate that this
interface now returns a revprops dictionary, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2401 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/vclib/svn/svn_repos.py
(BlameSource.__init__): Add 'config_dig' parameter, and use it to
register the Subversion configuration directory.
(LocalSubversionRepository.__init__): Recognize an empty-string
config_dir as None. (Yay for configuration file nuances!)
(LocalSubversionRepository.annotate): Pass self.config_dir to
BlameSource().
Patch (mostly) by: Jan Parthey <jpar{_AT_}tigris.org>
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2320 8cb11bc2-c004-0410-86c3-e597b4017df7
(LocalSubversionRepository.open): Remove custom SIGTERM handler.
It's causing problems for mod_python deployments, and I can't seem
to make it do anything meaningful for CGI deployments either.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2268 8cb11bc2-c004-0410-86c3-e597b4017df7
Python bindings do not correctly set the .apr_err and .message members
of SubversionException objects by patching up those exceptions using
the exception arguments.
(Unfortunately, I don't have a version of these bindings installed for
testing.)
* lib/vclib/svn/svn_repos.py
(_fix_subversion_exception): New helper function.
(_get_history, BlameSource.__init__, LocalSubversionRepository.rawdiff,
LocalSubversionRepository.get_location, LocalSubversionRepository.last_rev):
Use _fix_subversion_exception().
* lib/vclib/svn/svn_ra.py
(): Import _fix_subversion_exception from svn_repos.
(RemoteSubversionRepository._date_from_rev,
RemoteSubversionRepository.get_location): Use _fix_subversion_exception().
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2117 8cb11bc2-c004-0410-86c3-e597b4017df7
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/trunk@2051 8cb11bc2-c004-0410-86c3-e597b4017df7
(LocalSubversionRepository._revinfo_raw): Fix a logic-o. It's if
a copy source path is *not* authorized for read that we want to say
the original path was not copied.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1989 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/vclib/svn/svn_repos.py
(_path_parts): New, and now used throughout for path-to-parts
conversions.
(_cleanup_path): Rewrite as a wrapper around _path_parts().
(_fs_path_join): Rewrite as a wrapper around _cleanup_path().
(LocalSubversionRepository._revinfo_raw): Fix an authz check made
against the wrong path.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1969 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/vclib/svn/svn_repos.py
(LocalSubversionRepository.annotate): Keep the return value from
self.itemtype() so we can pass it to _get_history().
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1952 8cb11bc2-c004-0410-86c3-e597b4017df7
improves upon things to boot (finishing issue #339)!
This implements support for a configuration Subversion runtime config
directory location, which is useful for employing cached authn
credentials against remote repositories that require them, as well as
avoiding complaints the Subversion library might make when trying to
ensure the existence of a runtime configuration directory.
* viewvc.conf.dist
(options.svn_config_dir): New.
* lib/config.py
(Config.set_defaults): Initialize options.svn_config_dir variable.
* lib/viewvc.py
(Request.run_viewvc): Update call to vclib.svn.SubversionRepository().
(list_roots): Update call to vclib.svn.SubversionRepository().
* lib/vclib/svn/__init__.py
(SubversionRepository): Add 'config_dir' parameter, passed to
updated calls to RemoteSubversionRepository() and
LocalSubversionRepository()
* lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository.__init__): Add 'config_dir' parameter,
and squirrel it away in a member variable.
(RemoteSubversionRepository.open): Add the key thing I've been
missing for years to make custom runtime config directories work:
setting the configuration directory location in the auth baton!
God bless Eric Gillespie <epg@pretzelnet.org>.
* lib/vclib/svn/svn_repos.py
(LocalSubversionRepository.__init__): Add 'config_dir' parameter,
and squirrel it away in a member variable (currenty unused).
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1940 8cb11bc2-c004-0410-86c3-e597b4017df7
preserve executability.
* lib/vclib/__init__.py
(Repository.isexecutable): New.
* lib/vclib/ccvs/bincvs.py
(BaseCVSRepository.isexecutable): New.
* lib/vclib/svn/svn_repos.py
(LocalSubversionRepository.isexecutable): New.
* lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository.isexecutable): New.
* lib/viewvc.py
(generate_tarball): Use repos.isexecutable() to get the executable
bit for file tarball members. (This loses old code which directly
consulted the ,v file in the CVS case.)
* CHANGES
Note this change.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1936 8cb11bc2-c004-0410-86c3-e597b4017df7
(LocalSubversionRepository): Throughout, don't clobber 'rev'
variables before passing them off to .itemtype(), and ensure there
*is* a local 'path' variable in case the .itemtype() failure case
(which expects one) is raised
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1933 8cb11bc2-c004-0410-86c3-e597b4017df7
(authz-wise) territory. This should also filter unreadable revisions
from the annotate view, but I'm not as confident about that change.
* lib/vclib/svn/svn_repos.py
(_get_history): Add 'path_type' parameter, rename 'full_name'
parameter to 'path', and truncate history at the first unreadable
location (if any).
(BlameSource.__init__): Pass 'first_rev' as the starting revision to
the Subversion annotate logic, but leave a comment here questioning
whether it was the right thing to do.
(LocalSubversionRepository.itemlog): Update call to _get_history(),
and filter unreadable copyfrom paths.
(LocalSubversionRepository.annotate): Update call to _get_history().
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1832 8cb11bc2-c004-0410-86c3-e597b4017df7
optimizations to the way history is crawled in Subversion backends.
* lib/vclib/svn/svn_repos.py
(NodeHistory): Make this into an iterable object instead of relying
on a peek into a member variable.
(NodeHistory.__init__): Make histories a list instead of
dictionary. We need the ordering.
(NodeHistory.add_history): Validate the order in which revision info
is received -- order matters now.
(NodeHistory.__getitem__): New.
(_get_history): Return the NodeHistory object, which is now iterable.
(_log_helper): Swap the order of the 'path' and 'rev' parameters
(for consistency).
(_fetch_log): Merged into its only caller, which was ...
(LocalSubversionRepository.itemlog): ...this. Update the use of
NodeHistory here to avoid unnecessary sorts and reverses and such.
(LocalSubversionRepository.annotate): Update the use of NodeHistory here.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1831 8cb11bc2-c004-0410-86c3-e597b4017df7
(LocalSubversionRepository.openfile, LocalSubversionRepository.listdir,
LocalSubversionRepository.dirlogs, LocalSubversionRepository.annotate):
Use self.itemtype() to pull off both an authz check as well as
kind-in-light-of-operation validation.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1830 8cb11bc2-c004-0410-86c3-e597b4017df7
(LocalSubversionRepository.dirlogs): Oops! Fix a buglet caused by
looking at the wrong revision-holding variable.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1791 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/vclib/__init__.py
(Repository.dirlogs): Update comment.
(Revision.__init__): Add 'lockinfo' parameter, used to populate
similarly named class member.
* lib/vclib/svn/svn_repos.py
(Revision.__init__): Add 'lockinfo' parameter, and update call to
vclib.Revision().
(_log_helper): Update call to Revision(), and lose custom lockinfo handling.
(LocalSubversionRepository.dirlogs): Populate entry lockinfo with a
call to svn_fs_get_lock() for each entry.
* lib/vclib/svn/svn_ra.py
(LogCollector.__init__): Add 'lockinfo' parameter, used to populate
similarly named class member.
(LogCollector.add_log): Pass self.lockinfo to updated call to Revision().
(RemoteSubversionRepository.itemlog): Pass lock info to
LogCollector(), and lose custom lockinfo handling.
(RemoteSubversionRepository.itemtype, RemoteSubversionRepository.listdir):
Update expected return value from _get_dirents().
(RemoteSubversionRepository.dirlogs): Populate entry lockinfo from
updated return value from _get_dirents().
(RemoteSubversionRepository._get_dirents): Rework to trade in
dirents and locks instead of only dirents.
* lib/vclib/ccvs/bincvs.py
(Revision.__init__): Update call to vclib.Revision().
(_get_logs): Add 'lockinfo' member to DirEntry() items.
* lib/vclib/ccvs/ccvs.py
(InfoSink.__init__): Init lockinfo dictionary.
(InfoSink.set_locker): New.
(InfoSink.define_revision): Set lockinfo on Revision item.
(InfoSink.set_revision_info): Populate DirEntry lockinfo from
Revision lockinfo data.
* lib/viewvc.py
(view_directory): Populate entry lockinfo.
(common_template_data): Populate the 'lockinfo' data dictionary item.
* templates/directory.ezt,
* templates/dir_new.ezt
* templates/annotate.ezt,
* templates/markup.ezt
Tweak to show lock status.
* docs/template-authoring-guide.html
Note new data dictionary items.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1787 8cb11bc2-c004-0410-86c3-e597b4017df7
* docs/template-authoring-guide.html
Document the new appearances of the lockinfo data.
* templates/log.ezt,
* templates/log_table.ezt
Show lock status information.
* templates/docroot/images/lock.png
New icon.
* lib/viewvc.py
(view_log): Populate the log revision entry's new "lockinfo" member.
* lib/vclib/svn/svn_repos.py
(_log_helper): Accept 'lockinfo' parameter, used to populate the
similarly named member of the Revision() object.
(_fetch_log): Query the lock status of the input path, and update
calls to _log_helper().
* lib/vclib/ccvs/ccvs.py
(CCVSRepository.itemlog): Update call to _file_log(), passing lockinfo.
(TreeSink.__init__): Init new lockinfo dictionary.
(TreeSink.set_locker): New.
* lib/vclib/ccvs/bincvs.py
(_parse_log_header): Now parse and return lock information, too.
(_file_log): Add 'lockinfo' parameter, used to populate the
similarly named Revision() object members.
(BinCVSRepository._get_tip_revision, BinCVSRepository.itemlog):
Expect lockinfo back from _parse_log_header(), and pass to updated
calls to _file_log().
(_get_logs): Expect lockinfo back from _parse_log_header().
* lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository.itemlog): Use svn_client_ls3() to fetch
lock information.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1783 8cb11bc2-c004-0410-86c3-e597b4017df7