Commit Graph

35 Commits (d25e5e309829eb7ab1d86971465b87c064ca8c68)

Author SHA1 Message Date
cmpilato e4527a3732 Un-bind ViewVC's core libraries from the assumption that sys.stdout is
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
2007-02-26 18:07:19 +00:00
cmpilato b12a220928 Finish issue #249.
* 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
2006-07-14 18:32:42 +00:00
rey4 3efd3fa040 Clean for file headers and copyright notices for issue 167
* bin/asp/query.asp
* bin/asp/viewvc.asp
* bin/cgi/query.cgi
* bin/cgi/viewvc.cgi
* bin/cvsdbadmin
* bin/loginfo-handler
* bin/make-database
* bin/mod_python/handler.py
* bin/mod_python/query.py
* bin/mod_python/viewvc.py
* bin/standalone.py
* bin/svndbadmin
* lib/accept.py
* lib/blame.py
* lib/compat.py
* lib/config.py
* lib/cvsdb.py
* lib/dbi.py
* lib/debug.py
* lib/idiff.py
* lib/popen.py
* lib/query.py
* lib/sapi.py
* lib/vclib/__init__.py
* lib/vclib/bincvs/__init__.py
* lib/vclib/ccvs/__init__.py
* lib/vclib/ccvs/blame.py
* lib/vclib/ccvs/rcsparse/__init__.py
* lib/vclib/ccvs/rcsparse/common.py
* lib/vclib/ccvs/rcsparse/debug.py
* lib/vclib/ccvs/rcsparse/default.py
* lib/vclib/ccvs/rcsparse/texttools.py
* lib/vclib/svn/__init__.py
* lib/vclib/svn_ra/__init__.py
* lib/viewvc.py
* lib/win32popen.py
* tools/make-release
* tparse/tparse.cpp
* tparse/tparse.h
* tparse/tparsemodule.cpp
* tparse/tparsemodule.h
* viewcvs-install


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1288 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-18 02:07:36 +00:00
rey4 f74711446f Finish issue 168, the project rename. Change is mostly based on the patch
from Gerard Gerritsen (sigcafe), with some other stuff thrown in.

* bin/asp/viewcvs.asp
* bin/asp/viewvc.asp
* bin/cgi/viewcvs-strace.sh
* bin/cgi/viewvc-strace.sh
* bin/cgi/viewcvs.cgi
* bin/cgi/viewvc.cgi
* bin/mod_python/viewcvs.py
* bin/mod_python/viewvc.py
* lib/viewcvs.py
* lib/viewvc.py
* viewcvs.conf.dist
* viewvc.conf.dist
    the file renames

* bin/cvsdbadmin
* bin/loginfo-handler
* bin/svndbadmin
* bin/asp/query.asp
* bin/cgi/query.cgi
* bin/mod_python/query.py
* bin/make-database
* bin/standalone.py
* lib/debug.py
* lib/compat.py
* lib/blame.py
* lib/vclib/ccvs/rcsparse/debug.py
* lib/vclib/bincvs/__init__.py
* lib/query.py
* lib/config.py
* lib/dbi.py
* lib/sapi.py
* INSTALL
* TODO
* cvsgraph.conf.dist
* tests/timelog.py
* tools/make-release
* tparse/tparsemodule.h
* tparse/Setup.py
* tparse/INSTALL
* tparse/tparsemodule.cpp
* tparse/tparse.h
* tparse/tparse.cpp
* windows/README
* viewcvs-install
* viewvc.org/index.html
* viewvc.org/contributing.html
* viewvc.org/template-authoring-guide.html
* viewvc.org/upgrading.html
* viewvc.org/license-1.html
    the other changes



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1287 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-18 00:33:54 +00:00
rey4 f062872f9a Fix crippling bug in query.cgi reported by John L. Villalovos
<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
2006-02-18 15:38:28 +00:00
rey4 b91146fee0 Work on issue 168, s/ViewCVS/ViewVC. This patch changes references to
ViewCVS in comments, strings, and documentation. References to ViewCVS
in filenames and urls still need to be fixed. Also, logo.png (the blimp)
needs to be updated or replaced.

This patch is by Gerard Gerritsen (sigcafe), the only change I've made is
to restore a reference to ViewCVS in a comment about backwards compatibility.

