Commit Graph

32 Commits (master)

Author SHA1 Message Date
cmpilato f48add83f7 Bump copyright years.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2820 8cb11bc2-c004-0410-86c3-e597b4017df7
2013-01-04 19:01:54 +00:00
cmpilato 9e9b82218c Bump copyright years.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2720 8cb11bc2-c004-0410-86c3-e597b4017df7
2012-01-23 17:52:47 +00:00
cmpilato 7fd9e405a1 Update copyright years.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2107 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-03-18 16:43:33 +00:00
cmpilato 4904e03324 Minor improvements to the debug timer code.
* lib/debug.py
  (t_dump): Was dump().  Now accepts an output file handle, and sorts
    the output in a predictable fashion.

* lib/viewvc.py
  (main): Track changes to debug.dump().

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2048 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-11-13 19:45:13 +00:00
cmpilato a8a6d5c10b I *thought* something seemed wrong. We don't *want* ViewVC to claim
some path is forbidden.  We want it to claim the path doesn't exist at
all!  So remove some unused cruft from a previous manifestation of the
authz support.

* lib/debug.py
  (ViewVCNotAuthorizedException): Remove as unused.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1964 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-21 00:35:26 +00:00
cmpilato 473951fa96 * lib/debug.py
(ViewVCNotAuthorizedException.__init__): Use "403 Forbidden" instead
    of the bogus "501 Not Authorized" status.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1963 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-21 00:28:11 +00:00
cmpilato 4395bc3b1c Update copyright years.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1828 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-28 16:11:24 +00:00
cmpilato dc19cf90ba Merge the authz-dev branch work into trunk. Let's let the pluggable authz
subsystem go mainstream!

