the output stream.
* lib/viewvc.py
(copy_stream): Don't supply a default value for 'dst', and don't
special-case a value of None for it, either.
(view_checkout, view_cvsgraph_image, view_doc): Pass
request.server.file() as the 'dst' parameter to copy_stream().
(view_patch): Pass request.server.file() as the 'dst' parameter to
copy_stream(). Also, use request.server.file() instead of
sys.stdout.
(download_tarball): Use request.server.flush() instead of
sys.stdout.flush().
(view_error): Use server.file() instead of sys.stdout.
* lib/query.py
(main): Use server.file() instead of sys.stdout.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1532 8cb11bc2-c004-0410-86c3-e597b4017df7
* lib/query.py
(main): Add 'rss_href' to the data dictionary so the template
doesn't freak out.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1382 8cb11bc2-c004-0410-86c3-e597b4017df7
<john@linux.intel.com> on the users list.
* lib/query.py
(build_commit): set 'commits.log' template var instead of 'commits.desc'
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1265 8cb11bc2-c004-0410-86c3-e597b4017df7
file, templates, etc). Specifically, make the following changes:
- Get rid of hardcoded paths in module files ("lib" directory) and
configuration files (viewcvs.conf and mod_python's .htaccess)
- Allow stub scripts (for asp, cgi, and mod_python) to specify
configuration files so it's possible to have multiple configurations of
viewcvs running off a single installation.
- Be more consistent about resolving paths when they aren't hardcoded
(when ViewCVS is running from a source directory). In particular, try
not to depend on the working directory. That way it's legal to run
./standalone.py instead of bin/standalone.py without getting an
ImportError.
- Get rid of global cfg variables in viewcvs.py and cvsdb.py. They led to
all sorts of hacks in other files to pilfer and reset them. They were
also possible sources of races in multithreaded environments like
mod_python and asp.
- Rewrite mod_python handler so library paths can be specified inside the
stub files.
* lib/apache.py
removed, contained old mod_python handler
* lib/config.py
(Config.load_config):
remove sys.argv voodoo, just load the configuration path specified in
the pathname argument
(Config.set_defaults):
use relative path for cvsgraph_conf setting instead of hardcoded
<VIEWCVS_INSTALL_DIRECTORY> literal
* lib/cvsdb.py
(CONF_PATHNAME, config, cfg):
removed, configuration stuff
(CheckinDatabase.__init__, CheckinDatabase.CreateSQLQueryString):
add "_row_limit" member instead of using cfg object
(CreateCheckinDatabase):
removed, a do-nothing function
(ConnectDatabaseReadOnly, ConnectDatabase):
add cfg arguments
(GetUnrecordedCommitList):
add db argument
* lib/query.py
(CONF_PATHAME):
removed
(build_commit, run_query, main):
add cfg arguments, use new viewcvs.get_template function
* lib/viewcvs.py
(CONF_PATHNAME, cfg, g_install_dir):
removed
(Request.__init__):
add cfg member
(Request.run_viewcvs, Request.get_link, check_freshness,
get_view_template, generate_page, default_view, get_file_view_info,
format_log, common_template_data, MarkupEnscript.__init__,
markup_stream_python, markup_stream_php, make_time_string, view_markup,
sort_file_data, view_directory, paging, view_log, view_annotate,
view_cvsgraph_image, view_cvsgraph, view_doc, rcsdiff_date_reformat,
spaced_html_text, DiffSource.__init__, DiffSource._get_row, view_patch,
view_diff, generate_tarball, download_tarball, view_revision,
is_query_supported, english_query, build_commit, view_query,
view_error, main):
stop using global config, use cfg arguments or request member instead
(_install_path):
new, use __file__ to locate template and configuation paths
(get_view_template):
use _install_path and return compiled template instead of path
(is_viewable, default_view):
rename is_viewable to default_view and return view instead of boolean
(handle_config, load_config):
rename handle_config to load_config and return config object instead
of setting cfg global
* bin/cgi/viewcvs.cgi
* bin/cgi/query.cgi
* bin/cvsdbadmin
* bin/loginfo-handler
* bin/standalone.py
* bin/svndbadmin
look for library relative to sys.argv[0] when no hardcoded library
path is available. Also add configuration loading code.
* bin/asp/viewcvs.asp
* bin/asp/query.asp
add configuration loading code
* bin/mod_python/.htaccess
specify new mod_python handler, remove reference to
<VIEWCVS_APACHE_LIBRARY_DIRECTORY>
* bin/mod_python/handler.py
added, holds new mod_python handler
* bin/mod_python/viewcvs.py
* bin/mod_python/query.py
rewrite for new handler, add hardcoded library and configuration paths
* viewcvs.conf.dist
remove references to <VIEWCVS_INSTALL_DIRECTORY>
* viewcvs-install
(FILE_INFO_LIST):
stop hardcoding paths in config files
(SetPythonPaths,):
get rid of <VIEWCVS_INSTALL_DIRECTORY> and
<VIEWCVS_APACHE_LIBRARY_DIRECTORY> substitutions
(ApacheEscape, _re_apache):
removed
(InstallTree):
stop hardcoding paths in lib directory
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1173 8cb11bc2-c004-0410-86c3-e597b4017df7
* viewcvs/lib/viewcvs.py
(copy_stream): Add 'htmlize' option.
(MarkupPipeWrapper.__call__): Use copy_stream() with htmlize=1
instead of duplicating that loop logic.
(view_log): Set 'rev_selected' and 'path_selected' based on
previously acquired values.
(_re_extract_rev): Tweak regexp so it can match context diff '***'
headers, too.
(view_patch): Move request.server.header() call to just before
rendering.
(view_diff): Escape the 'patch_href' item. Move
request.server.header() call to just before rendering.
(view_error): Don't use the error template if we've already started
sending output through the server.
* viewcvs/lib/sapi.py
(ModPythonServer.__init__, ModPythonServer.header): Add and manage
new headerSent variable (like the ones used by CGIServer and
ASPServer).
* viewcvs/lib/query.py
(main): Call server headers here instead of down in the exception printer.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1136 8cb11bc2-c004-0410-86c3-e597b4017df7
Strict. Changes have been made in the EZT templates, the CSS files,
HTML code embedded in the Python files as well as in the help
files. The original code structure and design is the very same. No
other improvements have been made to the browser code and it still
uses the old layout tables to create the page grid.
Apart from the XHTML/CSS code changes, the patch adds an argument (-x
x) for CVSGraph in viewcvs.py in the view_cvsgraph function to tell
CVSGraph to generate XHTML code. For Mozilla/Firefox to recognize the
id attribute in the image map generated, the content-type must be set
to application/xhtml+xml (see
https://bugzilla.mozilla.org/show_bug.cgi?id=109445). This patch does
however not change the content-type, but uses an ugly hack to make the
CVSGraph output work in Mozilla with the current text/html
content-type: a name attribute is merged into the id attribute in the
map_name defined in the cvsgraph.conf.dist file.
The XHTML code does not contain the standard XML declaration, just the
XHTML 1.0 Strict Doctype. This is to keep ViewCVS as encoding agnostic
as before and let the browser decide which encoding to use. An XML
file without the encoding declared must be interpreted as UTF-8 (or
UTF-16 if the byte order mark is included).
* viewcvs/cvsgraph.conf.dist
Add name="" hack to the 'map_name' variable so Mozilla/Firefox will work.
* viewcvs/lib/ezt.py
XHTML-ize sample output.
* viewcvs/lib/viewcvs.py
XHTML-ize hard-coded output.
(view_cvsgraph): Pass "-x x" to cvsgraph to force XHTML production.
* viewcvs/lib/blame.py
* viewcvs/lib/debug.py
* viewcvs/lib/py2html.py
* viewcvs/lib/query.py
* viewcvs/lib/vclib/bincvs/__init__.py
* viewcvs/templates/annotate.ezt
* viewcvs/templates/diff.ezt
* viewcvs/templates/dir_alternate.ezt
* viewcvs/templates/directory.ezt
* viewcvs/templates/error.ezt
* viewcvs/templates/graph.ezt
* viewcvs/templates/log.ezt
* viewcvs/templates/log_table.ezt
* viewcvs/templates/markup.ezt
* viewcvs/templates/query.ezt
* viewcvs/templates/query_form.ezt
* viewcvs/templates/query_results.ezt
* viewcvs/templates/revision.ezt
* viewcvs/templates/roots.ezt
* viewcvs/templates/docroot/help_dirview.html
* viewcvs/templates/docroot/help_log.html
* viewcvs/templates/docroot/help_logtable.html
* viewcvs/templates/docroot/help_query.html
* viewcvs/templates/docroot/help_rootview.html
* viewcvs/templates/docroot/styles.css
* viewcvs/templates/include/branch.ezt
* viewcvs/templates/include/branch_form.ezt
* viewcvs/templates/include/diff_form.ezt
* viewcvs/templates/include/dir_footer.ezt
* viewcvs/templates/include/dir_header.ezt
* viewcvs/templates/include/file_header.ezt
* viewcvs/templates/include/footer.ezt
* viewcvs/templates/include/header.ezt
* viewcvs/templates/include/paging.ezt
* viewcvs/templates/include/sort.ezt
* viewcvs/templates/include/view_tag.ezt
XHTML-ize hard-coded output and templatized data.
* viewcvs/CHANGES
Note this change.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1109 8cb11bc2-c004-0410-86c3-e597b4017df7
where too much data was being hidden that I think I caused myself, but
also a security fix where not enough data was being hidden. At any
rate, this should bring us to consistent support for forbidden modules
(directories, not files) across the various views.
* viewcvs/lib/viewcvs.py
(Request.run_viewcvs): Move the forbidden check until later, after
we know the path type, because forbiddenness only applies to
top-level directories (modules), not files.
(view_directory): Only do forbidden checks on directories, not files.
(view_query): Strip forbidden/hidden paths from the query results.
Noticed by Jon Stritar (jstritar) in Bug #1249974.
* viewcvs/lib/query.py
(build_commit): Strip forbidden/hidden paths from query results.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1080 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
- Stop converting directory and file paths to lower case with native
slashes before storing them in the database. Instead store with
preserved case and forward slashes.
- Stop trying to clean up paths haphazardly all over the cvsdb module,
instead expect paths to be normalized before they get passed to
cvsdb.
* lib/cvsdb.py
(Commit.SetRepository, Commit.SetDirectory, Commit.SetFile,
CheckinDatabaseQuery.SetRepository,
CheckinDatabaseQuery.SetDirectory):
remove path cleanup code
(RLogDataToCommitList)
don't strip repository prefix because rlog module now does it
(CleanRepository):
new function
* lib/rlog.py
(_get_co_file):
change to return paths with forward slashes and without repository
prefixes
(GetRLogData):
update call to _get_co_file
* tools/cvsdbadmin
(UpdateFile, CommandUpdate, RebuildFile, CommandRebuild)
remove calls to normcase here
(module code):
use CleanRepository function to clean up repository path
* tools/loginfo-handler
(CleanDirectory):
removed
(HeuristicArgParse, CvsNtArgParse):
don't call CleanDirectory or normcase here
(HeuristicArgParseDirectory):
remove stray print statement
(module code):
use cvsdb.CleanRepository function to clean up repository path
* tools/svndbadmin
(module code):
use cvsdb.CleanRepository function to clean up repository path
* lib/viewcvs.py
(view_query):
change to use forward slashes in directory names instead of native
slashes
use cvsdb.CleanRepository function to clean up repository paths
* lib/query.py
(build_commit):
change to handle forward slashes in directory paths instead of
native slashes
(run_query):
use cvsdb.CleanRepository function to clean up repository path
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@952 8cb11bc2-c004-0410-86c3-e597b4017df7
information into the query database.
2) Update query.cgi to set [docroot] correctly. This allows it to find
the stylesheet, and corrects the help link in the footer.
3) Results could point at subversion repositories, so check if the
repository is in svn_roots too.
4) Only display repository names rather than paths in the results.
This matches what viewcvs.cgi shows the user.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@875 8cb11bc2-c004-0410-86c3-e597b4017df7
setup to test it at all. :-(
* viewcvs/lib/query.py
(main): Populate the 'docroot' data dictionary item.
* viewcvs/templates/query.ezt
Stop trying (and failing) to use the common header include ... I
don't have the energy to make this thing work with that right now.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@838 8cb11bc2-c004-0410-86c3-e597b4017df7
<rey4@columbia.edu> for bringing sanity to my morning with his fix of
the "isinstance()" usage.
* viewcvs/lib/config.py
(set_defaults): Add new default value for self.templates.error.
* viewcvs/viewcvs.conf.dist
(error): New configuration variable for specifying the error template.
* viewcvs/templates/error.ezt
New default error template.
* viewcvs/lib/debug.py
(ViewCVSException.__init__): Lose the 'description' member.
(PrintException): Now prints exception data passed in (doesn't do
the sys.exc_info() call itself any more).
(GetExceptionData): New generic exception data harvester for use
with templatized output.
* viewcvs/lib/viewcvs.py
(view_error): New error printer that tries to use the error template
before falling back to direct output.
* viewcvs/lib/query.py
Update calls to debug.PrintException() to get the exception data
from debug.GetExceptionData()
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@664 8cb11bc2-c004-0410-86c3-e597b4017df7
- Filled in ModPythonServer and AspServer header() methods to make use of
the new http 'status' parameter. Also, changed CgiServer's header()
method to ignore the status parameter under IIS to prevent the server
from discarding the ViewCVS output and instead sending a static error
page.
- ModPythonFile and AspFile classes have been eliminated and replaced
with a more generic File class. All server classes have new write()
and flush() methods.
- Common code from AspServer and ModPythonServer has been moved into
a base class called ThreadedServer. AspProxy is renamed to
ThreadedServerProxy.
- All server classes now inherit from a new base class called Server
which contains the small amount of code common to all of them.
- added fix_iis_path_info() function, renamed IIS_FixURL() to
fix_iis_url()
- renamed getFile() methods to file()
* lib/viewcvs.py
- Eliminated global server variable. Changed some scattered
server.escape() calls into cgi.escape() calls. Got around other uses
of the variable by adding a server member to the Request class.
- Deleted gstein's strongly worded comment about the quality of the sapi
hack :)
- Page-global 'g_name_printed' is now passed as a normal parameter
called 'name_printed' to the augment_entry() function
- Got rid of some confusing string manipulation in human_readable_diff()
- added 'server' parameter to viewcvs.main() to avoid relying on the
sapi.server global variable
* cgi/viewcvs.cgi, windows/viewcvs.py, windows/viewcvs.asp
- Added 'server' parameter to viewcvs.main() calls
* standalone.py:
- Changed StandaloneServer.header() method to accept http status code
- Added 'server' parameter to viewcvs.main() call
* lib/query.py
- added 'server' parameter to query.main() to avoid relying on the
sapi.server global variable
- got rid of global 'server' variable and page-global 'viewcvs_link'
variable, instead those values are passed as function parameters
* cgi/query.cgi, windows/query.py, windows/query.asp
- Added 'server' parameter to query.main() calls
* lib/debug.py
- Changed PrintStackTrace(), PrintException(), and DumpChildren() not to
rely on global sapi.server variable and to use new server.write()
method
* lib/popen.py
- changed server.getFile() calls to server.file()
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@642 8cb11bc2-c004-0410-86c3-e597b4017df7
rename the 'cvsroot' URL query item to 'root' (while still supporting
'cvsroot' as a valid token that just gets mapped to 'root' under the
hood) and to add support for an svn_roots configuration value (not
added to the default config file as part of this commit, though).
* viewcvs/lib/config.py
(_parse_roots): New helper.
(Config._force_multi_value): Add 'svn_roots'.
(Config._process_section): Use new helper function to parse
'cvs_roots' and 'svn_roots' configuration items.
(Config.set_defaults): Initialize default svn_roots config item.
* viewcvs/lib/viewcvs.py
(_sticky_vars, _legal_params): Rename 'cvs_root' to 'root'.
(_validate_root): Was _validate_cvsroot.
(Request.__init__): Patch 'cvsroot' query items to be 'root' items.
Examine both CVS and Subversion root configurations and choose the
appropriate repository.
(view_directory): Show both Subversion and CVS roots in the templates.
* viewcvs/lib/query.py
(build_commit): Use 'root' in the URL query portion instead of
'cvsroot'.
* viewcvs/templates/directory.ezt
* viewcvs/templates/dir_alternate.ezt
Replaces references to 'cvsroot' with 'root'.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@546 8cb11bc2-c004-0410-86c3-e597b4017df7
Python Exception Occurred ... template.parse_file(os.path.join(viewcvs.g_template_dir,
AttributeError: g_template_dir
in query.py. This was caused by the rename in viewcvs.py from 1.64 to 1.65
This was easy to find and easy to fix. ;-)
ViewCVS is great tool
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@352 8cb11bc2-c004-0410-86c3-e597b4017df7
new template is templates/query.ezt and is the "query" config option in the
[templates] section.
This converts about half the code. The database results come after the
footer, but that will be fixed in a (near) future revision.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@275 8cb11bc2-c004-0410-86c3-e597b4017df7
object to accept multiple directories, repositories, authors, and files;
it also does regular expressions (optionally) now
Note: this commit doesn't leave the database in a very useable state,
I'll fix that very soon.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@131 8cb11bc2-c004-0410-86c3-e597b4017df7