Commit Graph

63 Commits (master)

Author SHA1 Message Date
Vitaliy Filippov 8b3d3363f2 Use non-destructive subconfigs instead of in-place per-root patching of config object 2013-11-20 17:03:33 +04:00
Vitaliy Filippov 56c2b61458 Merge with original r2905 2013-07-18 19:13:28 +04:00
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 6fe390a642 Move a customization out of ezt.py to eliminate unnecessary deltas
against the upstream version of this module.

* lib/common.py
  (TemplateData): Moved here...

* lib/ezt.py
  ...from here.

* lib/query.py,
* lib/viewvc.py
  Import 'TemplateData' from 'common' now, and update references to this
  relocated class.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2711 8cb11bc2-c004-0410-86c3-e597b4017df7
2012-01-04 15:35:12 +00:00
stilor c6775f5b89 * common.py
New file to house common definitions; _item and _RCSDIFF_*
  for now. Remove local definitions in the rest of modules.

* idiff.py
  (sidebyside, unified): Return _RCSDIFF_NO_CHANGES type if
  the generator failed to yield anything else.
  (sidebyside): Add type attribute to the returned tuple so
  that template can check the type.

* diff_display.ezt
  (top-level): Define messages to be used if diffs cannot be
  displayed. Use the definitions in all non-raw displays.
  (sidebyside,unified): Handle _RCSDIFF_IS_BINARY and
  _RCSDIFF_NO_CHANGES; the former is not returned yet - will
  be passed to the template once properties are diffed.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/property-diff@2605 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-01 06:33:22 +00:00
cmpilato 61bcf03fcd Fix (to the degree that I believe is reasonable at this time) issue
#433 ("queries return only partial results").  When a database query
is artificially limited by the 'row_limit' setting, inform the user
that the returned data is incomplete.

* lib/cvsdb.py
  (CheckinDatabase.CreateSQLQueryString): Add 'detect_leftover'
    parameter, used internally to check for a reached query limit.
  (CheckinDatabase.RunQuery): Update call to CreateSQLQueryString(),
    and check for leftover query response rows.  If any are found, set
    the appropriate flag on the query object.
  (CheckinDatabaseQuery.__init__): Set initial values for new
    'executed' and 'limit_reached' members.
  (CheckinDatabaseQuery.SetExecuted,
   CheckinDatabaseQuery.SetLimitReached,
   CheckinDatabaseQuery.GetLimitReached,
   CheckinDatabaseQuery.GetCommitList): New functions.

* lib/viewvc.py
  (view_query): Use query.GetCommitList() now instead of poking into
    the query object directly.  Also, check query.GetLimitReached(),
    reporting the findings through the data dictionary (via a new
    'row_limit_reached' item) to the templates.

* lib/query.py
  (run_query): Use query.GetCommitList() now instead of poking into
    the query object directly.  Now return a 2-tuple of commits and a
    limit-reached flag.
  (main): Update expectations of run_query() call.  Populate
    'row_limit_reached' data dictionary item.

* templates/query_results.ezt,
* templates/query.ezt
  Display a warning if the query results are incomplete.

* templates/docroot/styles.css
  (.vc_warning): New style definition.

* docs/template-authoring-guide.html
  Document the new 'row_limit_reached' template item.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2551 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-04-20 14:50:40 +00:00
cmpilato df71275a13 Try to make some sense of the various CVSdb-related limitation
mechanisms, namely by removing the largely redundant "global" limit
and allowing the per-query row limit (which already exist, too) to do
its work.

While here, remove a poorly conceived (but thankfully unhighlighted)
mechanism for overriding the administrative limit on database rows
which was accessible via URL CGI params.

* lib/viewvc.py
  (_legal_params): Remove 'limit' as a legal parameter.
  (view_query): No longer allow an undocumented URL parameter to
    override the admin-declared SQL row limit.  That should have never
    been allowed!

* lib/cvsdb.py
  (CheckinDatabase.__init__): Remove 'row_limit' parameter and
    associated self._row_limit member.
  (CheckinDatabase.CreateSQLQueryString): No longer fuss with
    self._row_limit.  Let the individual query carry the row limit.
  (ConnectDatabase): Update call to CheckinDatabase().

* lib/query.py
  (form_to_cvsdb_query): Now accept 'cfg' parameter, and set the
    query's row limit from the configured defaults.
  (run_query): Update call to form_to_cvsdb_query().