* windows/README
* viewcvs-install
* README
* templates/include/footer.ezt
* templates/include/header.ezt
* templates/error.ezt
* templates/query.ezt
* templates/docroot/help.css
* templates/docroot/help_query.html
* templates/docroot/help_dirview.html
* templates/docroot/help_rootview.html
* templates/docroot/styles.css
* templates/docroot/help_log.html
* templates/diff.ezt
* tools/make-release
* lib/sapi.py
* lib/dbi.py
* lib/accept.py
* lib/cvsdb.py
* lib/config.py
* lib/query.py
* lib/vclib/bincvs/__init__.py
* lib/vclib/svn/__init__.py
* lib/vclib/__init__.py
* lib/vclib/svn_ra/__init__.py
* lib/vclib/ccvs/rcsparse/common.py
* lib/vclib/ccvs/rcsparse/__init__.py
* lib/vclib/ccvs/rcsparse/default.py
* lib/vclib/ccvs/rcsparse/texttools.py
* lib/vclib/ccvs/rcsparse/debug.py
* lib/vclib/ccvs/__init__.py
* lib/vclib/ccvs/blame.py
* lib/blame.py
* lib/popen.py
* lib/compat.py
* lib/viewcvs.py
* lib/debug.py
* INSTALL
* bin/standalone.py
* bin/make-database
* bin/mod_python/query.py
* bin/mod_python/viewcvs.py
* bin/cgi/query.cgi
* bin/cgi/viewcvs.cgi
* bin/asp/query.asp
* bin/asp/viewcvs.asp
* bin/svndbadmin
* bin/loginfo-handler
* bin/cvsdbadmin
* viewcvs.conf.dist


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1200 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-17 17:19:28 +00:00
rey4 72672b458c Tweak logic used to find installed paths ("lib" directory, configuration
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
2005-12-06 04:04:14 +00:00
cmpilato a27d1016c9 Miscellaneous tweaks.
* 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
2005-10-19 20:38:33 +00:00
cmpilato 97a07dc88e This patch (mostly by Marten Thavenius) upgrades ViewCVS to XHTML 1.0
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
2005-09-28 17:06:16 +00:00
cmpilato 11769e1b29 Miscellaneous fixes around the forbiddenness support, mostly bugs
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
2005-08-17 21:45:35 +00:00
cmpilato 50508ebcc7 In short, facilitate the creation, testing, installation, and sharing
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
2005-02-08 02:46:20 +00:00
rey4 34b3f3e47a Fix file path issues in CVSdb on windows. Summary of changes:
- 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
2004-10-16 00:47:42 +00:00
rey4 502873ecc0 Bugfix in query page, stop using old "icons" config variable
* lib/query.py
  (main)
     stop trying to set "icons" template variable


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@924 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-25 00:32:01 +00:00
jhenstridge 7ad43eaa74 Port the "diff link" support over to the query.cgi script.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@878 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-17 06:46:02 +00:00
jhenstridge a6ae62b59f 1) add a bit of documentation on using svndbadmin to load revision
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
2004-07-16 16:39:46 +00:00
cmpilato d0a62c7520 Try to get the query.cgi script working again. Unfortunately, I'm not
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
2004-04-28 15:53:39 +00:00
rey4 7994db2d37 fix improperly escaped urls on query page, bug #529888 reported
by Franz H�pfinger.

* lib/query.py
  (build_commit)
    add call to urllib.quote


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@765 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-27 17:47:30 +00:00
cmpilato 1ab8cfbd92 Purge semi-colons from the ends of statements (in one case, moving it into a
string constant as an HTML entity terminator.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@719 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-14 15:53:42 +00:00
rey4 7296228e72 fixed template variable bug #781130 on query page. reported by Michael
Pechner (mpechner).

* lib/query.py (main): set 'icons' parameter in template data


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@698 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-08-05 01:02:23 +00:00
cmpilato dd34c9fd4c Implement templatized error messages. Thanks to Russell Yanofsky
<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
2003-06-26 18:18:41 +00:00
rey4 459ed3fea3 * lib/sapi.py
- 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
2003-03-12 23:08:09 +00:00
rey4 5a7ae45fa1 minor changes to sapi interface for mod_python support
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@611 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-18 11:54:41 +00:00
rey4 b7877e0d0c - removed hardcoded links in query page
- replaced cvsroot_name_from_path() function with a lookup table


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@598 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-11 02:56:11 +00:00
rey4 e808ff8ce9 - updated to use new sapi module
- now can display local times if the use_localtime configuration option
  is set


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@590 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-09 09:49:00 +00:00
cmpilato 5b6234678b Begin adding Subversion config and query support. First step was to
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
2002-09-06 20:36:58 +00:00
pefu 84188fafbb After cvs updating I got
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
2001-11-19 11:15:18 +00:00
gstein 9a8c28d886 Shift some presentation code out of query.py; do the work in the template.
Also, make sure the result table isn't shown if we haven't run a query.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@337 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-18 11:11:38 +00:00
gstein b048907b6d Complete the conversion of the cvsdb query facility over to templates. This
was a "minimal impact" switch. A bit more cleanup is coming separately.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@335 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-18 10:34:35 +00:00
gstein bff90274b1 First pass at converting the database query stuff over to use templates. The
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
2001-10-25 09:21:47 +00:00
jpaint a64dc83028 big update of commit database; new CGI, better database cache; no more
html templates; better intigration with viewcvs.cgi's HTML settings


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@207 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-08-21 19:24:40 +00:00
gstein 007ad51b2c change web site references from www.lyra.org/viewcvs/ to the new
viewcvs.sourceforge.net/ site.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@193 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-30 08:49:19 +00:00
gstein e3dbdb4fcc Update copyright years to include 2001.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@182 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-12 22:51:02 +00:00
jpaint 5ca77ced3c fix error -- use lowercase "dbi"
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@136 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-07-01 16:53:36 +00:00
jpaint 91d2ebfc64 move the dbi abstraction to dbi.py; I'll deal with various errors and
incompatibilities in different versions of MySQLdb here...


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@135 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-06-27 03:09:52 +00:00
jpaint cb4f496b99 moved query object from lib/database.py to lib/query.py; expanded query
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
2000-06-11 16:47:37 +00:00