* 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
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
(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
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
* 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
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
(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
* 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
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
<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
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
- 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
- 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
* 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
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