* docs/url-reference.html
  Remove reference to the 'limit' parameter.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2547 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-04-19 20:40:04 +00:00
cmpilato 1d33308f90 Allow users to tell the query script where ViewVC is located while
still generating the same defaults as before.

* conf/viewvc.conf.dist
  (query, query.viewvc_base_url): New section and value.

* lib/config.py
  (_base_sections): Add 'query'.
  (Config.set_defaults): Set default value for cfg.query.viewvc_base_url.

* bin/asp/query.asp,
* bin/cgi/query.cgi,
* bin/mod_python/query.py,
* bin/wsgi/query.fcgi,
* bin/wsgi/query.wsgi,
  Ask the configuration for the location of ViewVC before falling back
  to old defaults.

* templates/query.ezt
  Don't reference unset variables.  Do test the log message for
  empty-ness, dropping a non-breaking space in place where it is.

* templates/include/footer.ezt
  Don't reference unset variables.  

* lib/query.py
  (build_commit): Allow ob.log to be empty.  Don't generate ViewVC
    links if we don't have a base URL for ViewVC.
  (main): Calculate docroot in light of possible absent viewvc_link.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2458 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-09 13:40:42 +00:00
cmpilato a5df176395 Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.

* lib/compat.py
  Remove as unused.

* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
  Replace explicit import and use of the 'string' module with newer constructs.

* bin/standalone.py,
* lib/viewvc.py 
  No longer use 'compat' module.  Replace explicit import and use of
  the 'string' module with newer constructs.

* lib/dbi.py
  Use calender.timegm() instead of compat.timegm().

* lib/vcauth/__init__.py
  Lose unused module imports.

* lib/config.py,
  Replace explicit import and use of the 'string' module with newer
  constructs where possible.  Lose old ConfigParser patch-up code for
  Python 1.5.1.

* lib/vclib/ccvs/ccvs.py
  Replace explicit import and use of the 'string' module with newer
  constructs where possible.  Import _path_join() from bincvs, and use
  it instead of a bunch of copy-and-pasted string join() statements
  throughout.

* lib/vclib/ccvs/__init__.py
  (cvs_strptime): Moved here from the 'compat' module.

* lib/vclib/ccvs/bincvs.py
  (): No longer use 'compat' module.  Replace explicit import and use
    of the 'string' module with newer constructs.
  (_path_join): New, used now instead of a bunch of copy-and-pasted
    string join() statements throughout.

* viewvc-install
  Don't use the 'compat' module any more.

Also, so some rearranging of non-critical bits.

* misc/:              New directory.
* misc/py2html.py:    Moved from 'lib/py2html.py'.
* misc/PyFontify.py:  Moved from 'lib/PyFontify.py'.
* misc/elemx/:        Moved from 'elemx/'.
* misc/tparse/:       Moved from 'tparse/'.
* tools/make-release
  Omit 'misc' directory from releases, too.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 16:49:52 +00:00
cmpilato 1da4f1a0e3 Copyright bumps only.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2349 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-03-29 15:30:00 +00:00
cmpilato 8af29de901 There were too many ways to do something as simple as HTML escaping in
the ViewVC codebase.  Simplify, conjoin, remove, etc.

* lib/sapi.py
  (escape): New function.  *The* preferred HTML-escaping mechanism.
  (Server.escape): New common Server object escape mechanism (which
    uses the aforementioned escape(), of course).
  (CgiServer.escape, WsgiServer.escape, AspServer.escape,
   ModPythonServer.escape): Lose as unnecessary.

* lib/viewvc.py
  (Request.get_form): Escape hidden form variable names and values.
  (htmlify): Remove.
  (): Replace all uses of cgi.escape() and htmlify() with (directly or
    indirectly) sapi.escape().
  
* lib/query.py
  (main): Use server.escape() instead of cgi.escape().

* lib/blame.py
  (HTMLBlameSource.__getitem__): Use sapi.escape() instead of
    cgi.escape().

* lib/idiff.py
  (_mdiff_split, _differ_split): Use sapi.escape() instead of
    cgi.escape().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2344 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-03-11 19:56:22 +00:00
cmpilato 2d091dc582 Some security-related improvements/fixes.
Make per-root authorizer-related configuration work so that admins can
feel comfortable exposing their root listing views again.