* notes/authz-dev-TODO
* lib/vcauth/*
  New, copied from the authz-dev branch.

* viewvc.conf.dist
* lib/viewvc.py
* lib/query.py
* lib/debug.py
  Merge changes from the authz-dev branch.

* lib/config.py
  Merge changes from the authz-dev branch.  Also, make 'forbidden' the
  default value for 'authorizer'.

* docs/upgrading-howto.html
  Add sections about handling forbidden modules.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1623 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-25 20:07:13 +00:00
cmpilato ac60888eaf Add some debug code to facilitate tarball generation debugging.
* lib/debug.py
  (SHOW_TIMES, SHOW_CHILD_PROCESSES): Add some explanatary comments.
  (TARFILE_PATH): New.

* lib/viewvc.py
  (download_tarball): When tarball debugging is enabled, generate the tarfile
    at the configured location, and deliver either a cheap success message
    or an error view to the browser.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1461 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-11-01 14:24:41 +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 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
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 e8fa0f0186 * viewcvs/lib/debug.py
(PrintStackTrace): Remove unused function.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1008 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-31 21:12:13 +00:00
cmpilato c15cc3bb33 * viewcvs/lib/debug.py
(PrintException): Escape the error message so it doesn't goof up
    HTML display.

* viewcvs/lib/viewcvs.py
  (Request.run_viewcvs, _validate_param): Don't escape params in
    strings of raised exceptions, as that's the exception-handling
    code's job.
  (nav_header_data, common_template_data, clickable_path, view_log,
    view_directory): Escape template data that needs escapin'.
  (view_markup): Use un-escaped filename instead of the one in the
    data dictionary.
  (view_checkout): Re-org a little bit so that fp is always explicitly
    closed.
  (copy_stream): Instead of defaulting the output stream to None, and
    letting None mean "gimme sys.stdout", just make the default output
    sys.stdout.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@986 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-06 20:40:09 +00:00
cmpilato 356642e4b6 Error template fixes.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@976 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-11-19 06:38:39 +00:00
cmpilato 289c3b25bc Make Etag support optional (in a first-class fashion).
* viewcvs/lib/viewcvs.py
  (check_freshness): Check the new configuration option for etag
    support.  Also, cfg.general.http_expiration_time is now
    cfg.options.http_expiration_time.

* viewcvs/lib/debug.py
  (DISABLE_ETAGS): Remove.

* viewcvs/lib/config.py
  (Config.set_defaults): Set new 'generate_etags' option default to 1,
    and move 'http_expiration_time' to the [options] section (from the
    [general] one).

* viewcvs/viewcvs.conf.dist
  (cfg.options.generate_etags): New.
  (cfg.options.http_expiration_time): Was cfg.general.http_expiration_time.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@865 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-06-23 20:57:16 +00:00
cmpilato 3e73713c17 Add a debug setting which promises to restore my sanity in the face of
Etags and browser caching.  And use it.

* lib/debug.py
  (DISABLE_ETAGS):  New.

* lib/viewcvs.py
  (check_freshness): If DISABLE_ETAGS is set, never report that the
    page is fresh.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@863 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-06-22 14:12: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 d30f21f382 bugfix in PrintException. code was checking to see the exception type
was an instance of ViewCVSException instead of the exception object.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@663 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-06-26 17:07:10 +00:00
rey4 b0178f0511 bugfix in PrintException()
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@656 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-06-02 18:53:12 +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
gstein f30b808cc7 Restore the ability for errors to generate non-200 responses. This was
broken when sapi was introduced.

* lib/debug.py:
  - import 'sys' at the global level since it is fast enough, and we
    also want to be able to grab the exc_info() without any imports
  (ViewCVSException.__init__): rename var to 'status' as it represents
    the HTTP Response Status rather than an "http code"
  (ViewCVSException.__str__): revamp the output a bit for cleaner
    display within a traceback.
  (PrintException): grab the exception early, so that other code can't
    overwrite it. if necessary, pass an HTTP response to
    server.header(). tweak a bit of the exc_info() result handling.
    tweak the generated output.

* lib/sapi.py:
  (CgiServer.header): take and output an HTTP response status.
  (AspServer.header): take an HTTP response status. don't worry about
    returning 0/1 from the call (the result is unused)
  (ModPythonServer.header): take an HTTP response status. drop the
    return value.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@639 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-11 23:11:57 +00:00
rey4 418e33776e Restored the line that deletes the return of exc_info() in PrintException(). Also added a try/finally block to make the exception-printer exception-safe.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@635 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-28 01:08:10 +00:00
gstein 6227db7a91 Various small changes:
- fix syntax to be Python 1.5.2 compatible
  - no += operator
  - no "value in dict" operations
- remove a,b=c,d types of assignments; there is no reason to do tuple
  packing/unpacking; just use two assignments
- rename ViewcvsException to ViewCVSException; leave in a grandfather
- couple style nits


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@632 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-27 21:34:57 +00:00
rey4 c95a191275 replaced prints with writes
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@618 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-19 05:31:35 +00:00
rey4 2cb8aa851b added environment variable dump
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@615 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-18 11:56:12 +00:00
rey4 d8b66eebde - fixed debug.PrintStackTrace() function
- updated child process tracker to use the sapi.server.pageGlobals dictionary


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@601 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-11 02:58:04 +00:00
rey4 f6f2654281 - modified popen module to work on windows
- added debugging mode for popen which can display the input and
  output from child processes (only works on windows for now)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@592 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-09 09:57:46 +00:00
gstein 79728fb463 Update copyright years.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@543 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-09-05 07:34:45 +00:00
gstein caf33e7862 Misc updates:
* adjust the timers to take a tag on the start; this allows them to be
  started/stopped independently, rather than needing to nest them

* add a few timers to get some perf info

* removed unused stuff: header_comment and html_link()

* use request.amp_query for the tarball_href


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@413 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-22 11:16:05 +00:00
gstein fcec542cfb Add a new debug module for developers to do timing/profiling and similar
tasks. Add a bit of instrumentation for EZT template parsing.

Add whitespace reduction to EZT. On my box, this doubles the parse time of
directory.ezt from .03 to .06 seconds, and log.ezt from 0.047 to 0.1
seconds. (about double in both cases) My two samples showed a reduction in
the response size by about 25%.

Instrument the overall execution of ViewCVS to examine relative percentage
of template parsing.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@341 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-18 12:54:40 +00:00