Also, make the query interface require that queried roots be
configured (explicitly or implicitly) to use either the 'forbidden'
authorizer or none at all.  This is a security fix, since
administrators might reasonably have thought that if they configured a
root to use another authorizer, the query interface would have honored
that configuration.

* lib/config.py
  (Config.__init__): Now track whether root options have been overlayed.
  (Config.overlay_root_options): Assert that no root options have been
    overlayed (and then noted that they now have).
  (Config.get_authorizer_and_params_hack): New function to workaround
    our inability to un-overlay root-specific options.  It's only the
    query interface and root listing views that really need to act on
    multiple roots at once, and really only the authorization options
    that matter there anyway.
  (Config.get_authorizer_params): Remove per-root overlay hacks from
    this function.

* lib/viewvc.py
  (Request.run_viewvc): Update call to setup_authorizer() (to not
    specify the rootname).
  (setup_authorizer): Make the rootname parameter option, as a flag
    for whether to consult the current configuration or instead use
    the hack which manually digs around for per-root overrides of
    authorizer stuffs.

* lib/query.py
  (is_forbidden): Don't try to apply the 'forbidden' authorizer where
    some other (or no) authorizer has been configured for a given
    root.  But do complain if another authorizer has been configured,
    rather than simply letting stuff leak through that an
    administrator might reasonably expect to have been hidden.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2300 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-12-03 06:04:32 +00:00
cmpilato fe6b7afb66 * lib/query.py
(run_query): Expand roots so we're playing with a full deck.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2297 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-12-03 05:57:22 +00:00
vfilippov 6835e74f20 Merge with ViewVC 1.2-dev http://viewvc.tigris.org/svn/viewvc@2204
git-svn-id: svn://svn.office.custis.ru/3rdparty/viewvc.org/trunk@184 6955db30-a419-402b-8a0d-67ecbb4d7f56
2009-06-16 14:11:20 +00:00
cmpilato 92a95601d1 Bump copyright years.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2146 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-05-05 17:08:54 +00:00
cmpilato 63af297920 Try to make ViewVC provide a consistent, predictable data dictionary
in all of its templated views.  Do this with a custom, dictionary-like
class that prevents the creation of new keys after an initial
instantiation of keys and (possibly dummy) values.

* lib/ezt.py
  (TemplateData): New.

* lib/viewvc.py
  (common_template_data): Now return an ezt.TemplateData() object.
  (make_comma_sep_list_string): New.
  (markup_or_annotate): Use new ezt.TemplateData() interface now.  Use
    make_comma_sep_list_string() where applicable.
  (view_roots, view_log, view_cvsgraph, view_diff, view_revision,
   view_queryform, view_query): Use new ezt.TemplateData() interface now.
  (view_directory): Use new ezt.TemplateData() interface now.  Drop
    'search_re_form' dictionary item.

* lib/query.py
  (main): Use new ezt.TemplateData() interface now.  While here, drop
    'script_name' calculation (it isn't used).

* templates/include/dir_header.ezt
  Display the search form if 'search_re_action' is set, not 'search_re_form'.

* docs/template-authoring-guide.html
  Remove 'search_re_form'.  Update 'search_re_action' description.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2123 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-03-24 16:55:25 +00:00
vfilippov 3187e57026 None
git-svn-id: svn://svn.office.custis.ru/3rdparty/viewvc.org/trunk@28 6955db30-a419-402b-8a0d-67ecbb4d7f56
2008-11-18 13:49:12 +00:00
vfilippov 13b23a5696 total plus/minus lines
git-svn-id: svn://svn.office.custis.ru/3rdparty/viewvc.org/trunk@23 6955db30-a419-402b-8a0d-67ecbb4d7f56
2008-11-14 17:57:57 +00:00
vfilippov 585580ec57 bug 37020
Ability to connect to MySQL through UNIX socket
diff links in query.py are shown now (moved expand_root_parents to config.py)
full-text comment searches in query and query_form are supported using MySQL FULLTEXT indexes
<select> for repository selection in query


git-svn-id: svn://svn.office.custis.ru/3rdparty/viewvc.org/trunk@5 6955db30-a419-402b-8a0d-67ecbb4d7f56
2008-11-11 14:25:07 +00:00
vfilippov f3aa325419 bug 37020
viewvc 1.1.0-beta1 initial commit


git-svn-id: svn://svn.office.custis.ru/3rdparty/viewvc.org/trunk@4 6955db30-a419-402b-8a0d-67ecbb4d7f56
2008-11-11 14:17:41 +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 0e129c4c77 Forward-port the r1800 bugfixes made in the 1.0.x branch, whose log
message read thusly:

   On the 1.0.x branch:
   
   Fix buglets (and minor security leak) related to the files attached
   to commit items in the query view and query.cgi script results.  These
   views still returned commit objects with all attached metadata even
   when all the files associated with that commit were blocked due to
   configured forbiddenness.  The generic query.ezt template masked this
   bug (because it was keyed on the files more so than on the commit
   items), but query_results.ezt revealed it.  Also, we were doing change
   limiting at the wrong time, so you'd get results that showed 2 files
   but read "Only first 5 files shown...".
   
   * lib/viewvc.py
     (build_commit): Trade the 'limited_files' parameter for a
       'max_files' parameter, and change the way file counting and
       filtering happens so we get accurate file counts and the maximum
       number of allowed files when limiting changes.  Now returns None
       if the would-be-returned commit item has no associated allowed
       files, and defers building of the commit item until necessary.
     (view_query): Don't do file limiting here, defer it to
       build_commit().  Also, watch for (and ignore) None returns from
       build_commit(), too.
   
   * lib/query.py
     (run_query): Strip out commits which have no associated files.
       Since commits in the query view are file-driven, the only way we
       could have a commit that has no files is if the files were
       stripped by forbiddenness checks.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1804 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-21 20:26:58 +00:00
cmpilato 01b87f562e The disconnected query interface throws all the root-centric handling
convention of ViewVC into a tizzy, so rework the way the auth handling
stuff works there.  We'll get root-specific handling of 'forbidden'
out of this as a result.

* lib/query.py
  (is_forbidden): New.
  (build_commit): Lose the 'auth' parameter, and call is_forbidden to
    determine if a given result may be displayed.
  (run_query): No longer grab an Authorizer object.  Update calls to
    build_commit().




git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1673 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-06 20:32:17 +00:00
cmpilato feca32c985 For issue #268: Merge the Authorizers' check_directory_access() and
check_file_access() functions into a single check_path_access().  Most
authorizers won't need to care about the distinction.

* lib/vcauth/__init__.py
  (GenericViewVCAuthorizer.check_path_access): New, replaces ...
  (GenericViewVCAuthorizer.check_file_access,
   GenericViewVCAuthorizer.check_directory_access): ...these
    now-removed functions.
  (ViewVCAuthorizer.check_path_access): New.
  (ViewVCAuthorizer.check_file_access,
   ViewVCAuthorizer.check_directory_access): Removed.

* lib/vcauth/forbidden/__init__.py
  (ViewVCAuthorizer.__init__): Squirrel away 'root' so we can use it ...
  (ViewVCAuthorizer.check_path_access): ...here.  Was
    check_directory_access(), and now optionally checks the path's type
    before making the access determination.
  (ViewVCAuthorizer.check_file_access): Removed.

* lib/vcauth/svnauthz/__init__.py
  (ViewVCAuthorizer.check_path_access): Was _check_path_access().  Add
    'rev' parameter.
  (ViewVCAuthorizer.check_file_access,
   ViewVCAuthorizer.check_directory_access): Removed.

* lib/viewvc.py
  (Request.run_viewvc, view_directory, _get_diff_path_parts,
   generate_tarball, view_revision, build_commit): Use the
    authorizor's check_path_access() instead of the now-removed
    check_directory_access() and check_file_access() functions.

* lib/query.py
  (build_commit): Use check_path_access() instead of
    check_directory_access().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1661 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-15 20:18:56 +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 0c773e789b Finish issue #287 by ensuring that in a clash of root names, the
first-listed, cvs_roots-found, CVS repository wins.

* lib/query.py
  (run_query): Ensure that in a rootname clash situation, the CVS
    repository wins.

* lib/viewvc.py
  (list_roots): Ensure that in a rootname clash situation, the CVS
    repository wins.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1605 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-13 09:14:12 +00:00
cmpilato 0dfb93969d Update copyright years.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1590 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-10 15:26:36 +00:00
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