1
0
mirror of https://github.com/vitalif/viewvc-4intranet synced 2019-04-16 04:14:59 +03:00

Compare commits

..

1928 Commits

Author SHA1 Message Date
cmpilato
3af8715ce8 Tag the 1.1.12 final release.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/tags/1.1.12@2665 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-11-03 14:32:34 +00:00
cmpilato
97c5a82b7b Let's release 1.1.12 today.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2664 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-11-03 14:27:51 +00:00
cmpilato
21bd391d62 Document a missing template data item (patch_href).
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2663 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-11-03 14:22:25 +00:00
cmpilato
9d1476ef1d Merge from trunk r2657, whose log message read like so:
Finish issue #495 ("Syntax highlight/colorize scripts without
   extensions").
   
   * lib/viewvc.py
     (markup_stream_pygments): Failing all else, use the Pygments
       guess_lexer() function to guess a file's content type from the
       first line of its text.  (Most of this patch is compensation for
       the first that if this heuristic codepath is traversed, we've eaten
       a line of text from the file object that we don't expect to have
       been eaten.
   
   Patch by: Chris Mayo <cjmayo{__AT__}tigris.org>
             (Tweaked by me.)

Also:

* CHANGES:
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2658 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-31 21:42:38 +00:00
cmpilato
151fcd05e6 Merge from trunk r2653, which did the following:
Finish issue #470 ("No links to repository root logs").
   
   * lib/viewvc.py
     (view_roots): Generate a log_href -- the revision log for the root
       directory of the repository -- where it makes sense to do so.
   
   * templates/roots.ezt
     Markup the last-modified-revision as a link to the log view where
     we can.

   * docs/template-authoring-guide.html
     Note the additional data dictionary item.

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2654 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-28 19:30:36 +00:00
cmpilato
22400ddcfb * docs/template-authoring-guide.html
Update <title> and <h1> to reflect that this document is for ViewVC
  1.1, not 1.0.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2636 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-21 14:02:23 +00:00
cmpilato
ae55530edc Record the change made in r2630.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2631 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-17 20:06:02 +00:00
cmpilato
112700a12c * lib/sapi.py
(WsgiServer.escape): Remove as unnecessary and, indeed, incorrect
    per issue #454.

Reported by: Ennio Zarlenga <wzzxo{__AT__}yahoo.fr>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2630 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-17 20:04:07 +00:00
cmpilato
cecffecf39 Merge from trunk r2609 (fixed pointer to Subversion website).
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2610 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-10-04 15:00:01 +00:00
cmpilato
bdac8697fe Merge from trunk r2599:
Loop until receiving a definitive answer to the interactive overwrite
   query, rather than croaking on an empty response.
   
   * viewvc-install
     (install_file): If raw_input() return an empty string, re-ask the
       question.
   
   Patch by: Alexey Neyman <stilor@att.net>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2600 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-09-30 19:11:27 +00:00
cmpilato
3d9404b67d Merge from trunk r2597, whose log message read like so:
Fix issue #494 ("allow override config from in mod_python").  This
   commit allows environmental overrides to trump programmatically
   passed-in configuration paths.
   
   * INSTALL
     Mention the VIEWVC_CONF_PATHNAME override environment variable.
   
   * lib/viewvc.py
     (load_config): Document this function and the order in which it
       searches for a configuration path.  Use server.getenv() instead of
       os.environ.get() where we can so that environmental overrides work
       in mod_python.
   
   Patch by: Alon Bar-Lev <alon.barlev@gmail.com>
             (Tweaked by me.)

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2598 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-09-30 15:50:31 +00:00
cmpilato
7c50f55153 Merge from trunk r2593:
* conf/viewvc.conf.dist
  Note the importance of the MIME type maps for syntax coloration, and
  point folks to the 'mime_types_files' option.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2594 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-09-14 17:54:10 +00:00
cmpilato
368e4dc360 Merge from trunk r2591, which added to viewvc.conf.dist descriptions
of the various optionally "allowed_views".


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2592 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-09-07 17:44:18 +00:00
cmpilato
964d8bb5f9 Merge from trunk r2588, whose log message went a little som'thin' like this:
* bin/svndbadmin
     Fix a minor buglet in the usage message.

   Reported by: Jean-Yves Avenard <jyavenard@gmail.com>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2589 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-07-01 17:58:19 +00:00
cmpilato
846e8e46c5 Merge from trunk r2586, whose log message read like so:
(More) gracefully handle some errorful input conditions.
   
   * lib/vclib/svn/svn_ra.py
     (RemoteSubversionRepository._getrev): Re-raise all exceptions as
       InvalidRevision exceptions.
   
   * lib/vclib/svn/svn_repos.py
     (LocalSubversionRepository._getrev): Re-raise all exceptions as
       InvalidRevision exceptions.
   
   Found by:  Daniel Shahaf <d.s@daniel.shahaf.name>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2587 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-06-23 15:25:59 +00:00
cmpilato
75c719bcde Merge from trunk r2405:
Finish issue #441: Allow "rNNN" formatting for Subversion revision
   specifiers.
   
   * lib/vclib/svn/svn_repos.py (LocalSubversionRepository._getrev),
   * lib/vclib/svn/svn_ra.py (RemoteSubversionRepository._getrev):
     Now accept revision strings that begin with 'r'.
   
   Patch by: Daniel Shahaf <d.s{__AT__}daniel.shahaf.name>
             (Tweaked by me.)
   
and r2584:

   Fix issue #488 ("Allow 'rrNNN' formatting for Subversion revision
   specifiers (with multiple 'r')").
   
   * lib/vclib/svn/svn_ra.py
     (RemoteSubversionRepository._getrev): Accept multiple leading 'r's
       in revision specifiers.
   
   * lib/vclib/svn/svn_repos.py
     (LocalSubversionRepository._getrev): Accept multiple leading 'r's
       in revision specifiers.
   
   Patch by:  Daniel Shahaf <d.s@daniel.shahaf.name>

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2585 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-06-23 15:14:57 +00:00
cmpilato
fc8793bf15 Merge from trunk r2582 which contained only doc tweaks.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2583 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-06-14 13:31:35 +00:00
cmpilato
65935c40fd Merge from trunk r2580, whose log message read like so:
Fix issue #486 ("OperationError raised when trying to do a glob search").
   
   Add code to workaround the fact that in Python 2.6,
   fnmatch.translate() stopped returning strings that ended with '$'
   (which work fine as MySQL regular expressions) and started instead
   returning strings that ended with '\Z(?ms)' (which... don't).
   
   * lib/cvsdb.py
     (CheckinDatabase.SQLQueryListString): If the returned regexp ends
       with '\Z(?ms)', replace those characters with a single '$'

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2581 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-06-06 20:05:27 +00:00
cmpilato
a30d0b44cc Merge from trunk r2577, whose log message read like so:
Fix issue #485 ("Patch view hiding path details").
   
   * lib/viewvc.py
     (diff_parse_headers): Add 'path1' and 'path2' parameters, and use
       those paths in the returned header lines.
     (view_patch, view_diff): Pass paths into diff_parse_headers() now.

Also:

* CHANGES
  Record this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2578 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-05-27 19:00:20 +00:00
cmpilato
fded8462d2 Add placeholder for 1.1.12 changes.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2576 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-05-17 12:50:37 +00:00
cmpilato
b1095ac763 Begin a new release cycle.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2575 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-05-17 12:38:54 +00:00
cmpilato
e54399a169 Let's try to roll 1.1.11 today, shall we?
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2572 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-05-17 12:23:20 +00:00
cmpilato
4cc0db75be Merge from trunk r2569 and r2570, which just updated some copyright years.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2571 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-05-17 12:21:27 +00:00
cmpilato
74a9cbb2a0 Minor wording, spelling, and ordering tweaks.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2568 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-05-17 11:49:31 +00:00
cmpilato
390e337a8e * bin/standalone.py
(main): Was cli().  Caller(s) updated.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2567 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-05-12 19:01:48 +00:00
cmpilato
ecdac77d5f Merge from trunk r2565, whose modified-per-conflict-resolution log
message might read something like this:

   Add '--help' option to standalone.py.
   
   * bin/standalone.py
     (usage, badusage): New functions.
     (cli): Separate the option parsing from the option validation.  Add
       support for a '--help' option.  On bad input, now print a suggestion
       to run the script with '--help' for usage hints.

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2566 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-05-12 19:01:05 +00:00
cmpilato
79158c2ee7 Merge from trunk r2559-2563, which is a bunch of tweaks to the
standalone.py usage message and options handling.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2564 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-05-12 13:50:05 +00:00
cmpilato
96fdfbdbcf Merge from trunk r2557, whose log message read like so:
Fix issue #444 ("ViewVC stumbles over revisionless ,v files when
   sticky tag is specified").
   
   * lib/vclib/ccvs/bincvs.py
     (_get_logs): Only try to skip the "rest of the file" if there's
       reason to believe there's a "rest of the file".  While here,
       ensure that the 'tag' variable is defined in all cases (though it
       shouldn't matter).

Also:

* CHANGES
  Record this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2558 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-05-05 14:39:22 +00:00
cmpilato
361538da21 Merge from trunk r2555, whose log message read like so:
Fix issue #483 ("Error skipping newphrases when parsing RCS data").
   
   * lib/vclib/ccvs/rcsparse/common.py
     (_Parser.parse_rcs_admin): Chew up newphrases found while parsing
       the admin block.
   
   Patch by: Giovanni Pellicciotta <giovanni.pellicciotta@anubex.com>

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2556 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-04-21 16:06:23 +00:00
cmpilato
6250d4134b Merge some spelling fixes from trunk's r2553 here.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2554 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-04-20 15:02:08 +00:00
cmpilato
8589949521 Merge from trunk r2550 and r2551, whose combined log messages might
read like so:

   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.GetCommitsTable): New helper.
     (CheckinDatabase.AddCommit, CheckinDatabase.CheckCommit,
      CheckinDatabase.sql_delete): Use new GetCommitsTable() helper
       instead of hard-coding the version-specific selection of the
       commits table.
     (CheckinDatabase.CreateSQLQueryString): Add 'detect_leftover'
       parameter, used internally to check for a reached query limit.
       Also, use new GetCommitsTable() helper.
     (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.
   
   * conf/viewvc.conf.dist
     (row_limit, rss_row_limit): Make it clear what exactly is getting
       limited here.

Also:

* CHANGES:
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2552 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-04-20 14:56:39 +00:00
cmpilato
f12e262fa5 Merge from trunk r2547, whose log message read like so:
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.

Also:

* CHANGES
  Note this change, referring to it as a 'security fix' due to the
  ramifications of allowing folks to query your potentially monstrous
  database while ignoring your configured response set limits.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2548 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-04-19 20:44:05 +00:00
cmpilato
f379070697 Merge from trunk r2545, whose log message read something like this:
Fix (I think...) issue #479 ("annotate a file, which uses
   CVS-keywords").  This changes causes the checkout of CVS file
   contents -- when used as part of the markup/annotate logic -- to not
   expand keywords.  This helps it to be consistent with the results of
   the annotate information query.
   
   * lib/vclib/__init__.py,
   * lib/vclib/svn/svn_ra.py,
   * lib/vclib/svn/svn_repos.py
   * lib/vclib/ccvs/ccvs.py
     (openfile): Add 'options' parameter (unused).  Callers updated.
   
   * lib/vclib/ccvs/bincvs.py
     (openfile): Add 'options' parameter, and look for a 'cvs_oldkeywords'
       option to govern the use of -kkv or -ko in the 'co' command.
       Callers updated.
   
   * lib/viewvc.py
     (markup_or_annotate): Pass 'cvs_oldkeywords' option to repos.openfile().

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2546 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-04-01 17:02:07 +00:00
cmpilato
d47fc0ff3b Merge from trunk r2543 (with some tweaks to use the 'string' module
functions), whose log message looks like so:

  Fix issue #477 ("Large log messages trigger excessive memory
  consumption").
  
  * lib/viewvc.py
    (ViewVCHtmlFormatter._tokenize_text): Switch to a line-based
      approach.  This provides a *vast* improvement in performance and
      memory usage, especially for large log messages with many
      mark-up-able regions.

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2544 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-04-01 14:43:01 +00:00
cmpilato
f2b6f0ba86 Merge from trunk r2541, whose log message read like so:
Finish issue #478 ("Client-facing unhandled exceptions, traceback
   dumped") by raising a cleaner error message when asked to display a
   "checkout" of a non-file.
   
   * lib/viewvc.py
     (view_checkout): If the target isn't a file, raise a
       ViewVCException().

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2542 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-03-29 16:41:09 +00:00
cmpilato
ddbe150be1 Merge from trunk r2538, which did a little something like this:
* bin/standalone.py
     (main): Fix broken option handling: -d expected an argument, -c
       didn't and was doubly associated with both --config-file and
       --htpasswd-file.

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2539 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-03-15 20:42:42 +00:00
cmpilato
6b5ed7c857 Begin a new release cycle.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2537 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-03-15 16:37:38 +00:00
cmpilato
391f7d8237 Let's get 1.1.10 out today.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2534 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-03-15 14:57:50 +00:00
cmpilato
141cf5ff10 * CHANGES
Tweak description of a change to not leave room for interpretation that
  the bug was a security vulnerability.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2533 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-03-15 14:56:15 +00:00
cmpilato
bfe148eb45 Merge from trunk r2531, whose log message read like so:
Hopefully, fix issue #475 ("regression: required authorization to
   root") and issue #476 ("Stack trace for some users if last commit
   deleted a file or folder") by preventing ViewVC from trying to look up
   the path type of a deleted path at an invalid location.
   
   * lib/vclib/svn/svn_repos.py
     (LocalSubversionRepository._gettype): New helper function.
     (LocalSubversionRepository.itemtype): Now use _gettype() helper.
     (_get_change_copyinfo): New helper.
     (_simple_auth_check): Rework this function to definitively resolve
       the path type of paths it passes through the authz system,
       handling the complication of determining the path of a now-deleted
       path by consulting its last location prior to deletion.

Also:

* CHANGES
  Note this change, sadly confessing to introducing a regression.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2532 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-03-11 20:22:58 +00:00
cmpilato
6fb28f2198 Add some helpful URLs to the release instructions. (Merged /trunk:2529.)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2530 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-02-18 20:02:37 +00:00
cmpilato
02cc53d34b Begin a new release cycle.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2528 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-02-18 19:56:28 +00:00
cmpilato
5928918da4 Merge from trunk r2524, a bump in copyright years.
(Also includes an accidental commit to CHANGES naming today as the
1.1.9 release date.  Which sounds good.  What say you?)

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2525 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-02-18 19:27:50 +00:00
cmpilato
2e9f84427c Merge from trunk r2522:
* conf/viewvc.conf.dist (log_pagesextra): Set value to match defaults.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2523 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-02-18 18:28:55 +00:00
cmpilato
df599031a0 Merge from trunk r2519:
Followup to r2517, for issue #457.
   
   * templates/roots.ezt
     Also show the last author, and mark only the "Name" header as the
     sort choice.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2520 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-02-18 16:57:47 +00:00
cmpilato
6311c93298 Merge from trunk r2517, whose log message might be interpreted like so:
Finish issue #457 ("Display repository metadata (last-commit stuff) in
   roots view").
   
   * lib/viewvc.py
     (view_roots): Include revision metadata in the data dictionary.
     (list_roots): If configured to do so, calculate some last-modified
       metadata for Subversion roots.
   
   * lib/config.py
     (Config.set_defaults): Set default value for new show_roots_lastmod
       option.
   
   * conf/viewvc.conf.dist
     (show_roots_lastmod): New option.
   
   * templates/roots.ezt
     Show some roots metadata if configured to do so.
   
   * docs/template-authoring-guide.html
     Document new 'roots' view data dictionary items.

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2518 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-02-18 15:29:11 +00:00
cmpilato
b982cccbcd Merge from trunk r2514, whose log message read like so:
Finish issue #455 ("ViewVC 1.1.x missing URL parsing in file contents
view").

* lib/viewvc.py
  (_re_rewrite_escaped_url): New compiled regexp.
  (markup_escaped_urls): New helper function.
  (markup_stream_pygments): Use markup_escaped_urls() to wrap URLs in
    <a> tags, something Pygments won't do for us.

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2516 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-02-17 16:12:54 +00:00
cmpilato
33b8224714 Minor wording tweaks.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2515 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-02-17 16:11:45 +00:00
cmpilato
2f05f570b1 Merge from trunk r2512 which looked a little somethin' like this:
* lib/vclib/svn/__init__.py
     (canonicalize_rootpath): Per the thought found in issue #446
       ("Specifying repo location using file:// prefix in svn_roots leads
       to lack of hyperlinks on revision view"), convert file:/// and
       file://localhost/ URLs into local paths.

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2513 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-02-16 20:34:37 +00:00
cmpilato
d737657e1d Merge from trunk r2509, whose log message read like so:
Make what should be some decent performance improvements in the
   Subversion revision metadata harvesting logic.
   
   * lib/vclib/svn/svn_repos.py
     (LocalSubversionRepository._revinfo): Split this into two logical
       codepaths, one that needs changed-path information along with the
       revision metadata, one which does not.  (Because if we don't need
       it, there are faster ways to get what we *do* need.)

Also:

* CHANGES:
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2510 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-02-14 16:00:40 +00:00
cmpilato
3d5294635e Merge from trunk r2507, which is just some code re-org business:
* lib/vclib/svn/svn_repos.py
     (_get_history, _log_helper): Move these into...
     (LocalSubversionRepository._get_history,
      LocalSubversionRepository._log_helper): ...here.  Update callers.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2508 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-02-11 21:18:11 +00:00
cmpilato
75c3fc2346 Merge from trunk r2505, which did something like this:
* lib/vcauth/svnauthz/__init__.py
     (ViewVCAuthorizer._get_paths_for_root): Trap and return a cleaned-up
       error when the authzfile isn't parse-able.

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2506 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-02-11 16:57:52 +00:00
cmpilato
80bce159af Clarify that Python 3.x is not yet supported. (Merged /trunk:r2502)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2503 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-02-07 14:49:01 +00:00
cmpilato
7ff9b84ee1 Merge from trunk r2500, whose log message read like so:
* lib/vclib/svn/svn_ra.py
     (client_log): Check for the correct exception.
   
   Reported by: Phil Jeary <Phil.Jeary@dovetailservices.com>

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2501 8cb11bc2-c004-0410-86c3-e597b4017df7
2011-01-04 19:28:10 +00:00
cmpilato
b6acd3c114 Merge from trunk r2498, whose log message read like so (after I corrected it. twice.):
Make the number of "extra pages" of log output configuration.  (An old
   TODO item I'd forgotten about.)
   
   * lib/config.py
     (Config.set_defaults): Set cfg.options.log_pagesextra default value.
   
   * lib/viewvc.py
     (EXTRA_PAGES): Removed.
     (paging_sws): Add 'extra_pages' parameter, used instead of static
       EXTRA_PAGES variable.
     (view_log): Update call to paging_sws().  Replace uses of static
       EXTRA_PAGES with cfg.options.log_pagesextra.
   
   * conf/viewvc.conf.dist
     (log_pagesextra): New configuration item.

Also:

* CHANGES
  Record this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2499 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-12-09 17:14:20 +00:00
cmpilato
fa5d40caa3 Merge from trunk r2496, whose log message read like so:
Fix issue 425 ("Authorization subsystem needs some optimization").
   Give the 'vcauth' subsystem a way to make universal access
   determinations, which can seriously improve performance in situations
   where a user has universal read access to a repository.
   
   * lib/vcauth/__init__.py
     (GenericViewVCAuthorizer.check_universal_access): New skeletal function.
     (ViewVCAuthorizer.check_universal_access): New function.
   
   * lib/vcauth/svnauthz/__init__.py (ViewVCAuthorizer.check_universal_access),
   * lib/vcauth/forbidden/__init__.py (ViewVCAuthorizer.check_universal_access),
   * lib/vcauth/forbiddenre/__init__.py (ViewVCAuthorizer.check_universal_access)
     New functions.
   
   * lib/vclib/ccvs/bincvs.py
     (BaseCVSRepository.open): New function.
   
   * lib/vclib/svn/svn_repos.py
     (LocalSubversionRepository.open): Now check for universal read access.
   
   * lib/vclib/svn/svn_ra.py
     (RemoteSubversionRepository.open): Now check for universal read access.

Also:

* CHANGES
  Record this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2497 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-12-09 16:22:05 +00:00
cmpilato
a9cbd4c6a6 Begin a new release cycle.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2488 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-12-02 20:59:12 +00:00
cmpilato
882cdaa46b Let's get 1.1.8 out today, m'kay?
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2485 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-12-02 20:46:06 +00:00
cmpilato
58e64cb28d Minor tweak to the release process notes. (Merged /trunk:2483)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2484 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-12-02 20:38:43 +00:00
cmpilato
779e67653b Re-do a bit of conflict resolution from r2479 to reduce release-to-release
delta.

* bin/standalone.py
  (main): Describe --htpasswd-file before --gui now.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2482 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-12-02 20:34:29 +00:00
cmpilato
0381a772b7 Merge from trunk r2480, whose log message read like so:
Issue #472 ("Using view=markup on folder causes errors").
   
   * lib/viewvc.py
     (view_markup, view_annotate): Raise a more graceful error message
       when asked for markup or annotate view on a non-file.

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2481 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-11-30 21:13:17 +00:00
cmpilato
048b2c8033 Merge from trunk r2478, whose log message read like so at the time:
* bin/standalone.py
     (has_crypt, _check_passwd): If 'crypt' isn't available, look for
       'fcrypt' and use it instead.
     (main): Always show --htpasswd-file option, but raise an informative
       error if someone tries to use it when there's no cryptographic support.

Also:

* CHANGES
  Update a change item to reflect the new state of code 'round these parts.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2479 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-11-30 18:26:44 +00:00
cmpilato
e354ab302c Merge from trunk r2476, whose log message read a bit like this:
* lib/config.py
     (Config._is_allowed_section, Config._is_allowed_override): Lose
       unused 'parser' parameter.  Callers updated.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2477 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-11-30 16:44:16 +00:00
cmpilato
5f931c6cf1 Merge from trunk r2473, whose log message read like so:
Fix issue #471 ("standalone.py won't start on Windows: no module named
   'crypt'") by making htpasswd file support optional (based on the
   availability of the 'crypt' module).
   
   * bin/standalone.py
     (): Conditionally import 'crypt' and define _check_passwd()
       helper function.
     (ViewVCHTTPRequestHandler.validate_password): Use _check_passwd() now.
     (main): Conditionally built accepted options list and usage string based
       on whether 'crypt' is available.

Also:

* CHANGES
  Note this fix, and tweak the announcement of Basic authn support for
  standalone.py to note "Unix only".


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2474 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-11-16 16:16:09 +00:00
cmpilato
576837351a Merge from trunk r2471, whose log message read like so:
Fix issue #467 (I think...) by not claiming a particular content
   length when compression would skew that.
   
   * lib/viewvc.py
     (get_writeready_server_file): Add optional 'content_length'
       parameter, and the code to handle it.
     (view_doc): Update call to get_writeready_server_file().

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2472 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-10-05 15:04:32 +00:00
cmpilato
6084ccf877 Begin a new release cycle.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2468 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-09 18:49:00 +00:00
cmpilato
514da91629 Let's release 1.1.7 today, shall we?
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2465 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-09 18:21:15 +00:00
cmpilato
d2c8bb9878 Merge from trunk r2463, which bumps some copyright years.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2464 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-09 18:20:01 +00:00
cmpilato
fe274e9b9c Merge from trunk r2458, r2459, and r2460, whose combined log messages
might read like so:

   Allow users to tell the query script where ViewVC is located while
   still generating the same defaults as before.
   
   Also, fix the query script's WSGI and FastCGI deployments.
   
   * 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.
   
   * lib/sapi.py
     (WsgiServer.FieldStorage): Don't pass self._headers to
       cgi.FieldStorage() -- that parameter is for *input* headers, and
       self._headers is a collection of output headers.
   
   * 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.

Also:

* CHANGES
  Note these changes.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2462 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-09 15:31:52 +00:00
cmpilato
6603a67a91 * CHANGES
Tweak change description.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2461 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-09 15:27:55 +00:00
cmpilato
b50de1c92e Merge from trunk r2454 and r2455, whose log messages contained the
following:

   * lib/vclib/svn/svn_repos.py
     (_split_revprops): Special-case the handling of empty input.
   
   * lib/viewvc.py
     (_re_rewrite_svnrevref): Wrap the regexp with word boundaries.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2456 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-08 18:28:25 +00:00
cmpilato
dfd8dc82f6 Merge from trunk r2452, some release procedure tweaks.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2453 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-08 17:14:44 +00:00
cmpilato
1a942d1062 Merge from trunk r2446.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2449 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-07 19:22:26 +00:00
cmpilato
289a78eb99 Merge from trunk r2444, whose log message read like so:
Finish issue #464: Add support for FastCGI (using a WSGI end-around).
   
   * bin/wsgi/viewvc.fcgi,
   * bin/wsgi/query.fcgi
     New scripts.
   
   * INSTALL
     Note the additional configuration/deployment option.
   
   * viewvc-install
     Install the .fcgi files, too.
   
   Patch by: Mark A. Ziesemer <ziesemer{_AT_}tigris.org>
             (Tweaked minorly by me.)
   
Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2447 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-07 19:20:22 +00:00
cmpilato
2897763020 Merge some typo fixes from trunk (r2441, r2442).
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2443 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-07 15:41:48 +00:00
cmpilato
47886423e5 Merge from trunk r2439, whose log message said a little somethin' like
this:

   Finish issue #113: Support auto-markup of revision references.
   
   * lib/viewvc.py
     (_re_rewrite_svnrevref): New regular expression.
     (ViewVCHtmlFormatter.format_svnrevref): New.
     (format_log): Accept 'request' parameter instead of 'cfg' (which can
       be obtained via the request).  For Subversion repositories,
       register a formatter which marks up revision references as links
       to the revision view.
     (): Update callers of format_log().

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2440 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-07 15:20:10 +00:00
cmpilato
0890821839 Merge from trunk r2435, whose log message contained the following:
* lib/vclib/svn/svn_repos.py
     (BlameSource.__init__): Use client.create_context() instead of
       client.ctx_t() to avoid "NULL proxy object pool" error.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2436 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 16:21:25 +00:00
cmpilato
2903389d3e Merge from trunk r2430, whose log message rock opera production had
the following lyrics:

   Parse the "; charset=..." bit out of Subversion's svn:mime-type
   property, and use it to inform Pygments as to the file's encoding in
   the markup and annotate views (while still providing that information
   to the user agent in the checkout view).
   
   * lib/viewvc.py
     (parse_mime_type): New helper function.
     (calculate_mime_type): Now also return the encoding as possibly
       parsed from the svn:mime-type property.  Callers updated.
     (get_writeready_server_file): Add 'encoding' parameter.
     (markup_stream_pygments): Add 'encoding' parameter which, if
       provided, becomes the encoding passed to Pygments.
     (view_checkout): Pass the encoding as/if provided by
       calculate_mime_type() to get_writeready_server_file().

Also:

* CHANGES
  Record this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2431 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-08-25 20:18:46 +00:00
cmpilato
5bdea369e8 Merge from trunk r2428, whose log message bits were aligned in a
manner roughly similar to the following:

   ViewVC's options are defined and described to be lower-case, with the
   only exception being the freeform [vhost] section values and key-value
   file stuffs.  In those places, user-defined case could be helpful, and
   is certainly not documented as broken.  So allow it, per issue #466.
   
   * lib/config.py
     (Config.load_config, Config.load_kv_files): Override
       ConfigParser.optionxform() to avoid case normalization of
       option names.

Also:

* CHANGES
  Note this change.

(And yes, I'm running out of interesting ways to compose log messages
for merged changes.)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2429 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-08-23 20:29:53 +00:00
cmpilato
3699e8e0c7 Merge from trunk r2426, whose log message read like so:
* lib/viewvc.py
     (ViewVCHtmlFormatter): Was HtmlFormatter.  Which, uh, has the same
       name as an object imported from Pygments.
     (format_log): Track renamed class.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2427 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-08-19 04:19:55 +00:00
cmpilato
55c0b30bc0 Merge from trunk r2424, whose log message read like so:
Empower the revision view for remote Subversion repositories to
   display node kind information and, by extension, links to the markup
   and diff views for files.
   
   * lib/vclib/svn/svn_ra.py
     (RemoteSubversionRepository._revinfo_raw): Tweak _log_cb() inner
       function to make use of the svn_log_changed_path2_t information
       where available.

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2425 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-08-13 17:50:42 +00:00
cmpilato
6fd321529a Merge from trunk r2421, whose log message read thusly:
Build the Subversion client context object correctly (thus avoiding a
   weird NULL proxy object pool error).
   
   * lib/vclib/svn/svn_ra.py
     (RemoteSubversionRepository.open): Use svn_client_create_context()
       instead of svn_client_ctx_t().

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2422 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-08-13 16:20:11 +00:00
cmpilato
531877db4a Merge from trunk r2414, whose log message read thusly:
Finish issue #49 - authentication support for standalone.py.
   
   * bin/standalone.py
     (Options.htpasswd_file): New variable.
     (AuthenticationException): New.
     (ViewVCHTTPRequestHandler.handle_request): Handle AuthenticationException.
     (ViewVCHTTPRequestHandler.validate_password): New.
     (ViewVCHTTPRequestHandler.run_viewvc): If htpasswd authentication is
       enabled, then complain about missing authn creds, and validated
       any presented creds.
     (main): Present and handle the new --htpasswd-file option.  Also, do
       some rudimentary validation of --htpasswd-file and --config-file values.

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2415 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-07-15 20:56:50 +00:00
cmpilato
51df003d8e Merge from trunk r2411, whose log message leans a little this way:
More improvements to standalone.py.
   
   * bin/standalone.py
     (NotViewVCLocationException): New exception.
     (ViewVCHTTPRequestHandler.do_GET, ViewVCHTTPRequestHandler.do_POST):
       Now just thin wrappers around...
     (ViewVCHTTPRequestHandler.handle_request): ...this new function.
     (ViewVCHTTPRequestHandler.is_viewvc): Allow for the case where the
       script alias is empty (a server root deployment).
     (ViewVCHTTPRequestHandler.redirect): Remove as unused (the code's
       been merged into handle_request()).
     (ViewVCHTTPRequestHandler.run_viewvc): Do the is_viewvc() check here
       now.

Also:

* CHANGES
  Note the fix made in this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2412 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-07-15 20:24:45 +00:00
cmpilato
7d05859d7e Merge from trunk r2407 and r2408, which are mostly just some formatting
changes for standalone.py.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2410 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-07-15 19:11:30 +00:00
cmpilato
2e48cd2ba1 Merge from trunk r2403, whose log message read like so:
Fix a bug which prevented 'standalone.py -r REPOS' from being used
   without a configuration file.
   
   * lib/config.py
     (Config.get_authorizer_and_params_hack): Make sure to always return
       a 2-tuple.  Callers will be expecting that, ya know?
   
   Reported by: Daniel Shahaf <d.s{__AT__}daniel.shahaf.name>

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2404 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-06-17 20:09:06 +00:00
cmpilato
267b61f347 Merge from trunk r2401, whose log message read thusly:
Finish issue #453 by teaching ViewVC to display all displayable
   Subversion revision properties.
   
   NOTE: The svn_ra logic attempts to do the right thing when
         pre-Subversion 1.5 libraries are install, but I haven't had the
         chance to actually test this out myself.
   
   * templates/revision.ezt
     Include the props.ezt property handler template fragment for use
     with revision props.  Also, minor markup change to a header.
   
   * templates/docroot/styles.css
     Lose some unnecessary stylation.
    
   * lib/viewvc.py
     (get_itemprops): Lose unused variable has_binary_props.
     (view_revision): Handle new return value from repos.revinfo(),
       processing extra revision props similarly to the way that file/dir
       props are processed and passing them to the template data
       dictionary.
   
   * lib/vclib/svn/svn_ra.py
     Import _split_revprops() from svn_repos.
     (client_log): New compatibility wrapper.
     (add_log): Reformat as an svn_log_entry_receiver_t callback.
     (RemoteSubversionRepository.dirlogs, _date_from_rev): Track changes
       to self.revinfo().
     (RemoteSubversionRepository.itemlog): Now use client_log().
     (RemoteSubversionRepository._revinfo_raw): Now use client_log() and
       return revprops dict, too.
     (_log_cb): Reformat as an svn_log_entry_receiver_t callback.
   
   * lib/vclib/svn/svn_repos.py
     (_split_revprops): New helper.
     (_log_helper, LocalSubversionRepository.dirlogs, _date_from_rev):
       Track changes to repos._revinfo().
     (_revinfo): Use _split_revprops(), and now return revprops, too.
     (_revinfo_helper): Now return revprops dict, too.
     (_date_from_rev): 
   
   * lib/vclib/__init__.py
     (Repository.revinfo): Update docstring to indicate that this
       interface now returns a revprops dictionary, too.

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2402 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-06-15 15:20:50 +00:00
cmpilato
7f53d5cc3c Merge from trunk r2399, whose log message read like so:
Offer a little more help to folks trying to configure the root_parents
   option.
   
   * conf/viewvc.conf.dist
     (root_parents): Rewrite the documentation for this to be more clear
       and to note the valid root type strings.
     
   * lib/viewvc.py
     (Request.run_viewvc, expand_root_parents): Make some error strings
       provide more helpful information.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2400 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-06-03 19:43:43 +00:00
cmpilato
af591ed9f7 Minor process and verbiage tweak. (Merge from trunk r2393.)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2394 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-06-02 14:38:23 +00:00
cmpilato
17492a3856 Begin a new release cycle.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2389 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-06-02 13:59:23 +00:00
cmpilato
e990ff9f2f And we might as well release 1.1.6 today, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2387 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-06-02 13:24:27 +00:00
cmpilato
d832930c8d Shorten the update/copy instructions. (Merge r2381 from /trunk.)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2382 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-06-02 12:51:07 +00:00
cmpilato
8a0c66c7cf Merge from trunk r2379, whose log message read like so:
Fix issue #452 - Unable to purge data from query database for
   non-existent repository.
   
   * bin/svndbadmin
     (main): Do repository existence checking here, like the corresponding
       code in cvsdbadmin does.  (In fact, structure this function like that
       corresponding cvsdbadmin code.)
     (__main__): No longer do existence checks here.

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2380 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-05-20 19:43:32 +00:00
cmpilato
292c2d7ce0 Merge from trunk r2376-r2377, whose log messages read like so:
Teach the EZT library to handle nested [format] blocks rather than its
   current only-use-the-most-recently-noticed formatter approach.
   
   * lib/ezt.py
     (Template._cmd_format): Rename 'printer' parameter to 'formatter'.
     (_print_formatted): New helper function.
     (_write_value): Now pop/restore the whole stack of formatters, and
       use _print_formatted() to do the real output writing.
     (Context.__init__): Rename 'printers' member to 'formatters'.
       Consumers updated.
     (_raw_formatter, _html_formatter, _uri_formatter): Renamed from
       _raw_printer(), _html_printer(), and _uri_printer() respectively.
       Consumers updated.
     (_xml_formatter): New.
     (_formatters): Renamed from _printers.  Consumers updated.

   Fix issue #451 - ViewVC RSS feed does not correctly escape contents of
   <title>.
   
   * templates/rss.ezt
     Apply the necessary formatting for RSS feed title and description
     elements.  Too bad so many readers have developed their own
     individual ideas about presentation of this under-documented format.

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2378 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-05-20 19:12:26 +00:00
cmpilato
16937af30f Merge from trunk r2374, whose log message read like so:
Fix issue #449 - RSS feed returned with no mime type set
   
   * lib/viewvc.py
     (generate_page): Actually pass the content_type to
       get_writeready_server_file().
   
   Patch by: Tom Throckmorton <throck{_AT_}tigris.org>

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2375 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-05-20 15:08:46 +00:00
cmpilato
d067d49afa Merge from trunk r2372, some rcsparse optimizations.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2373 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-05-20 14:58:14 +00:00
cmpilato
132a01a88f Merge from trunk r2369, whose log message read like so:
Fix issue #454 - AttributeError exception trying to escape non-string input.
   
   * lib/sapi.py
     (escape): Ensure that the input is string-ified before doing string
       transformations on it.

   Patch by: Michael Henry <drmikehenry{__AT__}tigris.org>

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2370 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-05-06 13:53:46 +00:00
cmpilato
4db5103ff1 Merge from trunk r2367, some INSTALL notes.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2368 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-05-05 15:26:44 +00:00
cmpilato
41943f67c5 Merge from trunk r2271, whose log message read thusly:
As part of issue #397, add initial support for mod_wsgi deployments.
   
   * lib/sapi.py
     (WsgiServer): New class.
   
   * bin/wsgi,
   * bin/wsgi/viewvc.wsgi,
   * bin/wsgi/query.wsgi
     New stubs.
   
   * viewvc-install
     (FILE_INFO_LIST): Also install WSGI scripts.
   
   * INSTALL
     Add instructions for WSGI deployment.
   
   Patch (mostly) by: Rune Halvorsen <runefh{_AT_}gmail.com>

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2366 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-05-04 17:23:06 +00:00
cmpilato
1f37623526 Lose bogus MIME type in favicon link tag. (Merge r2364 from trunk.)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2365 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-04-21 19:08:14 +00:00
cmpilato
7e92babad8 Merge from trunk r2362, whose log message read like so:
* lib/viewvc.py
     (view_revision): Include a self-referential 'revision_href' item in
       the template data dictionary.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2363 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-04-14 17:19:28 +00:00
cmpilato
97e45101d9 Begin a new release cycle.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2356 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-03-29 15:51:14 +00:00
cmpilato
62d5a3b649 Bump copyright year in LICENSE.html.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2353 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-03-29 15:37:39 +00:00
cmpilato
c96c585b39 Copyright bumps only.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2350 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-03-29 15:32:43 +00:00
cmpilato
136063e5a7 Update CHANGES file for today's release.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2347 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-03-29 15:24:33 +00:00
cmpilato
f59db1597d Merge from trunk r2344, whose log message read like so:
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().

NOTE: the WsgiServer.escape() change didn't apply to this branch.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2345 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-03-11 20:01:08 +00:00
cmpilato
c6c3f55c2c Begin a new release cycle.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2334 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-03-10 21:28:51 +00:00
cmpilato
8063d46a53 Schedule the release of 1.1.4.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2332 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-03-10 21:22:31 +00:00
cmpilato
fbc7737465 Merge some copyright year bumps.
(Also, an inadvertant commit of a CHANGES typo fix.)

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2331 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-03-10 21:18:17 +00:00
cmpilato
23f3f3ad55 Merge from trunk r2325 and r2326:
* lib/viewvc.py
     (query_backup): Switch to using the sapi interface for output file
       I/O instead of using 'print'.
     (view_queryform): Escape user-provided input before passing it
       directly off to the templates.  Can you say "CSS attack vector"?

Also:

* CHANGES
  Note the security fix.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2327 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-02-10 19:23:06 +00:00
cmpilato
0efc53a373 Merge from trunk r2322 (a docs fix).
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2323 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-01-29 14:31:53 +00:00
cmpilato
0cfe027753 Merge from trunk r2320, whose log message read like so:
Fix issue #447:  Annotate view broken for local SVN repo.
   
   * lib/vclib/svn/svn_repos.py
     (BlameSource.__init__): Add 'config_dig' parameter, and use it to
       register the Subversion configuration directory.
     (LocalSubversionRepository.__init__): Recognize an empty-string
       config_dir as None.  (Yay for configuration file nuances!)
     (LocalSubversionRepository.annotate): Pass self.config_dir to
       BlameSource().
   
   Patch (mostly) by: Jan Parthey <jpar{_AT_}tigris.org>

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2321 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-01-19 15:12:51 +00:00
cmpilato
df3b75cdb0 Merge from trunk r2318, whose log message read like so:
* conf/viewvc.conf.dist
     Comment tweaks, primarily to note in the authorizer parameter
     sections that those options only apply when 'authorizer' has been
     set to the correct respective authorizer name.
   
   Suggested by: Dan Poirier <poirier{_AT_}pobox.com>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2319 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-01-08 17:47:29 +00:00
cmpilato
24dd18bf0f Merge from trunk r2316, whose log message read like so:
Add a bit of a workaround -- which fortunately applies to probably 99%
   of ViewVC users -- for issue #445 (standalone.py throws exception on
   root listing after visiting a root).
   
   * conf/viewvc.conf.dist
     Add warning about using per-root options with standalone.py.
   
   * lib/config.py
     (Config.overlay_root_options): Move the assertion/recording related
       to the one-time-only overlay stuffs down to the point where
       problems might occur.  This gives standalone.py users who don't
       use per-root configuration options the requisite mercy to let
       their servers continue to function.

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2317 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-01-07 16:08:31 +00:00
cmpilato
bbf27f4afd Begin a new release cycle.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2312 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-12-22 20:49:36 +00:00
cmpilato
d4ac97de3c Commit to a release date of today for 1.1.3. Merry Christmas.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2310 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-12-22 19:52:47 +00:00
cmpilato
3039b1f43b Merge from trunk r2308, whose log message was somethin' like this:
* conf/viewvc.conf.dist
     (docroot): Add admonishment about how this interplays with per-root
       configuration of the 'template_dir' option.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2309 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-12-08 17:13:53 +00:00
cmpilato
13597f89cd Merge from trunk r2306, whoc log message read as such:
* conf/viewvc.conf.dist
     Try to consistify the way our admonishments appear herein.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2307 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-12-08 17:06:42 +00:00
cmpilato
870ae9aecc Merge r2303 from trunk (or, the deletion half of the viewvc.org directory
move, at least).

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2304 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-12-04 21:52:11 +00:00
cmpilato
c94b0709ec Merge from trunk r2300, whose log message read thusly:
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.

Also:

* CHANGES
  Note these changes.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2301 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-12-03 06:09:25 +00:00
cmpilato
5632e63bcb * CHANGES
Minor typo fix.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2299 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-12-03 05:59:37 +00:00
cmpilato
ae7b1103f6 Merge from trunk r2297, whose log message read thusly:
* lib/query.py
     (run_query): Expand roots so we're playing with a full deck.

Also:

* CHANGES
  Record this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2298 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-12-03 05:59:15 +00:00
cmpilato
2882178be7 Merge from trunk r2291 and r2292, which can be summarized like so:
* conf/viewvc.conf.dist,
   * lib/config.py
     Take a crack at revamping the configuration subsystem to allow
     for a clear understanding of per-vhost and per-root configuration
     overrides.  This should resolve issue #411 (Can't override
     authz-* sections in virtual host).

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2296 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-12-02 20:35:21 +00:00
cmpilato
bfc59256ca Merge from trunk r2293, whose log message read like so:
Fix issue #442: Standalone server 1.1.2 fails to start under Python 1.5.2
   
   * lib/viewvc.py
     (load_config): Tweak lambda usage for 1.5.2-compliance.

   Patch by:  Dmitry Bulgakov <dvb{_AT_}tigris.org>

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2294 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-12-02 16:04:27 +00:00
cmpilato
3abe695c3c Merge from trunk r2288, whose log message read like so:
* lib/viewvc.py
     (common_template_data): Default 'roots_href' to None, and only
       populate it if the roots listing is one of the configured allowed
       views.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2289 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-12-01 15:01:34 +00:00
cmpilato
624dfdf0f8 Merge from trunk r2286, whose log message read thusly:
Finish issue #440 (Database query by glob/exact match fails).
   
   Defer validation of certain query-view-related input whose format is
   unknown at the time of validation.  That includes all the form fields
   whose interpretation (as an exact match, a blog, a regular expression,
   etc.) changes based on the another field's value.  Instead, do that
   validation in the view funcs themselves.
   
   * lib/viewvc.py
     (_legal_params): Set the validator for the 'branch', 'file', 'who',
       and 'comment' parameters to None.
     (validate_query_args): New function for more careful query arg validation.
     (view_queryform, view_query): Call validate_query_args().

Also:

* CHANGES
  Add "#440" to the list of bugs related to this one problem.  Sheesh.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2287 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-12-01 14:56:21 +00:00
cmpilato
28bf22f279 Merge from trunk r2281, whose log message read like so:
Fix issue #438, a regression caused by a botched function signature
   change in r2244.
   
   * lib/viewvc.py
     (view_checkout, view_cvsgraph_image, view_doc, view_patch): Fix
       calls to copy_stream().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2282 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-11-10 22:18:41 +00:00
cmpilato
830a48f88c Merge from trunk r2279, whose log message read like so:
Make ViewVC cross copies in Subversion history by default.
   
   * lib/config.py
     (Config.set_defaults): Make 'options.cross_copies' default to 1.  At
       a minimum that makes it jive with the commented out default value
       shown in viewvc.conf.dist, but I believe that it's also the better
       of the two ways to resolve that disparity in terms of user experience.
   
   Noticed by: Tom Throckmorton <throck{_AT_}gmail.com>

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2280 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-11-05 16:36:29 +00:00
cmpilato
a23543d763 Merge from trunk r2277, whose log message read like so:
For issue #434, mark up URLs and email addresses in item property
   values as we do for revision property values.
   
   * lib/viewvc.py
     (get_itemprops): Pass property values through format_log().
   
   Patch by: Senthil Kumaran S <senthil@collab.net>

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2278 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-10-25 22:19:24 +00:00
cmpilato
586a183d5c Merge from trunk r2275, whose log message read:
Finish issue #431 - make revision metadata available in diff view.

   * lib/viewvc.py
     (view_diff): Use repos.itemlog() to fetch revision metadata about
     the left- and right-hand diff objects and expose 'author', 'log',
     'ago', and 'size' to the templates.
   
   * docs/template-authoring-guide.html
     Document the newly added template data dictionary items.
   
   * templates/diff.ezt
     Display the revision authors in the diff view.

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2276 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-10-25 20:57:16 +00:00
cmpilato
7ae02a5887 Merge from trunk r2273, whose log message read like so:
Fix a bug that caused log message in the query view to be truncated to
   a single character.
   
   * lib/viewvc.py
     (build_commit): Fix calls to format_log().  It turns out that
       parameter ordering is, you know, somewhat important.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2274 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-10-08 17:54:08 +00:00
cmpilato
4020fd2e5f Merge from trunk r2269 and r2270, which contain some INSTALL file
reformatting/clarification tweaks.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2272 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-10-08 17:46:57 +00:00
cmpilato
af871d59ce Tweak change to note additional issues.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2267 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-09-09 19:10:50 +00:00
cmpilato
b8d36c8c14 Merge from trunk r2265 whose log message read:
Fix issue #427 - regex filtering broken by bogus validator function.
   
   * lib/viewvc.py
     (_validate_regex): Try compiling the incoming regex, returning True
       on success and None otherwise.  (Simply 'pass'ing caused all
       regexs to fail validation.)
   
   Patch by: Robert Fleming <flemingr{_AT_}tigris.org>

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2266 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-09-09 18:58:34 +00:00
cmpilato
4b5721a3d7 Merge from trunk r2263 (a typo fix in a comment).
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2264 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-09-09 16:03:50 +00:00
cmpilato
10235b8fdf Merge from trunk r2261, whose log message read like so:
* conf/viewvc.conf.dist
     (utilities): Clarify what we mean by "the directories in which
       certain programs live".
   
   Suggested by: Eric McCarty <emccarty{_AT_}ostendo.com>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2262 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-09-09 15:58:54 +00:00
cmpilato
45332f577a Merge from trunk r2259, whose log message read:
* templates/file.ezt
     Don't point folks to the checkout view if it's disabled.

Also:

* CHANGES
  Note (generically) this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2260 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-09-09 14:34:55 +00:00
cmpilato
148fd7b462 Merge from trunk r2257, whose log message read like so:
* lib/viewvc.py
     (HtmlFormatter._tokenize_text): Give preference to the longer of
       overlapping matches that begin at the same point.  Add some
       comments that better explain what we're doing.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2258 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-08-31 15:04:01 +00:00
cmpilato
6f66313b51 Merge from trunk r2255, which has some HtmlFormatter improvements.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2256 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-08-27 15:18:20 +00:00
cmpilato
cf32af4816 Merge from trunk r2252, whose log read:
Make the installing of the 'templates-contrib' tree optional.
   
   * viewvc-install
     (TREE_LIST): Add a new field -- a boolean "is-optional" flag.
     (install_tree): New parameter 'is_optional', used to avoid whining when
       something in the source tree is missing.

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2254 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-08-25 15:30:31 +00:00
cmpilato
df3addacdb Merge from trunk r2251, whose log message read:
* lib/viewvc.py
     (view_diff): Tweak some logic ordering, and ensure that 'changes' is
       initialized as a sequence (instead of None) as some template logic
       paths seem to care.

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2253 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-08-25 15:28:12 +00:00
cmpilato
a1428600b7 Merge from trunk r2249, whose log message read thusly:
Add configurable support for tabstop-to-space translation.
   
   * conf/viewvc.conf.dist
     (options.tabsize): New.
   
   * lib/config.py
     (Config.set_defaults): Set default value for the 'tabsize' option.
   
   * lib/viewvc.py
     (markup_stream_pygments): Pass the 'tabsize' parameter to
       Pygments' lexers.  When not using pygments, use 'string.expandtabs'
       to do tab-to-space conversion (possibly with a new object that wraps
       BlameSource objects solely for that purpose).
     (DiffSource._format_text): Honor the tabsize configuration options when
       expanding tabs to spaces.

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2250 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-08-24 15:11:05 +00:00
cmpilato
4a4a3b1d61 Merge from trunk r2247, whose log message read:
Follow-up to r2244 and r2245, supplying a way for the HtmlFormatter to
   indicate that truncation happened (so callers can tack on an ellipsis
   or somesuch).
   
   * lib/viewvc.py
     (HtmlFormatter.format_email_truncated): Fix logic to use ellipsis
       for mangling but not for truncation.  (Also fix an off-by-one
       error in the logic.)
     (HtmlFormatter.get_result): Now return the result string and a
       "was-truncated" flag.
     (format_log): Update call to HtmlFormatter.get_result, and tack on
      an ellipsis if the log was truncated.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2248 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-08-21 15:59:02 +00:00
cmpilato
8c65f1b2c5 Merge from trunk r2244 and r2245, which fixes issue #3 (where truncation of
log messages for display purposes caused marked-up URLs to also be truncated),
and which paves the way for custom bug/issue ID linkification.

* lib/viewvc.py
  See r2244 and r2245.

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2246 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-08-21 15:11:56 +00:00
cmpilato
55046f2261 Begin a new release cycle.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2236 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-08-11 13:09:49 +00:00
cmpilato
b6cedd7c1a Merge 1.0.9 changes, and prep for 1.1.2 release today.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2234 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-08-11 13:03:51 +00:00
cmpilato
771d6736fb Merge from trunk r2228, whose log message read thusly:
Make it easier for folks to show/hide binary file contents in the
   markup/annotate views.
   
   * templates/file.ezt
     Add some customizable template logic to hide the contents of file's with
     non-human-readable file formats.  Were Greg Stein dead, he'd be rolling
     over in his grave right now.

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2229 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-07-16 19:30:25 +00:00
cmpilato
455157e413 Merge from trunk r2225, whose log message read:
* lib/viewvc.py
     (view_error): Settle for simple HTML-escaping of error messages
       rather than full htmlification.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2226 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-07-14 20:45:03 +00:00
cmpilato
c875582cfe Merge from trunk r2223, whose log message read as follows:
Fix issue #422: syntax coloration dropping initial blank lines from
   files.
   
   * lib/viewvc.py
     (markup_stream_pygments): Pass stripnl=False to Pygments lexers so
       they won't strip out leading blank lines from the files they are
       colorizing.

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2224 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-07-13 17:15:58 +00:00
cmpilato
c3d896d5a8 Merge from trunk r2220, whose log message read as follows:
* conf/viewvc.conf.dist
     (allow_compress): Add a note about the speed penalty this option causes.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2221 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-07-07 14:06:18 +00:00
cmpilato
236069b068 Merge from trunk r2217, whose log message read thusly:
Try to avoid content spoofing errors.  Prior to this change, a URL
   like this:
   
      http://localhost/viewvc/subversion/?view=foo%22)%20was%20passed\
      %20as%20a%20parameter.20%20Visit%20http://www.baddy.com%20to%20\
      figure%20out%20why%20(%22foo
   
   Would result in an error page that read as follows:
   
      An illegal value ("foo") was passed as a parameter. Visit
      http://www.baddy.com to figure out why ("foo") was passed as a
      parameter.
   
   (where "http://www.baddy.com" was linkified, and could potentially
   point to a malicious website.)
   
   With this change, we will avoid printing unknown parameter names, and
   will show the parameter name rather its value when a bogus value is
   detected.  Yes, there's admittedly some information loss here that
   might be useful to the well-meaning but fat-fingered user, but the
   security aspect is more important.
   
   * lib/viewvc.py
     (_validate_param): Don't print illegal parameter names, and show the
       (legal) parameter name rather than its value when that value is
       illegal.

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2218 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-07-06 19:05:08 +00:00
cmpilato
6de96c4fc6 Merge from trunk r2211, r2212, and r2213, whose combined log message
might have read as follows:

   * lib/viewvc.py
     (_validate_view, _validate_mimetype): New validation functions.
     (_re_validate_mimetype): Removed as unused.
     (_legal_params): Tweak the validation routines for 'view' and
       'content-type' to point to _validate_view() and _validate_mimetype(),
       respectively.
     (_validate_param): Now check for non-zero result from validation
       functions as the "valid" indicator, rather than requiring each of
       them to raise an exception in troubled times.
     (Request.run_viewvc): Use an intermediate variable to simplify some
       logic around input parameter validation.  Move the logic that maps
       view=rev to view=revision into the parameter validation loop.
       Lose now-unnecessary validation of 'content-type' parameter -- the
       normal parameter validation stuff should catch problems there.

Also:

* CHANGES
  Record the relevant bits of these changes.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2215 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-07-06 16:45:59 +00:00
cmpilato
e45c2fcf6e Merge a minor comment tweak from trunk r2209.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2210 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-06-17 21:22:39 +00:00
cmpilato
8c620c8c1a Merge from trunk r2207, whose log message read thusly:
* conf/viewvc.conf.dist
     Comment out all the options here, forcing folks to uncomment the
     stuff they want to modify.  This allows the parsing of this file to
     be optimized toward doing less work, while maintaining a consistent
     initial presentation.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2208 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-06-17 14:33:40 +00:00
cmpilato
c6d6dc4bdf Merge from trunk r2205, whose log message read thusly:
Finish issue #415 - ModPythonServer shouldn't call sys.exit().
   
   (This doesn't really fix anything, and hopefully doesn't break anything
   either, but is merely a "good programming practice" cleanup item.)
   
   * lib/viewvc.py
     (Request.run_viewvc): Ensure that server.redirect() is the last
       thing this function does (when it does it).
   
   * lib/sapi.py
     (CgiServer.redirect): Avoid calling sys.exit().  Also, fix a use of
       print() that should be sys.stdout.write() (for consistency).
     (AspServer.redirect, ModPythonServer.redirect): Avoid calling sys.exit().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2206 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-06-16 15:05:56 +00:00
cmpilato
355fac5da1 Merge from trunk r2201, which contains some minor documentation
markup tweaks.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2202 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-06-15 20:12:15 +00:00
cmpilato
77d0c3dd06 Merge from trunk r2199, whose log message read thusly:
Tighten up some input validation.
   
   * lib/viewvc.py
     (_re_validate_boolint): New.
     (_legal_params): Switch the validation function to _re_validate_boolint
      for the following: 'hideattic', 'makeimage', 'parent', 'tarball',
      and 'hidecvsroot'.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2200 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-06-15 19:42:48 +00:00
cmpilato
d95cb540f5 Merge from trunk a minor doc tweak made in r2197.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2198 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-06-15 19:07:24 +00:00
cmpilato
98b757de23 Merge from trunk r2194 and r2195, whose combined log messages might
read like so:

   Finish issue #420 - "cvsdbadmin rebuild" and "svndbadmin rebuild"
   complain about unknown repositories.
   
   * lib/cvsdb.py
     (UnknownRepositoryError, DatabaseVersionError): New Exception classes.
     (CheckinDatabase.Connect): Raise DatabaseVersionError instead of a
       generic Exception.
     (CheckinDatabase.PurgeRepository): Raise UnknownRepositoryError
       instead of a generic Exception.
   
   * bin/svndbadmin
     (main): When rebuilding, ignore the UnknownRepositoryError; when
       purging, turn that sucker into something readable.
   
   * bin/cvsdbadmin
     (__main__): When rebuilding, ignore the UnknownRepositoryError; when
       purging, turn that sucker into something readable.

Also:

* CHANGES
  Record this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2196 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-06-08 15:53:47 +00:00
cmpilato
efb811d20c Merge from trunk r2192, whose log message read:
Finish issue #419: svnauthz module doesn't match Subversion's
   case-handling semantics.
   
   * conf/viewvc.conf.dist
     (force_username_case): New option.
   
   * lib/vcauth/svnauthz/__init__.py
     (ViewVCAuthorizer.__init__): Find and handle new force_username_case
       authorizer option.
     (ViewVCAuthorizer._get_paths_for_root): Replace ConfigParser.optionxform()
       (which does normalization of option names) with an identity function
       of sorts.

Additionally:

* CHANGES
  Record this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2193 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-06-05 19:05:00 +00:00
cmpilato
a57e6b7054 Merge from trunk r2190, whose log message read:
Consistify the layout -- at least on a section-by-section basis -- of
   the viewvc.conf.dist file.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2191 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-06-05 17:54:34 +00:00
cmpilato
fe52bbb079 [Merge from trunk r2095]
Fix issue #400: Allow ViewVC to (optionally) use the 'chardet' module
during syntax coloration to perform character encoding detection (and
subsequent translation to UTF-8).
   
* conf/viewvc.conf.dist
  (options.detect_encoding): New.
   
* lib/config.py
  (Config.set_defaults): Initialize the 'detect_encoding' parameter.
   
* lib/viewvc.py
  (markup_stream_pygments): If the configuration asks for character
    encoding detection, try to import the 'chardet' module and -- if all
    goes well -- tell Pygments to use it.
   
* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2188 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-06-04 15:41:53 +00:00
cmpilato
76d6b541c3 Begin a new release cycle.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2187 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-06-03 15:06:16 +00:00
cmpilato
269a9ca864 Let's get 1.1.1 out today, shall we?
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2184 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-06-03 14:37:14 +00:00
cmpilato
a5aafe3172 Merge from trunk r2181, whose log message read like so:
* templates/file.ezt
     Use "Contents of /path/to/file" instead of "Annotate of /path/to/file" as
     the page title.

Also:

* CHANGES
  Record this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2182 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-05-29 17:59:11 +00:00
cmpilato
d30bd89c42 Merge from trunk r2178, whose log message read thusly:
Fix issue #417 - "cvsdbadmin rebuild" fails to record some of the
   commit/repository info.
   
   * lib/cvsdb.py
     (CheckinDatabase.PurgeRepository): Clear all the ID caches after
       running a purge operation so that, if the purge is actually part
       of a rebuild, the subsequent update doesn't merely pull IDs from
       the cache (with the side-effect of not readding them to the database).
   
   Reported by: Naran Babhu <naranbabhu{_AT_}tigris.org
                Martin Dessureault <martin{_AT_}austin.rr.com>

...and r2179, which went like so:

   * lib/cvsdb.py
     (CheckinDatabase.PurgeRepository): Don't allow the purge operation
       to actually *create* a "repositories" table entry.

And while we're at it:

* CHANGES
  Record these changes.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2180 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-05-29 15:15:25 +00:00
cmpilato
d76ce85625 Add issue number to recent CHANGES addition.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2177 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-05-28 14:08:31 +00:00
cmpilato
b2b247f417 Merge from trunk r2175, whose log message read thusly:
Fix issue #416 - Can't see query form due to missing template variables.
   
   * lib/viewvc.py
     (view_queryform): Add 'query_action' and 'query_hidden_values' back
       to the data dictionary, as they were accidentally dropped in r2123.
   
   Reported by: Naran Babhu <naranbabhu{_AT_}tigris.org>

Also:

* CHANGES
  Record this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2176 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-05-28 14:01:21 +00:00
cmpilato
3ab2ec665b And the release cycle begins again...
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2162 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-05-13 14:15:53 +00:00
cmpilato
2806f0e9a2 Add date to CHANGES file.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2160 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-05-13 13:37:54 +00:00
cmpilato
8b426f6fb3 Merge from trunk r2152, recording 1.0.8's CHANGES here.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2153 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-05-05 17:26:56 +00:00
cmpilato
19ee8b32df Record a merge that effectively happened in r2147.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2148 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-05-05 17:09:57 +00:00
cmpilato
a5389019fa Bump copyright years.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2147 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-05-05 17:09:01 +00:00
cmpilato
7f272fbe04 Merge from trunk r2123 and r2124, the log message summary of which is:
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.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2144 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-05-05 17:01:10 +00:00
cmpilato
89edf0ac04 Merge from trunk r2142, whose log message read thusly:
Finish issue #402: Split the 'use_pagesize' configuration directive
   into two: 'log_pagesize' and 'dir_pagesize', individually controlling
   the size of pages used (if at all) for the revision log and directory
   views, respectively.
   
   * conf/viewvc.conf.dist
     (use_pagesize): Removed, in favor of...
     (dir_pagesize, log_pagesize): ...these.
   
   * lib/viewvc.py,
   * lib/config.py,
   * bin/standalone.py
     Replace the use and tooling around 'use_pagesize' with
     'dir_pagesize' and 'log_pagesize' as appropriate.
   
   * templates/include/paging.ezt,
   * templates/include/dir_header.ezt
     Stop using the option value to determine whether or not to show
     pagination UI.  Use the presence of some pages instead.
     
   * docs/upgrading-howto.html
     Note the changes in options.
   
   Patch by: Lei Zhang <thestig{_AT_}google.com>
             (Tweaked by me.)

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2143 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-05-05 15:49:50 +00:00
cmpilato
71fbec8871 Merge from trunk r2140, whose log message read thusly:
Fix the GUI mode of standalone.py -- it wasn't even starting
   correctly, and we don't need a toggle for 'enscript' any more.
   
   * bin/standalone.py
     (GUI.__init__): Pass the configuration file to handle_config().
       Lose 'enscript'-related stuff.
     (GUI.toggle_use_enscript): Remove.
     (cli): Fix call to gui(), dropping bogus parameter.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2141 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-05-05 15:35:06 +00:00
cmpilato
504b1e1a8a Merge from trunk r2137, whose log message read thusly:
Fix issue #409, an exception thrown when sorting by revision in a
   remote Subversion directory view.
   
   * lib/vclib/svn/svn_ra.py
     (RemoteSubversionRepository.dirlogs): Store the entry's revision as
       a string, for consistency with other vclib modules.
   
   Reported by: Wojciech Wróblewski <wojtek{_AT_}elmi.pl>

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2139 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-05-05 14:59:32 +00:00
cmpilato
cf9381e0ee Backport to the 1.1.x branch trunk's r2134, whose log message read thusly:
Fix an exception in log views of Subversion repositories with 0
   revisions.
   
   * lib/vclib/svn/svn_repos.py
     (_get_history): Add easy-out for repositories with 0 revisions.
   
   Reported by: Wojciech Wróblewski <wojtek{_AT_}elmi.pl>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2135 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-05-04 14:58:46 +00:00
cmpilato
3907172131 Merge from trunk r2128-2129.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2130 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-04-20 17:41:32 +00:00
cmpilato
c34752ce92 Merge from trunk r2121, whose log message read thusly:
* templates/include/file_header.ezt
     Lose template reference of 'log_href_rev', which was removed in
     r2116 as unused.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2122 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-03-24 16:34:22 +00:00
cmpilato
40cc23f12a Merge from trunk r2119, whose log message read thusly:
Clutterkiller!  Put the default configuration files into a conf/
   subdirectory.
   
   * conf/
     New subdirectory.
   
   * cvsgraph.conf.dist,
   * mimetypes.conf.dist,
   * viewvc.conf.dist
     Move these from here ...
   
   * conf/cvsgraph.conf.dist,
   * conf/mimetypes.conf.dist,
   * conf/viewvc.conf.dist
     ... to here.
   
   * viewvc-install
     (FILE_INFO_LIST): Track new locations of configuration files.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2120 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-03-19 20:44:47 +00:00
cmpilato
9b7fea99d4 Merge from trunk a few relavent and recent changes (r2110:2117).
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2118 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-03-19 18:09:29 +00:00
cmpilato
85949a6464 Merge from trunk r2107, which updates copyright info only.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2108 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-03-18 16:45:10 +00:00
cmpilato
d5291a6b98 Merge from trunk r2103, whose log message read thusly:
Fix namespace problem with raised Exception.
   
   * lib/viewvc.py
     (view_revision): raise *debug.*ViewVCException.
   
   Patch by: Kamesh Jayachandran <kamesh@collab.net>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2104 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-03-18 12:52:24 +00:00
cmpilato
9e41d171c9 Merge from trunk r2101, whose log message read thusly:
Finish issue #401: Support MIME type overrides in ViewVC configuration.
   Trade the 'mime_types_file' option for 'mime_types_files' -- an
   ordered list of MIME mapping files to consult.  And provide our own
   (empty) mapping file that folks can use to override the mappings
   provided by other such files.
   
   * mimetypes.conf.dist
     New file.
   
   * viewvc.conf.dist
     (mime_types_files): Was mime_types_file, and now accepts multiple values.
   
   * lib/config.py
     (Config._force_multi_value): Add "mime_types_files" to the list of
       multi-value configuration options.
     (Config.set_defaults): Track rename of mime_types_file parameter,
       now setting the default to a list containing only "mimetypes.conf".
   
   * lib/viewvc.py
     (load_config): Track new name and format of mime_types_files option.
   
   * viewvc-install
     (FILE_INFO_LIST): Also install mimetypes.conf.dist as itself and as
       mimetypes.conf.
   
   * INSTALL
     (INSTALLING VIEWVC): Update reference to renamed configuration option.
   
   * docs/upgrading-howto.html
     Update this document.

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2102 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-03-06 16:44:37 +00:00
cmpilato
da54e91dea Merge from trunk r2097, whose log message read thusly:
Finish issue #396 - Malformed accept-language header crashes viewvc
   
   * lib/accept.py
     (AcceptLanguageParseError): Was AcceptParseError.
     (_parse): Track renamed Exception.
   
   * lib/viewvc.py
     (Request.__init__): Catch and handle raised AcceptLanguageParseError.
   
   Patch by: Rune Halvorsen <runefh{_AT_}gmail.com>,
             me

Also:

* CHANGES
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2099 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-02-26 16:15:55 +00:00
cmpilato
41b2ae2c7a Tweak a CHANGES entry for line length reduction.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2098 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-02-26 16:14:15 +00:00
cmpilato
1815220abe Note r2092 merge CHANGE.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2094 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-02-20 15:32:57 +00:00
cmpilato
a080d8eef4 Merge from trunk r2090, whose log message read thusly:
ViewVC doesn't "do" directory entry sorting by revision for CVS, so
   don't imply that it does in the UI.
   
   * lib/viewvc.py
     (view_directory): Don't provide sortby_rev_href to the template.
   
   * templates/directory.ezt
     Only offer sort links when those links are provided by ViewVC.
   
   * templates/dir_new.ezt
     Only offer sort links when those links are provided by ViewVC.  Use
     date-based sorting if rev-based sorting isn't available.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2092 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-02-20 15:24:39 +00:00
cmpilato
8c4af42d56 Merge from trunk r2088, whose log message read:
Remove dead code.
   
   * lib/popen.py
     (pipe_cmds, _copy): Remove as unused.
   
   * bin/standalone.py
     (StandaloneServer.run_viewvc): Tweak comment that referred to pipe_cmds().

   Found by: Rune Halvorsen <runeh {AT} sanedefaults.net>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2089 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-02-03 03:54:24 +00:00
cmpilato
7f1d0952fc Backport from trunk r2086, whose log message read thusly:
Fix issue #398 (File Log Viewer Shows Wrong Log Message) by asking the
   vclib layer for revision-sorted output rather than "whatever you want
   to give me".
   
   * lib/viewvc.py
     (markup_or_annotate): Pass vclib.SORTBY_REV instead of vclib.SORTBY_DEFAULT
       to the itemlog() interface.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2087 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-02-02 18:13:11 +00:00
cmpilato
222aa4ec1f Merge from trunk r2083.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2084 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-01-13 19:11:15 +00:00
cmpilato
c03bfd4b89 Merge from trunk r2081.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2082 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-01-13 18:52:33 +00:00
cmpilato
6fa8cdf117 On the 1.1.x branch: Merge from trunk r2078 and r2079.
* lib/cvsdb.py,
* bin/make-database


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2080 8cb11bc2-c004-0410-86c3-e597b4017df7
2009-01-13 18:22:12 +00:00
cmpilato
c4c777ffe6 Backport from trunk r2070.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2071 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-12-19 19:49:13 +00:00
cmpilato
3680903ed4 Backport from trunk r2067 and r2068.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2069 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-12-19 19:46:55 +00:00
cmpilato
6fe61a11bb Merge from trunk r2063 and r2064.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2065 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-12-10 17:28:43 +00:00
cmpilato
437975652f Merge from trunk r2058, whose log message read thusly:
Allow admins to enable/disable diff/patch views via the allowed_views
   configuration bit.
   
   * lib/viewvc.py
     (view_diff, view_patch): Only show diffs if 'diff' is one of the
       allowed views.
   
   * lib/config.py
     (Config.set_defaults): Add 'diff' to the set of allowed_views (and
       sort the values alphabetically where here).
   
   * viewvc.conf.dist
     (allowed_views): Add 'diff' to the set of views you can specify, and
       include it in the default values.  While here, sort the values
       alphabetically.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2062 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-12-05 17:25:10 +00:00
cmpilato
7ff75bec7b Record recent merges to this branch.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2060 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-12-05 17:08:12 +00:00
cmpilato
ea03f20f46 Remove unnecessary empty mergeinfo.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2059 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-12-05 17:05:29 +00:00
cmpilato
a5df515d79 Merge from trunk r2047, whose log message read thusly:
Avoid returning huge lists of variables from get_file_view_info(), and
   use an ad-hoc class to hold all that stuff instead.
   
   * lib/viewvc.py
     (get_file_view_info): Now return an object with interesting
       member variables instead of a nasty long list of values in an
       easy-to-goof-up order.
     (common_template_data, view_directory, view_log, view_diff): Update
       uses of get_file_view_info to track new calling semantics.

Why?  Just trying to avoid unnecessary branch divergence.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2057 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-11-20 16:39:43 +00:00
cmpilato
fabe8e8a66 Merge from trunk r2055, whose log message read thusly:
Add a configuration option for telling ViewVC to *not* honor the
   svn:mime-type property.
   
   * lib/config.py
     (Config.set_defaults): Set options.svn_ignore_mimetype default value.
   
   * viewvc.conf.dist
     (svn_ignore_mimetype): New.
   
   * lib/viewvc.py
     (calculate_mime_type): Consult cfg.options.svn_ignore_mimetype
       before looking up the 'svn:mime-type' property.
   
   * docs/upgrading-howto.html
     Add a note about the new configuration option.
   
   Patch (mostly) by: JJ <eggsgloriouseggs {_AT_} gmail.com>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2056 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-11-13 21:45:08 +00:00
cmpilato
f01fcc4ec4 Merge from trunk r2053, whose log message read thusly:
It's very confusing to comment out the authorizer configuration line
   and have that mean "use an authorizer".  So let's just prevent that
   confusion right now, okay?
   
   * lib/config.py
     (Config.set_defaults): Set 'authorizer' by default to None.
   
   * viewvc.conf.dist
     (authorizer): Update comments for correctness, and don't imply that
       "forbidden" is the default authorizer.
   
   * docs/upgrading-howto.html
     Stop saying that "forbidden" is the default authorizer.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2054 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-11-13 21:22:05 +00:00
cmpilato
05e99f4c7b Merge from trunk r2051, whose log message read thusly:
Finish issue #384 - repos._revinfo_raw() is doing far too much work
   when no authz is in use.  Vastly improves performance of
   repos.itemlog() for local Subversion repositories *not* protected by
   an authorizer.
   
   * lib/vclib/svn/svn_repos.py
     (LocalSubversionRepository._revinfo): Was ._revinfo_raw().  Now
       encapsulates the caching logic that used to live in .revinfo(), plus
       the old logic of _revinfo_raw() modified to avoid changed-path
       processing when that processing isn't strictly required by callers.
     (LocalSubversionRepository.revinfo): Make this just a thin wrapper
       around ._revinfo() now.  Internal callers of this function updated
       to use ._revinfo() instead.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2052 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-11-13 21:16:25 +00:00
cmpilato
d8aff4e58f Merge r2048 from trunk.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2049 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-11-13 20:07:15 +00:00
cmpilato
e8d3d6ad89 docs/upgrading-howto.html: Don't claim as removed options not in 1.0.x.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2042 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-11-05 21:13:19 +00:00
cmpilato
1317088e3c * CHANGES: Combine some changes, and remove a now-bogus one.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2040 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-11-05 16:30:49 +00:00
cmpilato
fe81ee5969 Branch for 1.1 stabilization.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/branches/1.1.x@2033 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-10-30 17:31:36 +00:00
cmpilato
c481fe3ace Support rule inversion in the 'svnauthz' module, just as Subversion supports.
* lib/vcauth/svnauthz/__init__.py
  (_userspec_matches_user): New, abstracted from _process_access_section(),
    but now with support for the inversion indicator (~).
  (_process_access_section): Use new _userspec_matches_user().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2032 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-10-30 17:10:13 +00:00
cmpilato
563b5a9f6d * docs/upgrading-howto.html
Reorder some sections, and documenting the known issues with the
  authz stuff.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2031 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-10-29 18:33:08 +00:00
cmpilato
360bdfd5a9 Remove redundant CHANGES line.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2030 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-10-24 15:15:24 +00:00
cmpilato
d4749c20f2 Add FAQ entry about installation docs.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2029 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-10-22 13:32:37 +00:00
cmpilato
bf7676d7f1 * lib/vcauth/svnauthz/__init__.py
(ViewVCAuthorizer._process_access_section): Add support for the
    "$anonymous" and "$authenticated" magic user specifications
    introduced in Subversion 1.5.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2028 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-10-20 16:12:30 +00:00
cmpilato
8d5d67888d Note per-root configuration override change.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2027 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-10-15 00:28:05 +00:00
cmpilato
08454df121 Add support for allowing/disallow the root listing view.
* lib/viewvc.py
  (view_roots): Check to see if the root listing view is an allowed
    one before serving it up.

* viewvc.conf.dist
  Add 'roots' to the description of, and default value of, allowed_views.

* lib/config.py
  (Config.set_defaults): Add 'roots' to the default value of
    cfg.options.allowed_views.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2026 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-10-15 00:22:05 +00:00
cmpilato
a5b8f9176f Get per-root overrides of authorizer stuffs working, and advertise
this feature in viewvc.conf.

NOTE: Root listing views still currently suffer a bit here.  We can't
just overlay per-root options as we loop over roots because each root
will wind up with the union of the overrides for roots previously
handled in the loop.  We either need to find a way to clone the Config
object before overriding its values with per-root options (so the
original Config object is untouched) or find an elegant way to
*unoverlay* per-root options.  I suspect we'll have better luck with
the former approach.

* lib/viewvc.py
  (Request.run_viewvc): Overlap per-root options *before* setting up
    the authorizer for the root because, you know, the authorizer or
    its configuration might be what's being overridden.

* viewvc.conf.dist
  Note the existence of (and way to use) the per-root configuration overrides.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2025 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-10-15 00:11:54 +00:00
cmpilato
badc9e3ff0 Expose the authenticated username in the templates.
* templates/docroot/styles.css
  (#vc_nav_header): Drop 'font-weight: bold'.

* templates/include/header.ezt
  Convert vc_nav_header contents into a 1-row, 2-column table
  featuring the nav path and (if present) the authenticated username.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2024 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-10-14 23:53:55 +00:00
cmpilato
9d6c204efb Merge 1.0.7 changes into CHANGES file (and fix a long line while here).
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2023 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-10-14 22:21:44 +00:00
cmpilato
429a9e5aed Bump the version named as the latest release.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2022 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-10-14 22:09:35 +00:00
cmpilato
574de8ddac Minor tweaks to the release process docs.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2021 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-10-14 22:08:26 +00:00
cmpilato
cf5491852c Fix issue #373: Regression: "as text" view no longer transmits
Content-type: text/plain header.

* lib/viewvc.py
  (Request.run_viewvc): Add 'text/plain' to the list of content types
    allowed to be specified via the CGI query params.
  (view_checkout): Revert the change from r1978 which caused this to
    ignore the content-type query param; we'll go back to paying
    attention to that, and simply trust that Request.run_viewvc() has
    sanitized it.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2016 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-10-02 15:46:19 +00:00
cmpilato
d525dd0737 * lib/viewvc.py
(setup_authorizer): Use the prescribed mechanism for dynamically loading a
    submodule.

Patch by: Bernd Kuemmerlen <bkuemmer {at} gmx.net>

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2011 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-09-22 18:57:48 +00:00
cmpilato
502b9891d4 Tigris.org homepage updates.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2010 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-09-16 19:36:39 +00:00
cmpilato
e72570dc20 Copy 1.0.6 changes into trunk CHANGES file.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2009 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-09-16 19:15:46 +00:00
cmpilato
1fa6bf4978 Lose fixed-width formatting of a URL.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2008 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-09-16 19:08:11 +00:00
cmpilato
f00bf732df Bump most recent release version in website note.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2007 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-09-16 19:07:50 +00:00
cmpilato
d13fd6f02a * lib/viewvc.py
(setup_authorizer): Avoid try/except/finally syntax, which isn't
    supported by some older Python versions.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2002 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-09-11 14:11:39 +00:00
cmpilato
ba0e4598d3 * viewvc.conf.dist
No longer recommend that folks set use_enscript (since it has been
  removed) and use_cvsgraph (since it seems most folks these days are
  using Subversion anyway).



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2001 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-09-10 14:40:33 +00:00
cmpilato
899de5536f * lib/viewvc.py
(setup_authorizer): Use the 'imp' module instead of exec() commands
    to load a dynamically-determined (and arbitrarily named module).

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2000 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-09-08 13:30:31 +00:00
cmpilato
5b8d3cf325 Finish issue #105 (add option hide_errorful_entries).
* viewvc.conf.dist
  (hide_errorful_entries): New.

* lib/config.py
  (Config.set_defaults): Init cfg.options.hide_errorful_entries to 0.

* lib/viewvc.py
  (view_directory): If cfg.options.hide_errorful_entries is enabled,
    skip any directory entries that carry errors.

* docs/upgrading-howto.html
  Note the new option.

* CHANGES
  Note this (and the previous) change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1998 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-08-21 13:56:30 +00:00
cmpilato
0855e910ac Add some svn:ignore properties.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1997 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-08-21 13:50:22 +00:00
cmpilato
fbb4e04dbc In the CVS vclib providers, mark entries which have no revisions on
the requested tag as 'absent', rather than calling such a situation an
error.  This is for issue #105 (add option hide_not_readable).

* lib/vclib/ccvs/bincvs.py
  (CVSDirEntry.__init__): Add 'absent' parameter and handling.
  (_get_logs): Rather than raise such as an error, not files which
    have no revs on the selected branch/tag as "absent" (a
    non-error-ful state).

* lib/vclib/ccvs/ccvs.py
  (CCVSRepository.dirlogs): Init the .entry member of the dirent.
  (InfoSink.admin_completed): If we found nothing for a particular
    tag, and we're looking at a file, mark the entry as absent.

* lib/viewvc.py
  (view_directory): If a CVS file is marked as absent (meaning, "No
    revisions found on the requested branch"), don't show it at all.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1996 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-08-21 13:37:46 +00:00
cmpilato
329ec7e9bf Reverse-merge changes made in r1536 and r1537 (in which our mod_python
modules were renamed), and merge r1933 (in which the 'imp' module is
used to more directly deal with the import cycle problem).

* docs/upgrading-howto.html
  Remove upgrading notes about renamed modules since, now, they aren't
  renamed any more.

* viewvc-install
  Note re-renamed paths.

* bin/mod_python/viewvc_mp.py,
* bin/mod_python/query_mp.py
  Rename these back ...

* bin/mod_python/viewvc.py,
* bin/mod_python/query.py
  ... to these, and use the 'imp' module to load libraries from
  specific locations.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1994 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-08-20 18:01:37 +00:00
cmpilato
e9d1da3b8f * lib/viewvc.py
(build_commit): Ahem.  And then commit the fixes necessary to make
    r1991 actually work.

NOTE TO SELF: Be sure to test the right version of the software before
              committing.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1992 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-08-20 17:12:39 +00:00
cmpilato
3f8ecf1b67 * lib/viewvc.py
(build_commit): Remove duplicated authz checks, and try to tighten
    up the path/rev used in those checks.  While here, fix issue #368's
    complaint about the RSS feeds throwing an exception due to use of a
    non-existent variable.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1991 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-08-20 17:09:27 +00:00
cmpilato
b35d6b27d0 * lib/viewvc.py
(calculate_mime_type): Gracefully handle exceptions returned from
    .itemprops(), and fall back to guessing based on path name.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1990 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-08-20 14:45:34 +00:00
cmpilato
3738505ad7 * lib/vclib/svn/svn_repos.py
(LocalSubversionRepository._revinfo_raw): Fix a logic-o.  It's if
    a copy source path is *not* authorized for read that we want to say
    the original path was not copied.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1989 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-08-20 14:40:13 +00:00
cmpilato
a74cefa63c Finish issue #361 - Support reasonable copy-pasting of the path.
* templates/include/header.ezt
  Collapse the EZT logic for the navpath into a single line[1], and
  wrap the path separators (/) with custom styles.

* templates/docroot/styles.css
  (.vc_navheader .pathdiv): Define custom style with some left-right padding.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1987 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-08-18 18:13:12 +00:00
cmpilato
b90ed5fffa * lib/blame.py
Only import vclib.ccvs.blame for the one function that cares.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1986 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-08-13 20:13:15 +00:00
cmpilato
c264c62e3d Finish issue #364 - Recognize Subversion's svn:mime-type property.
* lib/viewvc.py
  (Request.run_viewvc): No longer set the request's mime_type member.
  (calculate_mime_type): New helper function.
  (common_template_data): Add optional 'mime_type' parameter, passed
    to get_file_view_info().
  (get_file_view_info): Use guess_mime() as the MIME type fallback,
    instead of consulting the now-absent request.mime_type.
  (markup_or_annotate, view_log, view_checkout, build_commit): Use 
    calculate_mime_type().

* templates/file.ezt
  Display a file's MIME type.

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1982 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-08-05 16:25:38 +00:00
cmpilato
286b8a2925 Update the URL reference in light of r1978 and r1979.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1980 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-07-28 19:26:35 +00:00
cmpilato
3a499652df Finish issue #354: Lose ability to set Content-type via CGI params.
For security purposes (because spoofing Content-type headers can have
undesirable side effects), no longer recognize 'content-type' CGI
parameters whose values aren't one of the magic MIME types ViewVC uses
for its own (non-MIME-type-setting) purposes.

* lib/viewvc.py
  (Request.run_viewvc): Ignore content-type CGI parameters whose
    values aren't one of the magic ViewVC MIME types used to indicate
    that folks want the markup view.
  (view_checkout): No longer consult the query parameters for a MIME type.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1978 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-07-28 18:51:51 +00:00
cmpilato
d272630eac Fix issue #360 - Purge functionality can orphan rows in checkins table.
* lib/cvsdb.py
  (CheckinDatabase.sql_delete): Add keep_fkey parameter, used to
    prevent deletion of keys that are still in use in the 'checkins'
    table.
  (CheckinDatabase.PurgeRepository): Pass keep_fkey parameter when
    deleting rows from tables other than 'checkins'.

* bin/cvsdbadmin,
* bin/svndbadmin
  Update script usage messages to indicate that rebuilding includes
  purging.

Patch by: Larry Shatzer (larrys {at} gmail.com)
          (Tweaked by me.)

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1974 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-07-07 13:21:48 +00:00
cmpilato
cb79c1f793 Add support for Subversion authz-file aliases, a feature new to
Subversion 1.5.  (This was filed as issue #359.)

* lib/vcauth/svnauthz/__init__.py
  (ViewVCAuthorizer._get_paths_for_root): Parse the 'aliases' section,
    and fix username checks to include aliases, too.

Patch by: Thom May <thom {at} clearairturbulence.org>

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1973 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-30 18:46:07 +00:00
cmpilato
43337f8b0f * lib/vclib/svn/svn_ra.py (SelfCleanFP.readlines): New.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1972 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-26 08:00:21 +00:00
cmpilato
7f149c01d0 More authz stuff for remote SVN repositories.
* lib/vclib/svn/svn_ra.py
  (date_from_rev): Removed as unused.
  (LogCollector): Leave an authz-related TODO comment.
  (RemoteSubversionRepository.rawdiff): Hook into the authz-aware code.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1971 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-26 07:57:21 +00:00
cmpilato
2df94a5d37 Add some more authz checks for remote SVN repositories, and fix some
inconsistencies (versus local SVN repository views) in the revision
returned from openfile().

* lib/vclib/svn/svn_ra.py
  (LastHistoryCollector): Removed.  The main logic of this class now
    lives (with major tweaks) in RemoteSubversionRepository._revinfo_raw().
  (_get_rev_details): Removed.
  (RemoteSubversionRepository.open): Init _revinfo_cache member.
  (RemoteSubversionRepository.openfile): Use _get_last_history_rev()
    for the returned revision.
  (RemoteSubversionRepository.dirlogs): Use self.revinfo() now.
  (RemoteSubversionRepository.revinfo): Rework as a wrapper around
    _revinfo_raw().
  (RemoteSubversionRepository.rawdiff): Add some comments.
  (RemoteSubversionRepository._get_last_history_rev): New.
  (RemoteSubversionRepository._revinfo_raw): New, taking from old
    LastHistoryCollector interface, but reworked toward the goal of
    some authz interaction.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1970 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-26 07:52:18 +00:00
cmpilato
91c5418de7 Add a helper function, use it, and fix a little authz oopsy along the way.
* lib/vclib/svn/svn_repos.py
  (_path_parts): New, and now used throughout for path-to-parts
    conversions.
  (_cleanup_path): Rewrite as a wrapper around _path_parts().
  (_fs_path_join): Rewrite as a wrapper around _cleanup_path().
  (LocalSubversionRepository._revinfo_raw): Fix an authz check made
    against the wrong path.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1969 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-26 07:43:52 +00:00
cmpilato
1adb46f2b3 Fix a regression against 1.0.x which caused the wrong revision metadata
to be displayed for certain rev != rev-in-which-item-was-changed
Subversion markup and annotate displays.

* lib/viewvc.py
  (common_template_data): Add optional 'revision' argument, used to
    override other automated revision-figuring-outin' mechanisms.
  (markup_or_annotate): Use the revision returned by the openfile() or
    annotate() interfaces in the call to common_template_data().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1968 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-26 06:47:46 +00:00
cmpilato
410a80df6b Address issue #358 as best as possible (I believe).
* lib/viewvc.py
  (build_commit): Perform authz checks, dropping unreadable paths and
    stripping log messages for commit groupings with contain
    unreadable paths.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1967 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-25 06:43:23 +00:00
cmpilato
eb6c6964c4 Make the check-the-database-for-roots-before-creating-RSS-and-query-links
behavior optional (since the penalty otherwise could be deemed too
high to be worth paying).

* viewvc.conf.dist
  (check_database_for_root): New.

* lib/config.py
  (Config.set_defaults): Populate default cvsdb.check_database_for_root value.

* lib/viewvc.py
  (is_querydb_nonempty_for_root): Only do database root checks if
    cfg.cvsdb.check_database_for_root is set.

Patch by: Larry Shatzer <larrys {at} gmail.com>
          (Tweaked by me.)

* lib/cvsdb.py
  (GetCommitListFromRCSFile): Update call to Repository.itemlog().

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1966 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-23 23:50:52 +00:00
cmpilato
e157f923ed * lib/cvsdb.py
(GetCommitListFromRCSFile): Update call to Repository.itemlog().

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1965 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-23 23:50:45 +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
0aaeeb4398 * bin/standalone.py
(cli): Add 'host' to the list of accepted long options.

Patch by: Larry Shatzer, Jr. <larrys {at} gmail.com>



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1962 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-19 20:06:26 +00:00
cmpilato
9761bb7818 Add CHANGES line for issue #357 change.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1961 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-19 20:04:30 +00:00
cmpilato
46f42bf09a Finish issue #357.
Only populate rss_href and queryform_href if query support is enabled
*and* the current root has a presence in the commits database.

* lib/viewvc.py
  (common_template_data): Use is_querydb_nonempty_for_root() to
    conditionally set rss_href and queryform_href.
  (is_querydb_nonempty_for_root): New.

Patch partially by: Larry Shatzer, Jr. <larrys {at} gmail.com>
                    (I butchered it.)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1960 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-19 19:51:13 +00:00
cmpilato
24984a78d1 * bin/svndbadmin
Import 'vclib' so bad stuff doesn't happen.  (Such as referencing a
  non-imported module.)



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1959 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-19 19:48:17 +00:00
cmpilato
ec3deccc34 * viewvc.conf.dist
Fix example use of 'svn_dir' to 'svn'.

Patch by: Larry Shatzer, Jr. <larrys {at} gmail.com>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1958 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-19 14:50:39 +00:00
cmpilato
7e85c56317 Formatting changes only.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1957 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-13 17:29:15 +00:00
cmpilato
371a97fbb2 * viewvc.conf.dist
(hide_cvsroot): Move closer to 'authorizer', and note that someday
    it may go away.
  (diff_format): Document the 'f' option.
  (hr_breakable): Tweak description.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1956 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-13 15:09:45 +00:00
cmpilato
3effe02607 * viewvc.conf.dist
(log_sort): Rename 'cvs' value to 'none'.

* docs/upgrading-howto.html
  Note this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1955 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-13 14:54:33 +00:00
cmpilato
7e5d3b27b1 Some intra-page link tweaks.
* lib/viewvc.py
  (Request.run_viewvc): Special-case the handling of self.where,
    self.pathtype, and self.path_parts when we're looking at the
    revision or root-listing views.
  (common_template_data): Take the current directory revision into
    account when generating a revision view link from the directory view.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1954 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-12 19:36:20 +00:00
cmpilato
079b596424 Interpret the per-template override options as relative to the
configured template directory now.

* lib/viewvc.py
  (get_view_template): Rework this to interpret per-template overrides
    as relative to the template-dir, which itself is relative to the
    configuration location.

* viewvc.conf.dist
  (templates): Strip 'templates/' from the sample template locations,
    and note that these paths are relative to the configured template
    directory.

* docs/upgrading-howto.html
  Note this change of interpretation.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1953 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-12 18:24:28 +00:00
cmpilato
fb0264a563 Make annotations work again for Subversion repositories.
* lib/vclib/svn/svn_repos.py
  (LocalSubversionRepository.annotate): Keep the return value from
    self.itemtype() so we can pass it to _get_history().

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1952 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-12 18:20:09 +00:00
cmpilato
c58fc4008b Update the upgrade documentation.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1951 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-12 17:40:17 +00:00
cmpilato
16ccaa931c Add vclib-specific path canonicalization and root-parent expansion
routines (and use them).

Background: I had delusions of adding root-parent expansion for remote
Subversion repositories, but I lacked the requisite motivation.
Still, these are good changes which further move VC-specific knowledge
out of ViewVC's core moddules and back into the vclib abstraction
layer, which such knowledge belongs.

* lib/viewvc.py
  (Request.run_viewvc): Use vclib.*.canonicalize_rootpath() to get
    version-control-specific rootpath canonicalization.
  (expand_root_parents, find_root_in_parents): Rework to use the
    expand_root_parent() vclib implementations.
  (locate_root): Docstring typo fix.

* lib/vclib/ccvs/__init__.py
  (canonicalize_rootpath, expand_root_parent): New.
  (CVSRepository): Use canonicalize_rootpath().

* lib/vclib/svn/__init__.py
  (_re_url): Make module-global.
  (canonicalize_rootpath, expand_root_parent): New.
  (SubversionRepository): Use canonicalize_rootpath().

* bin/cvsdbadmin
  (__main__): Use canonicalize_rootpath() before passing the root path
    to vclib.ccvs.CVSRepository().

* bin/svndbadmin
  (__main__): Use canonicalize_rootpath().

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1950 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-12 16:26:33 +00:00
cmpilato
656a46ad8c Don't specify how syntax highlighting is provided.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1949 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-12 14:44:17 +00:00
cmpilato
8404a211c0 Tweak website credits text just a bit.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1948 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-11 18:27:06 +00:00
cmpilato
71d3617c0d Shrink the title image a bit.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1947 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-11 18:23:49 +00:00
cmpilato
67d4261729 Add favicon.ico, and try to settle on a background color.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1946 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-11 18:17:54 +00:00
cmpilato
066b22585a More color tweaks.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1945 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-11 18:13:12 +00:00
cmpilato
0ad2b1f095 Re-brand the viewvc.org pages.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1944 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-11 18:07:57 +00:00
cmpilato
f89786a6fa * lib/vclib/svn/svn_ra.py
Fix a syntax error.  (This is what I get for testing a fix on one
  machine, but trying to commit an untested duplicate change from
  another.)



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1943 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-06 18:08:50 +00:00
cmpilato
417e2bbedf * lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository.itemlog): Don't index into an empty
    path_parts list.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1942 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-05 20:12:27 +00:00
cmpilato
d6bae15b7d * CHANGES: Note the change committed in r1940.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1941 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-05 18:57:43 +00:00
cmpilato
cad4e52746 Finish issue #351, which solves a regression against 1.0.x *and*
improves upon things to boot (finishing issue #339)!

This implements support for a configuration Subversion runtime config
directory location, which is useful for employing cached authn
credentials against remote repositories that require them, as well as
avoiding complaints the Subversion library might make when trying to
ensure the existence of a runtime configuration directory.

* viewvc.conf.dist
  (options.svn_config_dir): New.

* lib/config.py
  (Config.set_defaults): Initialize options.svn_config_dir variable.

* lib/viewvc.py
  (Request.run_viewvc): Update call to vclib.svn.SubversionRepository().
  (list_roots): Update call to vclib.svn.SubversionRepository().

* lib/vclib/svn/__init__.py
  (SubversionRepository): Add 'config_dir' parameter, passed to
    updated calls to RemoteSubversionRepository() and
    LocalSubversionRepository()

* lib/vclib/svn/svn_ra.py
  (RemoteSubversionRepository.__init__): Add 'config_dir' parameter,
    and squirrel it away in a member variable.
  (RemoteSubversionRepository.open): Add the key thing I've been
    missing for years to make custom runtime config directories work:
    setting the configuration directory location in the auth baton!
    God bless Eric Gillespie <epg@pretzelnet.org>.

* lib/vclib/svn/svn_repos.py
  (LocalSubversionRepository.__init__): Add 'config_dir' parameter,
    and squirrel it away in a member variable (currenty unused).

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1940 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-05 18:52:45 +00:00
cmpilato
9acf966bd7 Make dates appear again in remote Subversion directory views.
* lib/vclib/svn/svn_ra.py
  (RemoteSubversionRepository.dirlogs): Don't try to do
    string-to-number conversion of the entry date -- we already have
    the numeric value.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1938 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-03 18:00:37 +00:00
cmpilato
6c635e75a4 * lib/viewvc.py
(check_freshness): Move a comment closer to the code it addresses.
  (markup_or_annotate): Restore cache control header checks
    inadvertantly lost in a recent commit.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1937 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-03 17:11:34 +00:00
cmpilato
5b51bf9008 Finish issue #233: tarball entries from Subversion repositories don't
preserve executability.

* lib/vclib/__init__.py
  (Repository.isexecutable): New.

* lib/vclib/ccvs/bincvs.py
  (BaseCVSRepository.isexecutable): New.

* lib/vclib/svn/svn_repos.py
  (LocalSubversionRepository.isexecutable): New.

* lib/vclib/svn/svn_ra.py
  (RemoteSubversionRepository.isexecutable): New.

* lib/viewvc.py
  (generate_tarball): Use repos.isexecutable() to get the executable
    bit for file tarball members.  (This loses old code which directly
    consulted the ,v file in the CVS case.)

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1936 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-03 17:02:55 +00:00
cmpilato
b5a2dd486d * lib/viewvc.py
(_get_diff_path_parts): Store the result of _path_parts() in
    'parts', not 'path', to avoid raising an exception when
    deferencing the former.

Found by: Jay Chang <Jay.Chang {at} intrado.com>
          (Folks who test nightly builds rawwwwwk.)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1935 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-03 00:35:37 +00:00
cmpilato
041c83fabe * lib/vclib/svn/svn_ra.py
Begin adding authz checks where necessary.  Still need to take care
  of rev metadata filtering and history truncation.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1934 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-02 19:34:43 +00:00
cmpilato
850422c786 * lib/vclib/svn/svn_repos.py
(LocalSubversionRepository): Throughout, don't clobber 'rev'
    variables before passing them off to .itemtype(), and ensure there
    *is* a local 'path' variable in case the .itemtype() failure case
    (which expects one) is raised



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1933 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-02 19:32:01 +00:00
cmpilato
1273f1da81 Add missing authz checks for rcsparse-backed CVS module.
* lib/vclib/ccvs/ccvs.py
  (CCVSRepository.dirlogs, CCVSRepository.itemlog,
   CCVSRepository.rawdiff, CCVSRepository.annotate,
   CCVSRepository.openfile): Add missing authz checks.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1932 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-02 18:52:46 +00:00
cmpilato
c1b351f78b * lib/vclib/ccvs/bincvs.py
(BaseCVSRepository, BinCVSRepository): Use Repository.itemtype()
    throughout as a combination authz check and file type sanity check.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1931 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-02 18:48:16 +00:00
cmpilato
c4ad7fc501 * viewvc.conf.dist
(show_subdir_lastmod): Tweak description to imply that this feature
    is for CVS only.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1930 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-02 17:59:03 +00:00
cmpilato
31a1a6f49c Ensure zero-padded dates in the nightly tarball names.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1929 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-06-02 17:15:03 +00:00
cmpilato
b0fb8b3ad7 * templates/include/dir_header.ezt,
* templates/include/dir_footer.ezt,
* templates/directory.ezt
  Move search box to metadata header section, and eliminate redundant "Current
  Search" header.  Make properties show up for dir_new.ezt, too.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1928 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-30 21:12:57 +00:00
cmpilato
0d0aafe7b2 * lib/vclib/svn/svn_ra.py
(svn_client_ls3): New helper (to deal with brokenness in Subversion
    1.4.x Python bindings).
  (RemoteSubversionRepository.itemlog, 
   RemoteSubversionRepository._get_dirents): Use svn_client_ls3 helper.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1927 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-30 21:02:31 +00:00
cmpilato
0fb5f8eb85 Workaround some Subversion 1.4.x Python bindings shortcomings.
* lib/vclib/svn/svn_ra.py
  (SVN_INVALID_REVNUM): Try to set from core.SVN_INVALID_REVNUM, but
    fallback to an explicit -1.
  (RemoteSubversionRepository.created_rev): Use SVN_INVALID_REVNUM
    compatability value.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1926 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-30 20:45:05 +00:00
cmpilato
19643d366c * lib/viewvc.py
(markup_stream_pygments): CGI-escape the original blame text lines
    so that if they wind up getting used, the output is valid.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1925 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-30 18:05:32 +00:00
cmpilato
4492bbaa1b * lib/viewvc.py
(markup_stream_pygments): Use 'utf-8' output in the Pygments HtmlFormatter().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1924 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-30 17:57:50 +00:00
cmpilato
e41d5a9064 Update online help documents.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1923 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-30 17:32:29 +00:00
cmpilato
2a4b0eeb99 Promote a ViewVC logo idea to The Real Thang(tm).
* notes/logo
  New directory.

* notes/logo/viewvc-logo.svg,
* notes/logo/viewvc-logo.odg,
* notes/logo/viewvc-logo.pdf
  Moved (with some margin tweaks) from ...

* notes/logo-ideas
  ... this directory, which is now deleted.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1922 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-30 17:07:33 +00:00
cmpilato
d768f2c850 Update ViewVC logo, and add favicon.
* templates/docroot/images/logo.png
  Removed.

* templates/docroot/images/viewvc-logo.png,
* templates/docroot/images/favicon.ico
  New.

* templates/docroot/help_dirview.html,
* templates/docroot/help_log.html,
* templates/docroot/help_query.html,
* templates/docroot/help_rootview.html
  Update icon references to point to viewvc-logo.png.

* templates/include/header.ezt
  Update icon reference to point to viewvc-logo.png, and add reference
  to new favicon.ico.

* templates/docroot/styles.css
  Use sans-serif fonts.  Serifs are so 1993.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1921 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-30 17:01:58 +00:00
cmpilato
88d4d62c39 Merge the work done on the 'merged-file-views' branch in full. For
the details of those changes, run:

   svn log --stop-on-copy --verbose \
   http://viewvc.tigris.org/svn/viewvc/branches/merged-file-views@1917

Basically, this change unifies the annotate and markup views at the
cost of dropping support for all but one of our syntax highlighting
engines -- Pygments.  (So, goodbye to 'enscript', 'highlight',
'source-highlight', 'py2html', and 'php'.)  By settling on a single
markup engine (and a Python-module-based one with a BSD license, at
that), we:

   * added syntax highlighting to the annotate view

   * added line numbers to the markup view (prior to this, you
     sometimes had 'em and sometimes didn't, depending on which
     highlighting engine you used).

   * essentially unified the markup and annotate views -- they even
     share the same template now.

   * can ship ViewVC with Pygments and syntax highighting enabled so
     folks don't have to do additional config work to get that feature.

This change may be controversial.  Depending on the overlap of
supported syntaxes across the various engines we supported prior to
this change, we may be losing support for some languages.  And we're
also losing URL markup-ing (which was, again, partially supported
depending on the markup engine you were using).  Somebody is going to
get upset that their pet benefit is now missing.  I understand that.
I'm optimistic, though, that we can identify the lossages that really,
really matter, and address them in low-maintenance-hassle ways using
this slimmer, trimmer codebase as the baseline.

Also in this commit (in addition to the merged changes):

* templates/docroot/styles.css
  Minor stylation tweaks.

* viewvc.conf.dist
  (enable_syntax_coloration): Tweak the comment to indicate that
    Pygments is required for syntax coloration to work.

* CHANGES
  Note these changes.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1918 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-30 14:38:09 +00:00
cmpilato
64c38e8248 * nightly/build-viewvc-snapshot
Duh.  Actually removing the temporary directory.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1915 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-30 13:15:31 +00:00
cmpilato
3f8390b18a * lib/viewvc.py
(MarkupPygments.__call__): The parameter is "nowrap", not "linenowrap".


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1910 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-23 20:04:50 +00:00
cmpilato
62883ba20b Avoid having the Pygments integration keeping two copies of the file
contents in memory at once.  One is bad enough, but will have to do
for now.

* lib/viewvc.py
  (MarkupPygments): New, constructed from the primary logic that used
    to live in ...
  (markup_stream_pygments): ... this function, which is now just a thin
    wrapper around MarkupPygments().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1909 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-23 19:40:52 +00:00
cmpilato
e400232039 Unify the option for enabling line numbers, and add support for line
number generation to the Pygments integration logic.

* viewvc.conf.dist,
* lib/config.py
  (Config.set_defaults): Collapse 'source_highlight_line_numbers' and
    'highlight_line_numbers' into just markup_line_numbers.

* lib/viewvc.py
  (MarkupHighlight.__init__, MarkupSourceHighlight.__init__): Trace
    option renames.
  (markup_stream_pygments): Recognize the markup_line_numbers option,
    and when set, use a custom LineNoHtmlFormatter class to generate
    line numbers similar to the way 'highlight' does.

* templates/docroot/styles.css
  (.line, .linenum): Tweak comment.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1908 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-23 19:22:33 +00:00
cmpilato
12c81ffae6 As part of issue #394, add support for integration with Pygments, the
Python-based syntax highlighting library.

* lib/config.py
  (Config.set_defaults): Add cfg.options.use_pygments option with a
    default value of 0.

* viewvc.conf.dist
  (use_pygments): Add use_pygments option under [options].

* lib/viewvc.py
  (markup_stream_pygments): New.
  (markup_or_annotate): Call markup_stream_pygments() before falling
    back to the command-line program options.

* templates/docroot/styles.css
  Add stylations for Pygments.

* CHANGES
  Note this change.

* INSTALL
  (TO THE IMPATIENT): Add Pygments to the list of supported
    highlighting engines.
  (ENABLING SYNTAX COLORATION): Rewrite this.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1906 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-23 18:42:43 +00:00
cmpilato
c252e41fc4 * bin/make-database
(__main__): Add some comments, and don't use the --host option with
    'mysql' if you don't have to.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1904 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-23 16:27:51 +00:00
cmpilato
940bac640b Add support for remote creation of ViewVC checkins database, and
handle Control-C more cleanly.

* bin/make-database
  (INTRO_TEXT): Update this text for accuracy and clarity.
  (__main__): Prompt the user for the database server hostname
    (defaulting to 'localhost'), and use the result with the --host
    argument to 'mysql'.  While here, catch the KeyboardInterrupt
    exception and silently terminate rather than raising a stacktrace.

Patch partially by Philip M. Gollucci <pgollucci {at} p6m7g8.com>.

Also:

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1902 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-23 12:41:46 +00:00
cmpilato
20c13ec06a * lib/viewvc.py
(view_directory): Always show the search form if enabled.  (If
    templates want to hide it when there are no files to search, they
    can.)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1899 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-22 18:18:48 +00:00
cmpilato
8274303424 * lib/viewvc.py
(common_template_data): Generate RSS hrefs for files, too, by using
    a directory search of its parent limited to the specified file.

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1898 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-22 17:58:21 +00:00
cmpilato
e689f77881 * templates/include/dir_footer.ezt
Fix an old reference to a long-since-renamed data dictionary object,
  and while here, make the regex search form look mo' betta.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1896 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-22 17:33:58 +00:00
cmpilato
43f5b14afa Continuing the endless quest to purge all HTML generation from
ViewVC's core libraries, turn the form hidden-values objects from HTML
strings to iterable objects that templates can use to *make* HTML strings.

* lib/viewvc.py
  (Request.get_form): Now prepare hidden values as an iterable list of
    objects with .name and .value attributes.
  (common_template_data): Don't add 'change_root_action' and
    'change_root_hidden_values' data dictionary items.
  (prepare_hidden_values): Remove as unused.

* templates/include/diff_form.ezt,
* templates/include/dir_footer.ezt,
* templates/include/dir_header.ezt,
* templates/include/paging.ezt,
* templates/include/pathrev_form.ezt,
* templates/include/sort.ezt,
* templates/diff.ezt,
* templates/log_table.ezt,
* templates/query_form.ezt,
* templates/revision.ezt
  Iterate over hidden-values items to generate <input type="hidden"
  .../> output.

* docs/upgrading-howto.html,
* docs/template-authoring-guide.html
  Note these changes.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1894 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-21 19:51:26 +00:00
cmpilato
263920a326 Give template authors the ability to reveal the active username.
* lib/viewvc.py
  (common_template_data): Add request.username to the common template
    data as 'username'.

* docs/template-authoring-guide.html
  Document the addition.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1893 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-21 13:21:14 +00:00
cmpilato
97ed841022 Add some variations on the eye theme.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1892 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-16 17:18:01 +00:00
cmpilato
802cf3cc5a Group some similarly-colored regions.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1891 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-15 14:30:05 +00:00
cmpilato
2253c4361c Fix issue #348 by making the 'co' parser more resilient to multiple
"special" lines of output.

Previously, output like the following would choke because the code was
able to deal with the first "special" line (the warning about unknown
phrases), but then wasn't able to handle the second "special" line
(about no side branches).

   $ co -pTAG_NAME /cvs/repos/some-file,v
   /cvs/repos/some-file,v  -->  standard output
   co: /cvs/repos/some-file,v: warning: Unknown phrases like `commitid ...;' are present.
   co: /cvs/repos/some-file,v: no side branches present for 1.1

If either of these lines had been the only special ones, stuff worked
fine.  But in concert, it all fell apart.

* lib/vclib/ccvs/bincvs.py
  (_parse_co_header): Use a line-reading loop instead of trying to
    expect certain output on specific lines.

Verified by: Ross Becker <ross {at} trapezenetworks.com>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1888 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-14 16:53:00 +00:00
cmpilato
debb3c26a3 Make the .itemprops() interface work for remote Subversion files, too.
* lib/vclib/svn/svn_ra.py
  (RemoteSubversionRepository.itemprops): Use svn_client_proplist2()
    instead of the RA interfaces.
  (RemoteSubversionRepository.created_rev): Rework this a little to
    handle the missing path case, and add some comments about the
    implementation.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1887 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-13 13:53:45 +00:00
cmpilato
2e6f3713c9 At least in one area of the codebase, avoid requiring a Python-2.3-ism.
* lib/config.py
  (Config._get_parser_items): New.
  (Config.get_authorizer_params): Use _get_parser_items() instead of
    the parser's items() function directly.

Reported by: Michael Leib <michael.leib {at} hypermediasystems.com>
(and even better...)
Verified by: Michael Leib <michael.leib {at} hypermediasystems.com>

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1886 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-12 21:13:14 +00:00
cmpilato
e7a8f0336f Don't show dead files at all when using search-based filtering.
* lib/viewvc.py
  (view_directory): Do search-based filtering before filtering on dead
    files (while still avoiding searches on dead files)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1883 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-12 18:48:53 +00:00
cmpilato
f81abbfd39 Avoid problems caused by trying to search files in a given CVS tag
that don't exist in that tag by doing tag-based filtering first, then
fulltext searching.  I think this fixes issue #346.

* lib/viewvc.py
  (search_file): New function, cored from the guts of ...
  (search_files): ... this now-removed function.
  (view_directory): Narrow the file field down by tag selection first
    before doing fulltext searches.

Reported by: Ross Becker <ross {at} trapezenetworks.com>

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1882 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-12 18:23:49 +00:00
cmpilato
555614bf5d Reduce the size of the 'highlight dots', and add an SVG version.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1881 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-05-06 23:03:06 +00:00
cmpilato
14e815a39b Don't ignore whitespace by default. That can be confusing to folks
expecting a diff.

* lib/config.py
  (Config.set_defaults): Default hr_ignore_white to 0 now.

* viewvc.conf.dist
  (hr_ignore_white): Default to 0 now.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1880 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-29 02:05:01 +00:00
cmpilato
e33aea9c56 Note the bugfix made in r1878.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1879 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-29 01:00:49 +00:00
cmpilato
3a3f309545 Fix issue #259 - the latest revision details page gets cached incorrectly.
* lib/viewvc.py
  (view_revision): Tell browsers not to cache the view of the youngest
    revision in a Subversion repository.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1878 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-29 00:59:09 +00:00
cmpilato
48eb269c38 Support a couple of different flavors of email address mangling.
* viewvc.conf.dist
  Update description of mangle_email_addresses option.

* lib/viewvc.py
  (mangle_email_addresses): New helper function.  Now supports a level of
    obfuscation without data loss.
  (htmlify): Use mangle_email_addresses() for address mangling.
  (format_log): Test for an explicit mangling level.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1877 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-28 19:20:17 +00:00
cmpilato
f30ceb4336 * viewvc.conf.dist
Clarify that only one authorizer can be in use at a time.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1876 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-28 18:25:06 +00:00
cmpilato
efd0ac1c26 Fix some URI encoding level issues with remote Subversion repository.
Noticed (and partial patch) by Jeffrey Klein <Jeffrey.Klein {at}
priorityhealth.com>.

* lib/vclib/svn/svn_ra.py
  Import urllib.
  (RemoteSubversionRepository._geturl): New helper function.
  (temp_checkout, RemoteSubversionRepository.openfile,
   RemoteSubversionRepository.itemlog, RemoteSubversionRepository.annotate, 
   RemoteSubversionRepository._get_dirents): Use the new .geturl() helper
    function.
  (RemoteSubversionRepository.itemprops): Wrap svn_ra_get_dir() in a
    try/except block to deal with older, busted versions of that AI.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1875 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-28 18:11:34 +00:00
cmpilato
f5cb5c1517 * lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository.created_rev): Rename 'full_name'
    parameter to 'path' for consistency with other interfaces.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1874 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-28 18:05:45 +00:00
cmpilato
3d2cf8380d Lose gzip-binary-using fallback code, and actually make the
allow_compress option do something useful.

. o O ( What other dead code exists in this software? )

* lib/viewvc.py
  Import the 'gzip' module unconditionally.
  (Request.__init__): Determine if gzip output encoding is allowed.
  (get_writeready_server_file): New.
  (download_tarball): Lose the code that falls back to using a gzip
    binary.  Use get_writeready_server_file()
  (generate_page, view_checkout, view_cvsgraph_image, view_doc,
    view_patch): Use get_writeready_server_file(), allowing it to do
    server header output finalization.

* lib/config.py
  (Config.set_defaults): No longer initialize self.utilities.gzip.
    Now initialize cfg.option.allow_compress to 0.

* viewvc.conf.dist
  (utilities.gzip): Lose.
  (options.allow_compress): Lose note that indicates that 'gzip' must
    be installed and accessible in the program path.

* docs/upgrading-howto.html
  Don't note the addition of cfg.utilities.gzip ... because I just
  un-added it.

* CHANGES
  Note support for gzip-encoded output.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1873 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-23 16:18:05 +00:00
cmpilato
e11d706f30 * lib/viewvc.py
(view_revision): Use repos.get_youngest_revision() instead of
    peeking at repos.youngest directly.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1872 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-22 18:58:35 +00:00
cmpilato
d2d405513e Add 'viewvc' text to the logo.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1871 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-22 16:53:57 +00:00
cmpilato
45cf2fa972 Cleanup the design a bit: contrast the greens some more, thicken the 'V'
border, and in general pay closer attention to line landings and such.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1870 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-22 16:04:59 +00:00
cmpilato
89b012eb9f Restore website files to XHTML validation standards.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1869 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-21 20:04:50 +00:00
cmpilato
2c6ccc0191 Add some ViewVC logo ideas I've been sitting on for a while.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1868 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-18 15:48:24 +00:00
cmpilato
acff76174e Add upgrading notes about the removal of 'roots' from most views.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1867 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-17 20:25:29 +00:00
cmpilato
5fb74427f2 Remove the roots collection from the common-to-every-page data
dictionary stuffs.  It can be expensive to generate (especially when
authorization is in place) and brings little value considering we have
a roots listing view.  The sole known casualty in this change is the
little drop-down roots listing box, which is often one of the first
customizations (removing this) that folks make to their ViewVC
instances anyway.

* lib/viewvc.py
  (find_root_in_parents, locate_root): New functions.
  (common_template_data): Move the root listing data dictionary stuff ...
  (view_roots): ... to here.  Now uses expand_root_parents().
  (load_config): This, however, no longer uses expand_root_parents.
  (Request.run_viewvc): Use locate_root() to find a requested root
    name rather than expecting cvs_roots and svn_roots to be fully
    populated.

* templates/include/header.ezt
  Lose the root listing drop-down box, and de-table-ize the breadcrumbs.

* templates/docroot/styles.css
  (.vc_navheader): Add some padding.

* docs/template-authoring-guide.html
  Move the 'roots' stuff from the COMMON template data collection to
  the section specific to the root listing view.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1865 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-17 19:52:30 +00:00
cmpilato
4f45a6b364 Minor code refactoring.
* lib/viewvc.py
  (expand_root_parents): New, factored out of ...
  (load_config) ... this.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1864 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-17 18:23:51 +00:00
cmpilato
f38dfba74d Fix some inconsistencies in the way the roots listing is handled and
referred to when root_as_url_component is disabled.

* lib/viewvc.py
  (Request.run_viewvc): Only assume the default rootname if we're not
    in root_as_url_component mode *and* we're aren't being asked to view
    the root listing.
  (common_template_data): Always calculate a roots_href.  Also,
    gracefully deal with request.rootname being None.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1863 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-17 17:07:28 +00:00
cmpilato
f97eeac785 * lib/vclib/ccvs/ccvs.py
(CCVSRepository.rawdiff): Update calls to itemlog() overlooked in r1857.

Found by: Daniel Berlin <danielberlin {at} tigris.org>

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1862 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-17 12:42:19 +00:00
cmpilato
f8ae6503fd * lib/viewvc.py
(common_template_data): Remove an obsolete TODO comment.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1861 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-16 20:51:20 +00:00
cmpilato
7cdabe099a * CHANGES
Add a note about recent pagination improvements.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1860 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-15 18:41:33 +00:00
cmpilato
e8123f68c2 Merge changes from the 'log-paging' branch:
$ svn merge -c1849,1850,1853,1854,1855,1856 \
    http://viewvc.tigris.org/svn/viewvc/branches/log-paging

This brings sliding-window-style pagination to the log revision view.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1857 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-15 18:17:02 +00:00
cmpilato
c1d3602bf3 * lib/vclib/svn/svn_ra.py
(RemoteSubversionRepository.itemprops): Pass the relative path to
    svn_ra_get_dir(), not the full URL.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1851 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-11 20:30:31 +00:00
cmpilato
18954aa9a9 Fix another bug in directory views that appeared when pagination was
enabled (in CVS).

* lib/viewvc.py
  (view_directory): Init the DirEntry.dead field.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1847 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-11 18:30:32 +00:00
cmpilato
c227c0a6e3 Fix a bug in directory views that appeared when pagination was enabled.
* lib/viewvc.py
  (view_directory): Init the DirEntry.lockinfo field.  (moral: The
    problem with cheating is that you eventually get caught.)



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1846 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-11 14:53:55 +00:00
cmpilato
4783fa5642 * lib/viewvc.py
(_legal_params): Move some params to a new grouping labeled as
    deprecated.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1845 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-11 14:52:27 +00:00
cmpilato
e2b02ff5f2 Add CHANGES item for property display.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1842 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-09 20:16:27 +00:00
cmpilato
3ab9ffbbc0 For issue #39, bang in some rudimentary support for displaying version
controlled item properties.  (Of course, this doesn't apply to CVS.)

* lib/vclib/__init__.py
  (Repository.itemprops): New.

* lib/vclib/ccvs/bincvs.py
  (BaseCVSRepository.itemprops): New.

* lib/vclib/svn/svn_repos.py
  (LocalSubversionRepository.itemprops): New.
  (LocalSubversionRepository._revinfo_raw): Fetch the whole revision
    proplist instead of repeatedly querying the filesystem.

* lib/vclib/svn/svn_ra.py
  (RemoteSubversionRepository.itemprops): New.

* lib/viewvc.py
  (get_itemprops): New.
  (markup_or_annotate, view_directory): Use get_itemprops().

* templates/docroot/styles.css
  (.vc_properties, .vc_properties h2): New style defs.

* templates/include/props.ezt
  New.

* templates/markup.ezt,
* templates/directory.ezt,
* templates/annotate.ezt
  Include the new props.ezt template chunk.

* docs/template-authoring-guide.html,
* docs/upgrading-howto.html
  Document the new data dictionary bits.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1841 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-09 20:14:33 +00:00
cmpilato
81b39b70a1 Add support to standalone.py for specifying a configuration file
location on the command-line.

* bin/standalone.py
  (handle_config): Add 'config_file' parameter.
  (serve): Update call to handle_config().
  (cli): Parse the -c / --config-file argument, and describe it in the
    usage message.  Also, disallow it when asked to be in GUI mode.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1840 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-08 16:38:25 +00:00
cmpilato
35a1dd9938 Mostly just formatting changes.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1839 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-04 17:30:28 +00:00
cmpilato
b4bf269cf2 Clarify the working copy / repository distinction for CVS newbies.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1838 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-04-01 00:55:05 +00:00
cmpilato
62f82645fd * templates/docroot/styles.css
Add "white-space: nowrap" to table headers.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1837 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-03-18 21:39:55 +00:00
cmpilato
8acb06b609 Rename the forbiddenre authorizer's configuration token to avoid
confusing folks upgrading from ViewVC 1.0.x.

* lib/vcauth/forbiddenre/__init__.py
  (ViewVCAuthorizer.__init__): Look for a configuration option called
    "forbiddenre" instead of "forbidden".

* lib/config.py
  (_force_multi_value): Remove "forbidden" from this list, as we don't parse
    its value directly any more.

* docs/upgrading-howto.html
  Update the section about migrating forbiddenness settings.

* viewvc.conf.dist
  Rename the authz-forbidden.forbidden option to authz-forbidden.forbiddenre.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1836 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-03-18 21:08:19 +00:00
cmpilato
96be9c14cd Stop generating tarball URLs that are outside the URL namespace of the
repository with which they are associated, and use the Content-Disposition 
HTTP header to suggest names for tarball downloads.

* lib/viewvc.py
  (Request.get_link): No longer generate tarball URLs with the .tar.gz
    magic suffix.  We'll stick with explicit view=tar from now on.
  (download_tarball): Use the Content-Disposition HTTP header to
    dictate the recommended tarball name to browser agents.

Patch by: Martijn Ras <Martijn.Ras {at} gmail.com>
          me


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1835 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-03-17 23:34:55 +00:00
cmpilato
eda0309c55 * lib/vclib/ccvs/bincvs.py
(BaseCVSRepository.itemtype): Initialize the 'kind' variable to
    prevent referencing a non-existent variable.

Patch by: Stephane Chazelas <stephane_chazelas {at} yahoo.fr>

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1834 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-03-04 17:28:30 +00:00
cmpilato
b03113f864 When I added the various view hrefs to the common template data (long
ago), I inadvertantly cross namespaces with the log view's use of
those variables as links to the HEAD versions of files.  Disambiguate
the head versions by renaming the data dictionary variables with head_
prefixes.

* lib/viewvc.py
  (view_log): Store HEAD href stuff in variables with "head_" prefixes
    so we don't clobber the global href variables.

* docs/upgrading-howto.html
  Note renames of annotate_href, download_href, download_text_href,
  prefer_markup, and view_href to head_annotate_href, head_download_href, 
  head_download_text_href, head_prefer_markup, and head_view_href
  (respectively).

* docs/template-authoring-guide.html,
* templates/include/log_header.ezt
  Track template variable renames.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1833 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-03-04 14:25:14 +00:00
cmpilato
5f8d6a1ff4 Truncate Subversion item log history if it dips into unreadable
(authz-wise) territory.  This should also filter unreadable revisions
from the annotate view, but I'm not as confident about that change.

* lib/vclib/svn/svn_repos.py
  (_get_history): Add 'path_type' parameter, rename 'full_name'
    parameter to 'path',  and truncate history at the first unreadable
    location (if any).
  (BlameSource.__init__): Pass 'first_rev' as the starting revision to
    the Subversion annotate logic, but leave a comment here questioning
    whether it was the right thing to do.
  (LocalSubversionRepository.itemlog): Update call to _get_history(),
    and filter unreadable copyfrom paths.
  (LocalSubversionRepository.annotate): Update call to _get_history().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1832 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-03-03 21:36:27 +00:00
cmpilato
8bc4d0109c Make some minor (though nice in terms of code readability)
optimizations to the way history is crawled in Subversion backends.

* lib/vclib/svn/svn_repos.py
  (NodeHistory): Make this into an iterable object instead of relying
    on a peek into a member variable.
  (NodeHistory.__init__): Make histories a list instead of
    dictionary.  We need the ordering.
  (NodeHistory.add_history): Validate the order in which revision info
    is received -- order matters now.
  (NodeHistory.__getitem__): New.
  (_get_history): Return the NodeHistory object, which is now iterable.
  (_log_helper): Swap the order of the 'path' and 'rev' parameters
    (for consistency).
  (_fetch_log): Merged into its only caller, which was ...
  (LocalSubversionRepository.itemlog): ...this.  Update the use of
    NodeHistory here to avoid unnecessary sorts and reverses and such.
  (LocalSubversionRepository.annotate): Update the use of NodeHistory here.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1831 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-03-03 21:00:45 +00:00
cmpilato
261db1bb7f * lib/vclib/svn/svn_repos.py
(LocalSubversionRepository.openfile, LocalSubversionRepository.listdir, 
   LocalSubversionRepository.dirlogs, LocalSubversionRepository.annotate): 
    Use self.itemtype() to pull off both an authz check as well as 
    kind-in-light-of-operation validation.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1830 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-03-03 20:35:19 +00:00
cmpilato
e1f287360a Add some missing module imports.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1829 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-28 16:14:15 +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
c58e82a6e2 Update the www/ area and CHANGES file in light of 1.0.5 release.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1827 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-28 15:49:20 +00:00
cmpilato
8916fe3969 Forward-port tweak to forbiddenre support made in r1817 on the 1.0.x branch.
* lib/vcauth/forbiddenre/__init__.py
  (ViewVCAuthorizer._check_root_path_access): Lose 'rootname' and
    'path_parts' parameters and logic to combine them; just accept the
    combined form as a new 'root_path' parameter.
  (ViewVCAuthorizer.check_root_access): Update call to 
    _check_root_path_access().
  (ViewVCAuthorizer.check_path_access): Do root and path combination
    here, and Update call to _check_root_path_access().

* viewvc.conf.dist
  (forbiddenre.forbidden): Update documentation and examples.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1818 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-25 21:07:06 +00:00
cmpilato
301281228b merge from 1.0.x -r1815, whose log message read thusly:
Fix the plus/minus line change counting in query results to ignore
   values from unreadable files.
   
   * lib/viewvc.py
     (build_commit): Calculate total plus/minus line change count for a
       given commit item (based on the sums of those values in
       non-forbidden file commits associated with it).
     (view_query): Update plus/minus line change count totals only
       *after* trimming unauthorized files
   
   * docs/template-authoring-guide.html
     (query_results): Note new commits.plus and commits.minus items; fix
       description of the plus_count and minus_count items.

While here, also:

* lib/viewvc.py
  (build_commit): Fix the authz check to use vclib.check_path_access,
    and feel vindicated by the fact that I actually found a use for
    that function.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1816 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-25 19:32:21 +00:00
cmpilato
7ed848b084 Update copyright years.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1813 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-22 15:11:27 +00:00
cmpilato
cf1f2ff5dd * viewvc.org/nightly/build-viewvc-snapshot
Completely rework this thing, in Python, to support more flexible branch
builds.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1812 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-22 14:49:12 +00:00
cmpilato
af559e2665 Fix a buglet that, for some reason, only shows up when viewing CVSROOT
directories.

* lib/vclib/ccvs/bincvs.py
  (_get_logs): Initialize CVSDirEntry item's lockinfo member to None.

* lib/vclib/ccvs/ccvs.py
  (CCVSRepository.dirlogs): Initialize CVSDirEntry item's lockinfo
    member to None.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1808 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-21 21:59:45 +00:00
cmpilato
8dadbb3674 Honor hide_cvsroot more like the CVSROOT is forbidden than simply obscured.
* lib/viewvc.py
  (is_cvsroot_path): New helper function.
  (view_directory, generate_tarball, build_commit): Use is_cvsroot_path().

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1806 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-21 21:41:17 +00:00
cmpilato
343ca81dbd * viewvc.conf.dist: Note that you can use this to hide roots, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1805 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-21 20:33:55 +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
f535d8e599 Tweak authz changes a bit.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1803 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-21 20:14:17 +00:00
cmpilato
08e86c9a45 Minor fixes required by new authz logic.
* lib/viewvc.py
  (_strip_suffix): If no path_parts are provided, return None.
  (Request.run_viewvc): Tweak the 404 error to, among other things,
    always have a leading slash on the path (so the empty path doesn't
    look so odd).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1799 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-15 20:50:22 +00:00
cmpilato
5a238e6a56 Tweak the contact summary a bit.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1796 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-14 15:53:23 +00:00
cmpilato
6ac32c2f1b Put a link to the FAQ and open issues on the Contact page.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1795 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-14 15:48:35 +00:00
cmpilato
7cf7328238 * lib/vclib/svn/svn_repos.py
Tweak all uses of vclib.svn.core.* to be just core.*


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1794 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-13 21:34:31 +00:00
cmpilato
10fa46063c * lib/vclib/svn/svn_repos.py
(LocalSubversionRepository.dirlogs): Oops!  Fix a buglet caused by
    looking at the wrong revision-holding variable.
 

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1791 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-13 17:39:12 +00:00
root
02f7f5b203 Committed through web interface.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1790 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-13 03:47:13 +00:00
root
431e05efd2 auto commit for alm editor.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1789 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-13 03:47:13 +00:00
root
13a6a53f9d auto commit for alm editor.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1788 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-13 03:47:12 +00:00
cmpilato
3cbf07551b Finish issue #57 with more support for showing locked status.
* lib/vclib/__init__.py
  (Repository.dirlogs): Update comment.
  (Revision.__init__): Add 'lockinfo' parameter, used to populate
    similarly named class member.

* lib/vclib/svn/svn_repos.py
  (Revision.__init__): Add 'lockinfo' parameter, and update call to
    vclib.Revision().
  (_log_helper): Update call to Revision(), and lose custom lockinfo handling.
  (LocalSubversionRepository.dirlogs): Populate entry lockinfo with a
    call to svn_fs_get_lock() for each entry.

* lib/vclib/svn/svn_ra.py
  (LogCollector.__init__): Add 'lockinfo' parameter, used to populate
    similarly named class member.
  (LogCollector.add_log): Pass self.lockinfo to updated call to Revision().
  (RemoteSubversionRepository.itemlog): Pass lock info to
    LogCollector(), and lose custom lockinfo handling.
  (RemoteSubversionRepository.itemtype, RemoteSubversionRepository.listdir): 
    Update expected return value from _get_dirents().
  (RemoteSubversionRepository.dirlogs): Populate entry lockinfo from
    updated return value from _get_dirents().
  (RemoteSubversionRepository._get_dirents): Rework to trade in
    dirents and locks instead of only dirents.

* lib/vclib/ccvs/bincvs.py
  (Revision.__init__): Update call to vclib.Revision().
  (_get_logs): Add 'lockinfo' member to DirEntry() items.

* lib/vclib/ccvs/ccvs.py
  (InfoSink.__init__): Init lockinfo dictionary.
  (InfoSink.set_locker): New.
  (InfoSink.define_revision): Set lockinfo on Revision item.
  (InfoSink.set_revision_info): Populate DirEntry lockinfo from
    Revision lockinfo data.

* lib/viewvc.py
  (view_directory): Populate entry lockinfo.
  (common_template_data): Populate the 'lockinfo' data dictionary item.

* templates/directory.ezt,
* templates/dir_new.ezt
* templates/annotate.ezt,
* templates/markup.ezt
  Tweak to show lock status.

* docs/template-authoring-guide.html
  Note new data dictionary items.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1787 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-12 21:06:40 +00:00
cmpilato
d620498e9e Add support for display of locked status.
* docs/template-authoring-guide.html
  Document the new appearances of the lockinfo data.

* templates/log.ezt,
* templates/log_table.ezt
  Show lock status information.

* templates/docroot/images/lock.png
  New icon.

* lib/viewvc.py
  (view_log): Populate the log revision entry's new "lockinfo" member.

* lib/vclib/svn/svn_repos.py
  (_log_helper): Accept 'lockinfo' parameter, used to populate the
    similarly named member of the Revision() object.
  (_fetch_log): Query the lock status of the input path, and update
    calls to _log_helper().

* lib/vclib/ccvs/ccvs.py
  (CCVSRepository.itemlog): Update call to _file_log(), passing lockinfo.
  (TreeSink.__init__): Init new lockinfo dictionary.
  (TreeSink.set_locker): New.

* lib/vclib/ccvs/bincvs.py
  (_parse_log_header): Now parse and return lock information, too.
  (_file_log): Add 'lockinfo' parameter, used to populate the
    similarly named Revision() object members.
  (BinCVSRepository._get_tip_revision, BinCVSRepository.itemlog):
    Expect lockinfo back from _parse_log_header(), and pass to updated
    calls to _file_log().
  (_get_logs): Expect lockinfo back from _parse_log_header().

* lib/vclib/svn/svn_ra.py
  (RemoteSubversionRepository.itemlog): Use svn_client_ls3() to fetch
    lock information.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1783 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-12 19:41:19 +00:00
cmpilato
2a9584a0fb Finish issue #238 by not making HTML out of short log messages in RSS
format mode.

* lib/viewvc.py
  (format_log): Now accept optional 'htmlize' parameter.
  (build_commit): Accept 'format' parameter, and use it to determine
    what value to pass for the 'htmlize' parameter of an updated call
    to format_log().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1779 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-12 15:29:28 +00:00
cmpilato
e6d8e1306d * bin/loginfo-handler,
* bin/cvsdbadmin
  Update calls to vclib.ccvs.CVSRepository() to account for new
  'authorizer' parameter.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1778 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-12 15:27:12 +00:00
cmpilato
34f764bc8f * lib/config.py
(Config.get_authorizer_params): Rework this to avoid Python 2.4-ism
    (dict.update() able to accept an iterable key/value sequence) and
    to favor root-specific parameters over general ones.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1777 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-12 15:02:41 +00:00
cmpilato
34e7003241 Minor typo fix.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1776 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-12 14:48:41 +00:00
cmpilato
cedb97c3d4 Finish issue #305 by allowing "markup" to be the configured default
file view.  This causes less-than-perfectly-compact URL generation in
some cases, but frankly, we'd have fewer URL-compatibility issues if
we hadn't been trying to discard information in the first place.

* lib/viewvc.py
  (Request.run_viewvc, Request.get_link): Honor "markup" as a valid value for
    default_file_view.

* viewvc.conf.dist
  (default_file_view): Note that "markup" is now a valid option here.

* CHANGES
  Record this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1775 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-11 22:16:00 +00:00
cmpilato
47ad6e149c Fix some minor oversights.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1774 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-11 22:11:16 +00:00
cmpilato
c7a392b75c Be so bold as to claim that the authz subsystem is in 1.1.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1773 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-11 21:14:02 +00:00
cmpilato
e0dff2601a Mostly unify the markup and annotate view logic. This does *not*
unify the views themselves; just the code that generates them.

* lib/viewvc.py
  (markup_or_annotate): New, carved from the guts of ...
  (view_markup, view_annotate): ... these, which are now just thin
    wrappers around markup_or_annotate().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1772 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-11 20:51:56 +00:00
cmpilato
fcf52b5c5f * lib/vclib/svn/svn_repos.py
(BlameSource._blame_cb): Increment the line number by 1;
    Subversion's annotate APIs are 0-based.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1771 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-11 20:47:11 +00:00
cmpilato
8f0623abc0 This is a cleanup commit, mostly around making sure that Repository.revinfo()
consistently returns a date, *not* a date string.

* lib/viewvc.py
  (_get_diff_path_parts): Fix the call to _path_parts to, you know,
    not reference bogus variables and actually use the value returned.

* lib/vclib/svn/svn_ra.py
  (LastHistoryCollector.add_history): Convert the date string to a real date.  
  (temp_checkout): Keep a handle on the name of the temporary file
    created, since that's what is returned by this function.
  (rawdiff): Look for Subversion exceptions in the proper namespace.

* lib/vclib/svn/svn_repos.py
  (_date_from_rev): Make this an inner function of rawdiff(), its only
    consumer.
  (_log_helper, LocalSubversionRepository.dirlogs): Don't convert the
    returned date.
  (LocalSubversionRepository._revinfo_raw): Return a date, not a date string.
  (BlameSource.__init__): Expect exceptions in the right namespace.
  (LocalSubversionRepository.rawdiff): Update call to _date_from_rev;
    expect exceptions in the right namespace.
  


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1770 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-11 16:53:20 +00:00
cmpilato
c3572f452c Fix a little buglet -- referencing a non-existant object.
* lib/vclib/svn/svn_ra.py
  (RemoteSubversionRepository.open): Use self.ctx.*, not just ctx.*

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1769 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-07 22:53:16 +00:00
cmpilato
a9243564bb * INSTALL: Recommend adding ViewVC to the site-wide robots.txt file.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1765 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-07 02:20:24 +00:00
cmpilato
b049f1dca8 * viewvc.conf.dist
(authorizer): Update comment to describe provided authorizers and
    mention forbiddenre.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1764 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-06 21:21:00 +00:00
cmpilato
057ab0fe25 Introduce a new authz module, like 'forbidden' but with support for
checking all roots and paths against regular expressions.

* viewvc.conf.dist
  (forbidden): New authz-forbiddenre section.

* lib/vcauth/forbiddenre,
* lib/vcauth/forbiddenre/__init__.py
  New authorizer based on simple regular expressions.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1763 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-06 21:16:51 +00:00
cmpilato
220792f72c Merge to trunk all the changes from the 'vcauth-reorg' branch as of
r1761, which see for logs.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1762 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-06 19:22:53 +00:00
cmpilato
c696f32d70 * lib/config.py
(Config.set_defaults): Clear the default admin address.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1758 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-02-06 17:48:45 +00:00
cmpilato
3a8717b11d Formatting and comment changes only.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1750 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-01-28 17:55:44 +00:00
cmpilato
edaae720da * lib/viewvc.py
(Request.__init__): Stop calculating and storing the 'may_compress'
    and 'no_file_links' values -- we don't use them anywhere!

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1749 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-01-28 17:46:23 +00:00
cmpilato
eb363507cb * INSTALL
Note that we now expect source-highlight 2.6.

* templates/docroot/styles
  Add style definitions to match the style names used by
  source-highlight.

* lib/viewvc.py
  (MarkupSourceHighlight.__init__): Use the 'xhtml-css' output format,
    and pass the --quiet option to suppress any noise that would
    wind up on stderr.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1748 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-01-24 22:02:19 +00:00
cmpilato
44f0356312 Try to use Python's gzip module for the tarball generation view, thus
reducing the list of binary dependencies by one for users of ... well,
any Python version that I could find as of at least 1.5.2.

TODO:  Are there any versions of Python supported by ViewVC in general
that don't provide the 'gzip' module?  Should we just rip out the use
of the external binary altogether?

(This was tracked in issue #319.)

* lib/viewvc.py
  (download_tarball): Use Python's gzip module if available, only
    falling back to a pipe through the gzip binary if it isn't.

* viewvc.conf.dist
  (cfg.utilities.gzip): Note that this setting is optional if Python
    provides the 'gzip' module.

Patch by: Gabriel Genellina <ggenellina@tigris.org>
(Tweaked by me.)

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1747 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-01-24 19:40:37 +00:00
cmpilato
d966338c1d Add an href to the root listing view to the common template data dictionary.
* lib/viewvc.py
  (common_template_data): Calculate and add 'roots_href' to the dictionary.

* templates/include/header.ezt
  Use new 'roots_href' data dictionary item.

* docs/template-authoring-guide.html
  Note this new dictionary member.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1746 8cb11bc2-c004-0410-86c3-e597b4017df7
2008-01-10 19:21:26 +00:00
cmpilato
8f49d24d7f Add some hints to INSTALL about getting Subversion and its bindings.
Suggested by user 'johnkw' in IRC.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1745 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-12-04 17:43:18 +00:00
cmpilato
aa6b9dcf8e Merge changes (r1735:1738) from the (misnamed) options-overhaul
branch.  This reduces the number of vclib plugins to two -- one for
each of CVS and Subversion.

* lib/viewvc.py
  (): Update callers of vclib.svn.created_rev(), vclib.svn.get_location(),
    vclib.svn.get_youngest_revision(), and vclib.svn.last_rev() to use
    request.repos.* instead.
  (Request.run_viewvc): For CVS, invoke only
    vclib.ccvs.CVSRepository(), but pass the use_rcsparse setting to
    it.  For Subversion, invoke only vclib.svn.SubversionRepository().

* lib/vclib/ccvs/ccvs.py
  Renamed from lib/vclib/ccvs/__init__.py, and tweaked to look for
  stuff common to the bincvs implementation in the sibling 'bincvs'
  module.

* lib/vclib/ccvs/__init__.py
  New, a replacement by a new stub file with a factory function
  that selects which CVS implementation to use.

* lib/vclib/ccvs/bincvs.py
  Moved from lib/vclib/bincvs/__init__.py.

* lib/vclib/bincvs
  Removed (it's now empty).

* lib/vclib/svn/svn_repos.py
  Renamed from lib/vclib/svn/__init__.py.
  (LocalSubversionRepository.created_rev,
   LocalSubversionRepository.get_location,
   LocalSubversionRepository.get_youngest_revision, 
   LocalSubversionRepository.last_rev): Moved into the class from outside.

* lib/vclib/svn/svn_ra.py
  Moved from lib/vclib/svn_ra/__init__.py.
  (RemoteSubversionRepository.created_rev,
   RemoteSubversionRepository.get_location,
   RemoteSubversionRepository.get_youngest_revision, 
   RemoteSubversionRepository.last_rev): Moved into the class from outside.

* lib/vclib/svn/__init__.py
  New, replacing previous incarnation with a file that contains only a
  single factory function.

* lib/vclib/svn_ra/
  Removed (it's now empty).

* bin/loginfo-handler
  (ProcessLoginfo): Now use vclib.ccvs.CVSRepository(), disabling use_rcsparse.

* bin/cvsdbadmin
  (__main__): Now use vclib.ccvs.CVSRepository(), disabling use_rcsparse.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1739 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-12-03 15:25:51 +00:00
mhagger
37373d8ab2 Change the way that rcsparse components are imported in run-tests.py.
The new method will work even if the contents of the "rcsparse"
directory are stored to a directory with a different name (as is the
case, for example, in cvs2svn).

* lib/vclib/ccvs/rcsparse/run-tests.py: Change how rcsparse.parse()
  and parse_rcs_file.LoggingSink are imported.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1734 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 22:59:09 +00:00
mhagger
5ab76ea1cf Change the way that rcsparse.parse() is imported in parse_rcs_file.py.
The new method will work even if the contents of the "rcsparse"
directory are stored to a directory with a different name (as is the
case, for example, in cvs2svn).

* lib/vclib/ccvs/rcsparse/parse_rcs_file.py: Change how
  rcsparse.parse() is imported.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1733 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 22:53:35 +00:00
mhagger
0e6c162246 Add method _Parser._read_until_semicolon(), and use it in other methods.
* lib/vclib/ccvs/rcsparse/common.py (_Parser._read_until_semicolon):
  New method.

  (_Parser._parse_admin_access, _Parser._parse_rcs_tree_entry): Use
  the new method.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1732 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 21:15:27 +00:00
mhagger
1f2a3399ea Fix and simplify the handling of dates in _Parser._parse_rcs_tree_entry().
* lib/vclib/ccvs/rcsparse/common.py (_Parser._parse_rcs_tree_entry):
  Adjust the handling of dates to conform more strictly to
  rcsparse(5), and simplify logic a bit.

* lib/vclib/ccvs/rcsparse/test-data/default,v,
  lib/vclib/ccvs/rcsparse/test-data/default.out: Change test case to
  include dates before the year 2000.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1731 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 21:13:53 +00:00
mhagger
53b48c9b4f Don't carry zeros along in date tuple.
* lib/vclib/ccvs/rcsparse/common.py (_Parser._parse_rcs_tree_entry):
  Append zeros to the end of the date tuple only when they are needed.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1730 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 21:05:16 +00:00
mhagger
e906090e8c Simplify _Parser._parse_rcs_tree_entry().
* lib/vclib/ccvs/rcsparse/common.py (_Parser._parse_rcs_tree_entry):
  Simplify logic.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1729 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 21:01:16 +00:00
mhagger
af7956447b Extract method _Parser._parse_rcs_tree_entry().
* lib/vclib/ccvs/rcsparse/common.py (_Parser._parse_rcs_tree_entry):
  New method, extracted from parse_rcs_tree().

  (_Parser.parse_rcs_tree): Use new method.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1728 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 21:00:21 +00:00
mhagger
939c980e5b Simplify _Parser._parse_admin_access().
* lib/vclib/ccvs/rcsparse/common.py (_Parser._parse_admin_access):
  Simplify logic and use list.append(x) instead of "list = list +
  [x]".


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1727 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 20:59:01 +00:00
mhagger
7a8d3c0453 Rename some local variables to better describe their uses.
* lib/vclib/ccvs/rcsparse/common.py (_Parser._parse_admin_access,
  _Parser._parse_admin_symbols, _Parser._parse_admin_locks): Rename
  local variables.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1726 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 20:58:00 +00:00
mhagger
7e0b5d2a9c Use match() to handle semicolons when possible.
This simplifies the code without a measureable performance cost.

* lib/vclib/ccvs/rcsparse/common.py (_Parser._parse_admin_head,
  _Parser._parse_admin_branch, _Parser._parse_admin_comment,
  _Parser._parse_admin_expand): Use the token scanner's match() method
  to handle semicolons.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1725 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 20:57:02 +00:00
mhagger
d7c87b8b2f Change the token stream match() methods to raise RCSExpected exceptions.
Previously, they raised a naked RuntimeError.  This change should be
harmless because nobody seems to catch these exceptions specifically.

* lib/vclib/ccvs/rcsparse/default.py (_TokenStream.match): Raise
  RCSExpected exception in the case of a mismatch.

* lib/vclib/ccvs/rcsparse/texttools.py (_mxTokenStream.match): Raise
  RCSExpected exception in the case of a mismatch.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1724 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 20:56:26 +00:00
mhagger
8087c0e643 Improve the error message for RCSExpected exceptions.
* lib/vclib/ccvs/rcsparse/common.py (RCSExpected.__init__): Improve
  the error message passed to the base class constructor.  Also
  improve spacing around the exception class definitions.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1723 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 20:53:40 +00:00
mhagger
4c04da27da Simplify the logic in texttools._mxTokenStream.match() (remove duplicate code).
* lib/vclib/ccvs/rcsparse/texttools.py (_mxTokenStream.match):
  Remove duplicate code.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1722 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 20:52:39 +00:00
mhagger
34f76bdc87 Handle files with empty "delta" (a.k.a., "tree") part.
According to rcsfile(5), there don't have to be any deltas in an RCS
file.  File without deltas can be created using "rcs -i -t- foofile".
This change allows rcsparse to handle such files.

This change might help fix cvs2svn Issue #80:
http://cvs2svn.tigris.org/issues/show_bug.cgi?id=80

* lib/vclib/ccvs/rcsparse/common.py (_Parser.admin_token_map): Add an
  entry for "desc" (because if the tree is empty, the next thing
  encountered after the administrative information is "desc").

  (_Parser.parse_rcs_admin): Terminate loop if "desc" is seen.

* lib/vclib/ccvs/rcsparse/test-data/empty-file,v,
  lib/vclib/ccvs/rcsparse/test-data/empty-file.out: Add a test RCS
  file with no contents to test data, and the results expected when
  parsing the file.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1721 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 20:51:40 +00:00
mhagger
57bf0cb554 Handle a "head" keyword with no revision number.
According to rcsfile(5), this is allowed.  In this situation, don't
invoke the set_head_revision() callback at all.

* lib/vclib/ccvs/rcsparse/common.py (_Parser._parse_admin_head): Handle
  the case that the "head" keyword doesn't list a revision.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1720 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 20:49:38 +00:00
mhagger
9adcdfae2f Remove dead code.
* lib/vclib/ccvs/rcsparse/common.py (_Parser.parse_rcs_admin): Remove
  dead code (the only way to escape from the loop is via "return").


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1719 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 20:47:29 +00:00
mhagger
075b580fdb Rewrite _Parser.parse_rcs_admin() to use a token lookup table.
* lib/vclib/ccvs/rcsparse/common.py (_Parser._parse_admin_head,
  _Parser._parse_admin_branch, _Parser._parse_admin_access,
  _Parser._parse_admin_symbols, _Parser._parse_admin_locks,
  _Parser._parse_admin_strict, _Parser._parse_admin_comment,
  _Parser._parse_admin_expand): New methods (one for each keyword that
  can appear in the admin section).

  (_Parser.admin_token_map): A map from keyword name to the method
  used to handle that keyword.

  (_Parser.parse_rcs_admin): Look up the keyword tokens in the map
  instead of using a big "if" statement.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1718 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 20:46:46 +00:00
mhagger
ae57f73e2f Separate handling of the "strict" keyword into a separate "if" branch.
This makes the keyword handling more uniform.

* lib/vclib/ccvs/rcsparse/common.py (_Parser.parse_rcs_admin):
  Separate handling of the "strict" keyword into a separate "if"
  branch.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1717 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 20:46:03 +00:00
mhagger
a70372d2ed Reorder definitions in the approximate order that they will be called.
Order the callbacks in Sink and the "if" branched in parse_rcs_admin()
in the approximate order that they will be encountered.

* lib/vclib/ccvs/rcsparse/common.py (Sink): Reorder method definitions.

  (_Parser.parse_rcs_admin): Reorder "if" statement branches.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1716 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-18 20:45:09 +00:00
cmpilato
9ce172e673 Welcome aboard, Michael.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1715 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-16 09:53:25 +00:00
cmpilato
bac09990f6 Fix a syntax error that was preventing compilation.
Submitted by: Michael Haggerty <mhagger@alum.mit.edu>

* tparse/tparse.h 
  (rcstoken::init): Fix declaration.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1714 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-16 09:49:22 +00:00
cmpilato
e2b783a403 * lib/vclib/ccvs/rcsparse/parse_rcs_file.py
Set svn:executable property for this file.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1713 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-16 09:44:12 +00:00
cmpilato
db6fbcdf1f Add a very primitive testing infrastructure for rcsparse, and the first test.
Submitted by: Michael Haggerty <mhagger@alum.mit.edu>

* lib/vclib/ccvs/rcsparse/run-tests.py: New file.

* lib/vclib/ccvs/rcsparse/test-data/default,v,
* lib/vclib/ccvs/rcsparse/test-data/default.out
  Test data for a simple test.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1712 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-16 09:42:56 +00:00
cmpilato
fcf688c20c Add a new test/demonstration script.
Submitted by: Michael Haggerty <mhagger@alum.mit.edu>

This script was taken from the cvs2svn project, http://cvs2svn.tigris.org.

* lib/vclib/ccvs/rcsparse/parse_rcs_file.py: New demonstration script;
  illustrates the use of the rcsparse API.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1711 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-11-16 09:39:14 +00:00
cmpilato
6c7de54d87 * viewvc.org/faq.html
Add a FAQ entry for the "...but none match the current selection
  criteria" error.  Suggested by user "brasko" in IRC today.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1710 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-10-30 21:43:56 +00:00
cmpilato
94017f01e8 * docs/upgrading-howto.html
Add a note about the change to 'svndbadmin rebuild'.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1709 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-10-09 13:21:13 +00:00
cmpilato
2856ac9ebc * viewvc.org/faq.html
(missing-files): Start answering this question.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1708 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-10-01 18:20:52 +00:00
cmpilato
525523e465 Prevent Exception when generating tarballs for remote Subversion
repositories.

* lib/vclib/svn_ra/__init__.py
  (SelfCleanFP.read): Add default parameter value for 'len' argument.

Patch by: Ceri Storey <cez@necrofish.org.uk>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1706 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-09-14 13:02:21 +00:00
cmpilato
7d4ce47182 * bin/cvsdbadmin,
* bin/svndbadmin
  (usage): Make it clear that the REPOSITORY command-line argument
    is a path to a repository (as opposed to a ViewVC rootname or
    relative URL or something else).

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1703 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-08-16 17:26:49 +00:00
cmpilato
efad0b6cd6 Add FAQ-n-A about RSS feeds.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1702 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-07-30 15:48:22 +00:00
cmpilato
3d6f1cc7d1 Finish issue #309: add links from diff view to revision views.
* lib/viewvc.py
  (view_diff): Rework the data dictionary: provide 'left' and 'right'
    container objects with members for stuff related to the files on
    the left and right side of the diff.  Also, add the usual
    per-file-revision view links to those containers, too.

* templates/diff.ezt
  Track the data dictionary changes, and add links to the preferred
  file views for each revision.

* docs/template-authoring-guide.html,
* docs/upgrading-howto.html
  Note template changes.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1701 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-07-26 20:56:10 +00:00
cmpilato
3d7b8a7a1a * docs/upgrading-howto.html
Followup to r1699, noting new 'rss_link_href' data dictionary item.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1700 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-07-26 20:44:41 +00:00
cmpilato
ed5898c37d Finish issue #307: RSS feeds should include a <channel><link> element.
* lib/viewvc.py
  (Request.get_url): Add new 'prefix' parameter, used to toggle
    whether or not the generated URL has the protocol and server name
    portions of the URL.  Move code from build_commit() to handle the
    prefix-inclusive case.
  (build_commit): Move URL prefix-generating code to
    Request.get_url(), and simply call that function with the new
    'prefix' option set.
  (view_query): Add new 'rss_link_href' data dictionary item.

* templates/rss.ezt
  Add <channel><link> bit to the output stream, populated with the new
  'rss_link_href' data dictionary item.

* docs/template-authoring-guide.html
  Add documentation for the new 'rss_link_href' data dictionary item,
  and note that query results also use rss.ezt.
  



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1699 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-07-26 18:55:15 +00:00
cmpilato
c487361c95 Note some completed enhancements.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1698 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-07-20 14:31:31 +00:00
cmpilato
b037efb91e Add a FAQ item about path-based authz.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1697 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-07-13 19:18:22 +00:00
cmpilato
29057c811f Finish issue #306 - RSS content type should be more specific.
* lib/viewvc.py
  (view_query): Use "application/rss+xml" instead "text/xml" for 
    the RSS feed output stream's content type.  Suggested by 
    Phil Ringnalda <philringnalda@tigris.org>.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1695 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-07-09 18:18:01 +00:00
cmpilato
8ca49db267 * viewvc.org/faq.html
(standalone-only): New question and answer about why stuff sometimes
    works under standalone.py but not under Apache with the same
    configuration.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1694 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-07-05 16:59:51 +00:00
cmpilato
d4e115bd3a * viewvc.org/faq.html
Answer the "no module named svn" question.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1693 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-07-05 16:22:16 +00:00
cmpilato
d09280ce6b * viewvc.org/faq.html
Reformat "questions" as (of all things) questions.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1692 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-07-05 16:19:55 +00:00
cmpilato
98aeeab676 * viewvc.org/faq.html
Populate the answer to the "missing temporary directory" question.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1691 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-07-05 16:09:23 +00:00
cmpilato
061b30a108 * viewvc.org/styles.css
(faq-section): New style name.

* viewvc.org/faq.html
  Make h3's bear the new faq-section style.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1690 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-07-05 16:04:13 +00:00
cmpilato
01baf48a1b Update the vhosts config example to not use 'cvs' and 'svn' in vhost names.
This was too easily confused with root type declarations.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1688 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-28 15:54:49 +00:00
cmpilato
46e7cdf817 * templates/rss.ezt
For issue #238, properly XML-entity-encode the log message embedded
  in RSS feed items.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1686 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-27 17:41:57 +00:00
cmpilato
703327df1c Implement a more-or-less generic global revision info function in the
vclib.Repository interface, and adapt the Subversion vclib modules to
implement it.

* lib/vclib/__init__.py
  (ADDED, DELETED, REPLACED, MODIFIED): New static variables.
  (Repository.revinfo): New function.
  (ChangedPath): New class.
  (UnsupportedFeature): New exception type.

* lib/vclib/bincvs/__init__.py
  (BinCVSRepository.revinfo): New (just raises vclib.UnsupportedFeature).

* lib/vclib/ccvs/__init__.py
  (CCVSRepository.revinfo): New (just raises vclib.UnsupportedFeature).

* lib/vclib/svn/__init__.py
  (SVNChangedPath): Was ChangedPath, now is a subclass of vclib.ChangedPath.
  (SubversionRepository.revinfo): Was get_revision_info().  Rework to
    use SVNChangedPath items.

* lib/vclib/svn_ra/__init__.py
  (): Import SVNChangedPath instead of ChangedPath.
  (LastHistoryCollector.add_history): Rework to use SVNChangedPath items.
  (SubversionRepository.revinfo): Was get_revision_info().

* lib/viewvc.py
  (view_revision): Rework this to use Repository.revinfo()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1685 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-27 16:41:03 +00:00
cmpilato
da80a5898a Minor code cleanups (doing in vclib.svn_ra what I recently did in vclib.svn).
* lib/vclib/svn_ra/__init__.py
  (get_logs): Merge this (and delete it) ...
  (SubversionRepository.dirlogs): ... into here.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1684 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-27 15:04:39 +00:00
cmpilato
2601c02f5d Minor code cleanups.
* lib/vclib/svn/__init__.py
  (get_logs): Merge this (and delete it) ...
  (SubversionRepository.dirlogs): ... into here.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1683 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-27 14:58:30 +00:00
cmpilato
ad877bd5a5 Minor code simplification.
* lib/vclib/svn_ra/__init__.py
  (SubversionRepository.__init__): Trade a bunch of list.append() calls for
    a static initializition of the list.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1682 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-27 14:24:56 +00:00
cmpilato
2fe022c3a4 * viewvc.conf.dist,
* lib/config.py
  Re-sync (and re-order) the options listed in the sample configuration file
  and the Config object.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1681 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-20 13:25:18 +00:00
cmpilato
f40a836c23 * lib/vcauth/forbidden/__init__.py
(ViewVCAuthorizer.__init__): Don't assume that the 'forbidden' parameter
    is present.  Noticed by Vairoj Arunyaangkul <va@waveman.com>.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1680 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-20 13:23:52 +00:00
cmpilato
c791123a08 Add FAQ item for 'COMalformedOutput: ...' as suggested by Heather
Gordon <hgordon@shutterfly.com>.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1679 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-15 18:27:17 +00:00
cmpilato
be4ee9d817 For issue #303, duplicate the commented-out LD_LIBRARY_PATH setting
code from view_cvsgraph() into view_cvsgraph_image(), too, and
cross-reference them in the surrounding comments.

* lib/viewvc.py
  (view_cvsgraph_image): Add commented-out LD_LIBRARY_PATH set, just
    like what's in view_cvsgraph().
  (view_cvsgraph): Update comment and example.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1678 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-15 14:08:18 +00:00
cmpilato
889b3cdb0e Fix some webstuffs spelling oopses.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1677 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-15 13:19:20 +00:00
cmpilato
e1f3b9f4f7 Tweak the tigris.org left-nav a bit.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1676 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-15 13:17:13 +00:00
cmpilato
5c26dab649 Flesh out the 'rlog output ended early' answer.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1675 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-15 12:57:05 +00:00
cmpilato
c089f3bd73 Website tweaks to support the FAQ page.
* viewvc.org/styles.css
  Tweak (and add) styles.

* viewvc.org/who.html
* viewvc.org/index.html
* viewvc.org/contributing.html
* viewvc.org/download.html
* viewvc.org/contact.html
* viewvc.org/nightly/build-viewvc-snapshot
  Add some more CSS-able <div>'s, and add links to the FAQ page.

* viewvc.org/faq.html
  Flesh out a little more the layout of this document, and add our first
  answer!

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1674 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-14 12:29:31 +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
d421c3bc22 For issue #290 - Re-work the way email address mangling is managed to
prevent mangling inside file contents.  Why?  Because file contents
should be sancred, and besides, we can't control what our various
syntax highlighting programs will do with such addresses anyway.

* lib/viewvc.py
  (htmlify): Lose 'cfg' parameter; add 'mangle_email_addrs'.
  (format_log, view_markup, view_log, view_annotate, view_revision,
   build_commit): Update call to htmlify, using the configured value
    for mangle_email_addresses.
  (copy_stream, view_diff, english_query, view_error): Update call to
    htmlify, with email address mangling disabled.
  (DiffSource._format_text): Was spaced_html_text().  Update call to
    htmlify(), with email address mangling disabled.

* viewvc.conf.dist
  (mangle_email_addresses): Note that this doesn't affect the display
    of file contents.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1672 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-04 16:50:06 +00:00
cmpilato
53e1cd8f30 Add email address mangling feature to CHANGES.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1671 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-01 20:05:39 +00:00
cmpilato
6c80a17d45 Finish issue #290 - Introduce an option for mangling email addresses.
* viewvc.conf.dist
  (mangle_email_addresses): New option.

* lib/config.py
  (Config.set_defaults): Set defaults for new 'mangle_email_addresses'
    option.

* lib/viewvc.py
  In various functions, use 'cfg = request.cfg' to enhance readability.
  (htmlify): Add 'cfg' parameter.  Callers updated.  Honor the new cfg
    option 'mangle_email_addresses', showing only "username@..." when
    mangling.
  (copy_stream, MarkupPipeWrapper.__init__, MarkupShell.__init__): Add
    'cfg' parameter.  All callers updated.
  (MarkupEnscript.__init__, MarkupHighlight.__init__): Squirrel away
    the 'cfg' parameter.

* docs/upgrading-howto.html
  Note the new mangle_email_addresses option.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1670 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-01 20:03:56 +00:00
cmpilato
b5b1272ebb Add some notes on improving the vclib API.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1669 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-06-01 18:12:12 +00:00
cmpilato
8b0b3632ac Improve the vcauth stuffs error handling logic a bit.
* lib/viewvc.py
  (setup_authorizer): Rework this for tighter exception handling.

* lib/vcauth/svnauthz/__init__.py
  (ViewVCAuthorizer.__init__): Don't reveal server paths in the
    file-not-found exception.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1668 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-25 13:32:55 +00:00
cmpilato
3abdb58fc1 Fix the vcauth interactions of the tarball generation code.
* lib/viewvc.py
  (generate_tarball): Check every path -- not just top-level
    subdirectories -- for authorization.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1667 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-24 20:09:21 +00:00
cmpilato
65de16dd8f * lib/vcauth/forbidden/__init__.py
(): import vclib (so trying to use it later doesn't make bad stuff happen)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1666 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-21 14:45:00 +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
c3bd8d5aea Consistify blockquote stylation, and update cvsweb link.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1660 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-15 18:38:24 +00:00
cmpilato
fc2e5b9bd1 Update URL for PEP 8.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1659 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-15 18:01:39 +00:00
cmpilato
9e64e86927 Remove vcauth/test module.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1657 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-14 19:44:30 +00:00
cmpilato
a98023499d Pass the Repository object to the vcauth modules so they can more
easily query the repository for information.

* lib/vcauth/__init__.py
  (GenericViewVCAuthorizer.__init__): Lose 'rootpath', 'roottype', and
    'rootname' for just 'root', so the authz modules can make queries
    of the backing VC system as necessary.

* lib/vcauth/forbidden/__init__.py
  (ViewVCAuthorizer.__init__): Lose 'rootpath', 'roottype', and
    'rootname' for just 'root'.

* lib/vcauth/svnauthz/__init__.py
  (ViewVCAuthorizer.__init__): Lose 'rootpath', 'roottype', and
    'rootname' for just 'root'.

* lib/viewvc.py
  (Request.run_viewvc): Update call to setup_authorizer().
  (setup_authorizer): Lose 'rootpath', 'roottype', and 'rootname' for
    just 'root'.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1655 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-10 21:44:28 +00:00
cmpilato
2ce86a5227 Ensure that vclib.Repository objects are aware of their name, path,
and type by forcing them to implement functions which query those
pieces of information.

* lib/vclib/__init__.py
  (Repository.rootname, Repository.rootpath, Repository.roottype): New.

* lib/vclib/bincvs/__init__.py
  (CVSRepository.rootname, CVSRepository.rootpath,
    CVSRepository.roottype): New.

* lib/vclib/svn/__init__.py
  (SubversionRepository.rootname, SubversionRepository.rootpath,
    SubversionRepository.roottype): New.
  
* lib/vclib/svn_ra/__init__.py
  (SubversionRepository.rootname, SubversionRepository.rootpath,
    SubversionRepository.roottype): New.

* lib/viewvc.py
  (Request.run_viewvc): Ask the Repository object for its roottype(),
    and translate the vclib value into a string.  (It would be nice to
    use the vclib value throughout the codebase, but not today.)

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1654 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-10 20:47:27 +00:00
cmpilato
5a5e3755f6 * lib/vcauth/svnauthz/__init__.py
(ViewVCAuthorizer.__init__): Look for the read ('r') code instead
    of trying to match specific permission strings ('r', 'rw', ...).
    Hopefully this gives us a little better resilience if Subversion grows
    more authz codes.  Suggested by Jan Grant <jan.grant@bristol.ac.uk>.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1653 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-10 17:00:57 +00:00
cmpilato
10a2463c9f * lib/vcauth/svnauthz/__init__.py
(ViewVCAuthorizer.__init__): Perform some minor logic optimizations
    and cleanups.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1652 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-09 22:16:41 +00:00
cmpilato
abb8486da4 * lib/vcauth/svnauthz/__init__.py
(ViewVCAuthorizer.__init__): Fix a logic bug in access rights
    determination.  Patch by Jan Grant <jan.grant@bristol.ac.uk>.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1651 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-09 22:06:00 +00:00
cmpilato
f5defb51ae Fix parse of multi-user svnauthz groups.
* lib/vcauth/svnauthz/__init__.py
  (ViewVCAuthorizer._process_group): Fix a usage of string.strip()
    where string.split() was intended.  Noticed by 
    Jan Grant <jan.grant@bristol.ac.uk>.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1650 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-09 15:42:37 +00:00
cmpilato
0f57c5b5e3 Remove reference to merged-and-removed authz-dev branch.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1646 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-03 18:22:19 +00:00
cmpilato
0d6e57a823 * viewvc-install
(TREE_LIST): Install the contributed templates, too.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1644 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-03 18:02:36 +00:00
cmpilato
ed4c21c012 * lib/viewvc.py
Fix some long lines.  No functional changes.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1643 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-03 18:01:56 +00:00
cmpilato
e5d47a1314 * lib/viewvc.py
(view_directory): Move the tarball_href calculation from here...
  (common_template_data): ...to here (which I thought I'd already done...)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1633 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-28 23:06:49 +00:00
cmpilato
5321434ca4 * bin/loginfo-handler
(Cvs1Dot12ArgParse): Handle the imported sources case, too.  Thanks to
    Mark Keisler <mark@mitsein.net> for pointing this out in IRC today.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1627 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-26 19:36:46 +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
fac695eec4 Add an externals definition which pulls in contributed template sets
for ViewVC 1.1.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1621 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-25 19:41:15 +00:00
cmpilato
93696bc9c2 * docs/upgrading-howto.html
Don't refer to "ViewCVS 1.0".  It was "ViewVC 1.0".


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1618 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-18 16:00:37 +00:00
cmpilato
141419f852 * lib/blame.py
(make_html): Not that I think anybody actually cares, but fix this
    function to generate HTML properly.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1617 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-17 21:38:33 +00:00
cmpilato
e1f28b1bc0 * lib/viewvc.py
* lib/vclib/ccvs/rcsparse/common.py
* lib/vclib/ccvs/rcsparse/default.py
* lib/vclib/ccvs/rcsparse/texttools.py
* lib/vclib/ccvs/blame.py
* lib/blame.py
* lib/popen.py
  Replace stray tabs with spaces.  (Hopefully) no logic changes.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1616 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-17 21:07:33 +00:00
cmpilato
ee45fd32af * lib/config.py
(Config.load_config): Stash a reference to the primary
    ConfigParser() object.
  (Config.overlay_root_options): Use the stashed ConfigParser()
    reference instead of re-parsing the configuration file.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1612 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-17 03:47:34 +00:00
cmpilato
6982bbc7b0 Use forward-slash (/) as the separator in config section names between
override groupings and the base configuration section that is being
overridden.  Why?  Besides revealing a clear heirachy of information
(which seems more intuitive to me, at least), I anticipate it being
helpful for disambiguation later, especially since neither vhosts nor
root names should have forward slashes in them.

* viewvc.conf.dist
  (vhosts): Tweak the inline comments in accordance with this new plan.

* lib/config.py
  (Config._process_vhost, Config._process_root_options): Expect a
    forward slash (/) character where a hyphen (-) was previously
    expected.

* docs/upgrading-howto.html
  Update upgrade documentation with these changes.

* CHANGES
  Note that per-root configuration overrides are now supported.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1609 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-16 23:59:09 +00:00
cmpilato
204c6eb21c Add support for per-root option overrides using sections named
root-ROOTNAME-CONFIGSECTION.

In order to keep the configuration section naming conventions
consistent, change the way virtual host override sections are named
from VHOSTNAME-CONFIGSECTION to vhost-VHOSTNAME-CONFIGSECTION.

* lib/config.py
  (Config.load_config): Add optional 'rootname' parameter.  Actually
    make use of self.conf_path.  If there is a rootname provided,
    overlay per-root options.
  (Config._process_vhost): Now expect vhost section names to begin
    with the prefix "vhost-".
  (Config._find_canon_vhost): Minimize some logic.
  (Config.overlay_root_options, Config._process_root_options): New.
  (ViewVCConfigurationError, IllegalOverrideSection): New.
  (MalformedRoot): Now inherit from ViewVCConfigurationError.
  
* lib/viewvc.py
  (Request.run_viewvc): Once the rootname is determined, overlay
    per-root configuration options.

* viewvc.conf.dist
  (vhosts): Update vhosts docs and examples to note the new "vhost-"
    section name prefix.

* docs/upgrading-howto.html
  Note the change in vhost override section naming expectations.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1607 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-16 14:54:01 +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
63aba8c173 Move the 'use_rcsparse' option from 'general' to 'options'.
* viewvc.conf.dist
  (use_rcsparse): Move this from the 'general' section to the
    'options' section.

* lib/config.py
  (Config.set_defaults): Track the move of the 'use_rcsparse' section.

* lib/viewvc.py
  (Request.run_viewvc): Track the move of the 'use_rcsparse' section.

* docs/upgrading-howto.html
  Note the option changes, and re-work the upgrading-from-1.0.0 option
  changes section a little bit while I'm here.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1604 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-13 08:15:05 +00:00
cmpilato
a0a1ea7a42 * viewvc.conf.dist
Clean up some more option documentation.

* templates/include/footer.ezt
  Stop treating the cfg.general.address like a free-form field.  If admins
  don't like the way we display the address by default, they need only 
  tweak the footer.ezt template.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1603 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-13 07:40:39 +00:00
cmpilato
62dff59068 * viewvc.conf.dist
Take a stab at documenting ViewVC's vhost support.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1602 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-13 07:11:35 +00:00
cmpilato
a2d187d4be Add the nightly build scripts to version control.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1599 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-10 16:39:46 +00:00
cmpilato
0961f1bb6c "Gaaaaah."
That's what I say to the Universe.

"Gaaaaah."

* viewvc.org/license-1.html
  Remove symlink.

* viewvc.org/who.html
* viewvc.org/index.html
* viewvc.org/contributing.html
* viewvc.org/download.html
* viewvc.org/faq.html
* viewvc.org/contact.html
  Point the "License" nav item to the HEAD version of LICENSE.html.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1598 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-10 16:23:44 +00:00
cmpilato
5a4e2c343b The whole license file dance is annoying. Just put the thing where it
wants to be -- where folks expect to find it -- and be done with it.

* viewvc.org/license-1.html
  Moved this...

* LICENSE.html
  ...to here, and stripped out site branding stuffs...

* viewvc.org/license-1.html
  ...but re-added a symlink.

* viewvc.org/.htaccess
  Add a redirect rule to point license-1.html URLs to the latest
  LICENSE.html file.

* tools/make-release
  Don't bother copying the LICENSE.html file any more -- it's already
  in place.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1597 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-10 16:10:38 +00:00
cmpilato
25b411f04f Add some steps to releases.txt.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1592 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-10 15:37:13 +00:00
cmpilato
f5bfd66019 * tools/make-release
Uh... actually copy the LICENSE.html file into place like the
  comment claims we do.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1591 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-10 15:28:41 +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
8336ed6dce * viewvc.org/license-1.html
Bump copyright years.

* viewvc.org/styles.css
  (blockquote): Tweak margins and add a dotted border.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1589 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-10 15:24:53 +00:00
cmpilato
bfa13e4161 Lose some .cvsignore files.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1588 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-10 15:02:50 +00:00
cmpilato
00b8f8a74e * tools/make-release
Fix some bugs in this script which prevented the to-be-deleted
  directories from actually being deleted.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1586 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-10 07:04:51 +00:00
cmpilato
ffe04321f3 Copy 1.0.4 CHANGES block to trunk.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1585 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-10 06:55:04 +00:00
cmpilato
90109ce020 Note new latest release of ViewVC.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1584 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-10 06:50:33 +00:00
cmpilato
e2c6ed5202 (Hopefully) really finish issue #262 by enabling auto-commit in CVSdb SQL.
* lib/cvsdb.py
  (CheckinDatabase.Connect): Issue "SET AUTOCOMMIT=1" so that InnoDB
    databases automatically commit changes made to the database.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1579 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-10 05:56:17 +00:00
cmpilato
1324797377 * templates/include/diff_form.ezt,
* templates/include/pathrev_form.ezt
  Fix various XHTML validation errors.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1577 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-10 05:09:14 +00:00
cmpilato
0d0f8c789d Finish issue #180 - Query results cache staleness under mod_python
Remove the code which attempts to cache database connection wrapper
objects.  That was useful long ago when the ViewVC code was sloppier,
but now the database handles get passed around in the call stack, so
there's a 1-to-1 mapping of ViewVC process to database connection.
The cache is, therefore, entirely unnecessary (and is causing
problems, in fact, for mod_python users).

* lib/cvsdb.py
  (gCheckinDatabase, gCheckinDatabaseReadOnly): Remove.
  (ConnectDatabase): Add 'readonly' optional parameter.  Don't try to
    play the connection caching game any more -- nobody cares.
  (ConnectDatabaseReadOnly): Reimplement as a wrapper around ConnectDatabase().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1573 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-09 13:45:18 +00:00
cmpilato
e144eb6942 * lib/viewvc.py
(common_template_data): Don't forget to take 'pathrev' into account
    when calculating the revision for Subversion views.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1572 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-06 17:37:24 +00:00
cmpilato
1d5c053757 Finish issue #296 - Query links for SVN deletions produce bad links.
* lib/viewvc.py
  (build_commit): Rework the view URLs so that, for Subversion, URLs
    related to deleted paths point to the previous revision.  And don't
    bother generating diff URLs for adds and removes -- only changes.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1569 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-06 16:36:27 +00:00
cmpilato
e2f383baf8 * templates/include/footer.ezt,
* templates/include/header.ezt
  Fix some XHTML validation problems.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1568 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-06 16:35:17 +00:00
cmpilato
f7095d713d * lib/viewvc.py
(redirect_pathrev): Automagically transform bogus input into,
    essentially, "HEAD".


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1566 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-04 03:06:48 +00:00
cmpilato
3b5ae57380 * viewvc-install
(install_file): Use os.sep instead of '/' as the trailing slash in the
    "created" stdout line.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1564 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-02 19:35:56 +00:00
cmpilato
3b15cf11cc Turn on root_as_url_component by default for ViewVC 1.1.
* lib/config.py
  (Config.set_defaults): Enable options.root_as_url_component by default.

* viewvc.conf.dist
  (default_root): Describe this a little better.
  (root_as_url_component): Indicate that enabled is the default state.

* docs/upgrading-howto.html
  Add a note about the root_as_url_component option default change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1563 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-02 19:20:07 +00:00
cmpilato
a5f6b657cf * viewvc-install
(install_file): Test e.errno instead of e[0], because on Windows, a
    Windows-specific subclass of OSError (WindowsError) is raised, and the
    first item of its tuple representation is the Windows-specific
    error code.  But e.errno seems always to hold the OS-independent
    error value.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1561 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-02 16:32:13 +00:00
cmpilato
3edd4b3b01 Fix a bug reported by Jens Peters <jpeters7677@gmx.de> which causes
ViewVC to only generate links from a directory's "log view" to its
"directory view" when there's no sticky revision set.

* lib/viewvc.py
  (view_log): Always generate a directory's "directory view" link.  


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1559 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-02 13:26:32 +00:00
cmpilato
d25e5e3098 * windows/README
Update Python for Windows Extensions URL (they now live at SourceForge).

* lib/win32popen.py
  Suggest that the Python for Windows Extensions might not be installed
  when importing a module from that collection fails.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1557 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-04-02 12:38:33 +00:00
cmpilato
9672b6d711 * bin/svndbadmin
(SvnRev.__init__): Don't use secs_from_timestr() -- it never
    learned to accept optional pools.  Do the math ourselves.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1556 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-03-29 06:00:04 +00:00
cmpilato
4ee8ea34e1 * INSTALL
(SECURITY INFORMATION): Update this with the latest information
    about the checkout view and how to toggle its enablement.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1554 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-03-29 02:07:27 +00:00
cmpilato
a0e92a8679 * templates/docroot/styles.css,
* templates/annotate.ezt
  Try to make the annotate view stylations look a little more like
  those of the markup view.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1553 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-03-28 18:48:08 +00:00
cmpilato
bb246bf7c7 Begin the work of merging the markup and annotate views by at least
having them populate almost identical data dictionaries, and having
similar template headers.

* docs/upgrading-howto.html
  (Upgrading from 1.0.0): Note that 'mime_type', 'log', 'date', 'ago',
    'author', 'branches', 'tags', 'branch_points', 'changed', 'size',
    'state', 'vendor_branch', and 'prev' were added to annotate.ezt.

* docs/template-authoring-guide.html
  (Annotation View): Add 'mime_type', 'log', 'date', 'ago', 'author',
    'branches', 'tags', 'branch_points', 'changed', 'size', 'state',
    'vendor_branch', and 'prev'.

* templates/annotate.ezt
  Basically, replace the top of this thing with a copy of the top of
  markup.ezt.

* lib/viewvc.py
  (view_annotate): Populate almost an identical data dictionary to
    what the markup view uses.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1552 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-03-28 18:34:51 +00:00
cmpilato
2f9a4df28d Add recent changes.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1551 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-03-28 18:26:50 +00:00
cmpilato
f7bf5a511e Finish issue #244 by normalizing the input search directory values.
* lib/viewvc.py
  (view_query): Use _path_parts to cleanup the list of query directories.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1550 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-03-28 03:04:18 +00:00
cmpilato
d234219a4f Remove a change that was backported to 1.0.x.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1549 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-03-27 20:30:13 +00:00
cmpilato
580463a8ed Note some recently made CHANGES.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1547 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-03-27 20:27:02 +00:00
cmpilato
5ce1ab531d Finish issue #224 by allowing svndbadmin to optionally accept a range
of revisions for the 'update' operation.

* bin/svndbadmin
  (): Update the script's header comment.
  (main): Now accept a 'revs' list instead of a single integer revision.
  (_rev2int): New helper function.
  (usage): Update usage message.
  (__main__): Now allow a revision range to be specified, with support
    for the 'HEAD' keyword, too.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1546 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-03-27 20:22:22 +00:00
cmpilato
2860672524 * bin/svndbadmin
De-pool-ize the use of the Subversion bindings.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1545 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-03-27 20:17:49 +00:00
cmpilato
2efd7cc4af Unify the allowable views configury, and all support for disabling the
checkout view.  The former is for sanity, the latter for security.

* viewvc.conf.dist
  (allow_tar, allow_annotate, allow_markup): Removed.
  (allowed_views): New.

* lib/config.py
  (Config._force_multi_value): Add 'allowed_views'.
  (Config.set_defaults): Set default for 'allowed_views'; no longer set
    defaults for 'allow_tar', 'allow_annotate', 'allow_markup'.

* lib/viewvc.py
  (default_view, view_directory, download_tarball, get_file_view_info,
   view_annotate, view_diff, build_commit, view_revision, view_markup,
   view_checkout): Track changes, adding code to prevent checkout view
    URL generation when the view is disabled, and doing the same for
    markup views (which should have already been done, since we already
    had an allow_markup option!)

* templates/query_results.ezt
* templates/markup.ezt
* templates/directory.ezt
* templates/log.ezt
* templates/log_table.ezt
* templates/annotate.ezt
  Don't assume checkout and markup views are present.

* docs/upgrading-howto.html
  Update to show the configuration changes.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1544 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-03-27 19:03:37 +00:00
cmpilato
676ee09745 Rename the 'rev' view to the 'revision' view (at the CGI param level).
* lib/viewvc.py
  (_views): Rename the 'rev' view to the 'revision' view.  (This has
    always bugged me.)
  (Request.run_viewvc): Redirect old 'view=rev' URLs to 'view=revision'.

* docs/url-reference.html
  Update to reflect new URL syntax (and compatability support).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1543 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-03-27 17:39:43 +00:00
cmpilato
ac39b5ec6c * docs/url-reference.html
Reformat to (mostly) fit in 80 columns.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1542 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-03-27 17:31:33 +00:00
cmpilato
68a7d107e2 * lib/viewvc.py
(_orig_path, common_template_data, view_directory, view_revision,
   setup_diff): Catch vclib.InvalidRevision exceptions from
    repos._getrev(), and re-throw them as ViewVCExceptions.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1539 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-03-12 15:06:50 +00:00
cmpilato
ea04c73b36 * templates/error.ezt
Only show the stacktrace when we've not provided a user-friend error
  message.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1538 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-03-12 14:54:10 +00:00
cmpilato
5443c117e6 * bin/mod_python/viewvc_mp.py,
* bin/mod_python/query_mp.py
  Remove unnecessary reload() statements.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1537 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-03-09 16:37:51 +00:00
cmpilato
ef89f0db73 Rename the Mod_Python stub scripts to avoid triggering an import loop
detection error.

* bin/mod_python/viewvc.py,
* bin/mod_python/query.py
  Renamed these ...

* bin/mod_python/viewvc_mp.py,
* bin/mod_python/query_mp.py
  ... to these.

* viewvc-install
  Track the renamed stub scripts.

* docs/upgrading-howto.html
  Note the change to the Mod_Python stub script names.
  



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1536 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-03-09 16:04:31 +00:00
cmpilato
3c0ab3e163 * INSTALL
Add a note about the security implications of the checkout view,
  suggested by Moritz Naumann <security@moritz-naumann.com>.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1535 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-02-27 15:38:49 +00:00
cmpilato
300a8236cb Robustness fixes in the query stuffs where empty or missing revision
metadata occurs.

* lib/cvsdb.py
  (Commit.SetTime, Commit.GetTime, CheckinDatabase.AddCommit): Handle
    missing dates.

* bin/svndbadmin
  (SvnRev.__init__): Handle missing or invalid datestamps.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1534 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-02-26 20:20:04 +00:00
cmpilato
891dfa4b85 Robustness fixes where empty or missing revision metadata occurs.
* lib/vclib/svn/__init__.py
  (_datestr_to_date): Make this function more robust in the face of
    bogus datestamps.

* lib/viewvc.py
  (htmlify, format_log, make_time_string, make_rss_time_string,
    build_commit, view_directory): Make this functions more gracefully
    handle "None" revision metadata, and not generate data like
    "Unknown date" or "&nbsp;".
  
* templates/log.ezt,
* templates/markup.ezt,
* templates/rss.ezt,
* templates/revision.ezt,
* templates/log_table.ezt
  Handle empty revision metadata more gracefully.  


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1533 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-02-26 19:28:48 +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
169aba8c30 * viewvc.conf.dist (use_source_highlight): Default to 0.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1531 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-02-13 15:21:39 +00:00
cmpilato
3c426916d4 Add new CHANGES item for source-highlight integration.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1530 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-02-01 22:30:46 +00:00
cmpilato
8254d2d876 I think I'm finished messing around with source-highlight integration
now.  No, really!

* INSTALL
  Okay, no more messing around with lesser version.  source-highlight
  2.5 it is.

* lib/viewvc.py
  (MarkupSourceHighlight.__init__): Use 'sed' to strip unnecessary
    leading and close tags generated by source-highlight.  Also, pass
    a value of "l_" for the line number reference prefix, which makes
    this consistent with highlight's line IDs.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1529 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-02-01 22:16:44 +00:00
cmpilato
85f7720267 Miscellaneous cleanups around the source-highlight integration.
* templates/docroot/styles.css
  Remove source-highlight styles.  We can't reliably get that program
  to generate real style names.

* viewvc.conf.dist
  (source_highlight): Fix the sample path.

* lib/viewvc.py
  (MarkupSourceHighlight): Rework this to pipe the file contents into
    source-highlight on stdin, and don't try to enable CSS output or
    anything fancy, because source-highlight has too many bugs in this
    area.  Use --failsafe mode.

* INSTALL
  Change the recommendation for the version of source-highlight.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1528 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-02-01 21:52:30 +00:00
cmpilato
436e10e74c Add notes to INSTALL about using source-highlight.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1527 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-02-01 20:19:54 +00:00
cmpilato
473b853a5b Add optional integration with GNU source-highlight. Patch against
ViewVC 1.0.3 by Dirk Jagdmann <doj@tigris.org>, tweaked to adhere to
ViewVC 1.1-dev code and conventions by myself.

* viewvc.conf.dist
  (utilities.source_highlight, options.use_source_highlight,
   options.source_highlight_line_numbers): New.

* templates/docroot/styles.css
  Add new default styles for source-highlight output mode.

* lib/viewvc.py
  (MarkupSourceHighlight): New.

* lib/config.py
  (set_defaults): Set default values for utilities.source_highlight,
    options.use_source_highlight, and options.source_highlight_line_numbers.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1526 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-02-01 16:42:48 +00:00
cmpilato
77446e313a * lib/vclib/svn_ra/__init__.py
(created_rev): Because the way ra.svn_ra_get_dir() seems to work
    differently across versions of the Subversion Python bindings,
    build in some fault tolerance.  
    Tested by Eric Hanchrow <offby1@blarg.net>.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1525 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-31 21:08:45 +00:00
cmpilato
310db99e62 * lib/vclib/svn_ra/__init__.py
(created_rev): Update use of ra.svn_ra_get_dir().

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1524 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-31 19:39:13 +00:00
cmpilato
b597b6a485 Minor comment tweaks.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1523 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-26 20:03:03 +00:00
cmpilato
e7014db4cf Update the INSTALL file.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1521 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-26 16:49:13 +00:00
cmpilato
8f5e381f21 Fix issue #284 - Regression: "Modify query" link no longer functions.
* lib/viewvc.py
  (view_query): Restore a queryform_href calculation incorrect
    abstracted out (probably by me).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1520 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-23 20:56:28 +00:00
cmpilato
b7af5fc568 * bin/loginfo-handler
Add some more debugging, and consume stdin so CVS's pipe doesn't
  back up (which causes an abort()).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1518 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-23 19:51:05 +00:00
cmpilato
7e0d117de8 * bin/loginfo-handler
Fix the loginfo-handler's argument handling so that it works with 
  single-file commits in CVS 1.12.x.  

  Patch by: Cristian Tibirna <ctibirna@giref.ulaval.ca>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1517 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-23 19:50:05 +00:00
cmpilato
95f5f3bc9c * CHANGES
Note the fix for issue #234, committed in r1515.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1516 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-23 19:46:13 +00:00
cmpilato
b9044a9a9d Finish issue #234 - standalone.py uses not registered port per default.
According to http://www.iana.org/assignments/port-numbers, "The
Dynamic and/or Private Ports are those from 49152 through 65535".

* bin/standalone.py
  (Options): Change default port to 49152.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1515 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-23 17:56:49 +00:00
cmpilato
9e07c413fa Improve the error display when trying to view annotations on a binary file.
* lib/vclib/__init__.py
  (NonTextualFileContents): New Exception.

* lib/vclib/svn/__init__.py
  (BlameSource.__init__): Translate the Subversion error
    SVN_ERR_CLIENT_IS_BINARY_FILE in the new vclib.NonTextualFileContents 
    exception.

* lib/viewvc.py
  (view_annotate): Catch the new vclib.NonTextualFileContents exception.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1514 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-23 17:47:37 +00:00
cmpilato
c8645305c5 * CHANGES
Add the bugfix for issue #221 completed in r1512.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1513 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-23 17:33:20 +00:00
cmpilato
4750fd345c Finish issue #221 - Annotate confused by long author names
* lib/vclib/svn/__init__.py
  (_rootpath2url): New helper, cored from BlameSource.__init__().
  (BlameSource): Rework this class to use the Subversion client Python
    bindings, specifically a call to svn_client_blame2().
  (SubversionRepository.annotate): Use new _rootpath2url(), and
    update the called to BlameSource().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1512 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-23 17:31:02 +00:00
cmpilato
4f1259d64d * lib/vclib/svn/__init__.py
(_rev2optrev): Moved here from the svn_ra module.

* lib/vclib/svn_ra/__init__.py
  (_rev2optrev): Moved to the svn module (now pulled in indirectly).
  (SubversionRepository.__init__): Fix a leftover instance of a pool.
    Also, add a comment about svn_cmdline_setup_auth_baton().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1511 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-23 17:22:17 +00:00
cmpilato
ead2d603a2 * CHANGES
Note new search-by-log-message feature, committed in r1509.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1510 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-23 16:24:49 +00:00
cmpilato
79fe3a2919 Finish issue #22 - Query on Log Messages.
Add the ability to query the commit database by log message comment in
addition to the existing query parameters.

Patch by: David Skyba <davidskyba@users.sourceforge.net>

* lib/cvsdb.py
  (CheckinDatabase.CreateSQLQueryString): Add support for filtering
    query results by log message.
  (CheckinDatabaseQuery.__init__): Add new comment_list member.
  (CheckinDatabaseQuery.SetComment): New.

* lib/viewvc.py
  (_legal_params): Add 'comment' and 'comment_match' as valid query
    parameters.
  (view_queryform): Populate new 'comment' and 'comment_match' data
    dictionary items.
  (english_query, view_query): Handle the new 'comment' and
    'comment_match' query items.

* templates/query_form.ezt
  Add UI for filtering queries by log message.

* docs/url-reference.html
  (Query View): Note new comment= and comment_match= URL parameters.

* docs/template-authoring-guide.html
  (variables-query_form): Note new comment and comment_match data
    dictionary items.





git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1509 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-23 16:22:40 +00:00
cmpilato
c3aabd8b7c Finish issue #12 -- Long paths in tarballs get truncated.
Use a GNU tar extension when path names longer than 100 characters are
being packaged in our tarball output.  

Patch by: Klaus Rennecke <marion@users.sourceforge.net>

I tested this on a Solaris box that had both the native tar program
and GNU tar.  Without the patch, but the native and GNU tar programs
created files with truncated filenames.  With the patch, GNU tar worked as
expected; the native tar program created a '././@LongLink' file
whose contents were the long path, and additionally created the
file with the truncated path.

* lib/viewvc.py
  (generate_tarball_header): For paths longer than 100 characters, use
    a GNU tar extension which allows arbitrary path links.  Also, fix
    the "version" header item to be '00', not \0.
    
* templates/include/dir_footer.ezt
  Change the "download tarball" link text to indicate that we are
  now generating GNU tarballs.

  


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1507 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-23 15:35:44 +00:00
cmpilato
5977b3c4fe * lib/compat.py
(mkdtemp): Fix the compatibility implementation's use of mktemp(),
    which prior to Python 2.3 (the same release that mkdtemp() shows
    up) only supported a single "suffix" argument.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1506 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-22 17:25:07 +00:00
cmpilato
59ecb71c51 * lib/viewvc.py
(view_directory): Initialize file.size, too.  A follow-up to r1504.
  


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1505 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-22 17:15:24 +00:00
cmpilato
ed664972cb Optimize directory displays where paging is enabled and sorting by
filename by first sorting, then only fetching the extended revision
metadata information for the items that would survive the page
filtering.

Patch by: Gustavo De Nardin <gustavodn@mandriva.com>
          (Tweaked by me.)

* lib/viewvc.py
  (view_directory): Only fetch dirlogs for directory entries that will be 
    on "this page".


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1504 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-18 20:38:03 +00:00
cmpilato
9b625017bb * viewvc.org/faq.html
Drop a skeletal FAQ page into place, but don't hook it into the rest
  of the site, seein' as how there's no real content here yet.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1503 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-11 13:29:41 +00:00
cmpilato
e0221b21bf Provide another hint to folks for whom ViewVC can't find Subversion bindings.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1502 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-08 21:28:19 +00:00
cmpilato
04cb1cd74d Finish issue #262 - svndbadmin doesn't commit data to MySQL InnoDB tables
* lib/cvsdb.py
  (CheckinDatabase.AddCommit): Set plus_count and minus_count
    explicitly to '0', which seems to be required for some folks'
    MySQL installations.

* bin/make-database
  Explicitly declare that we want tables of type "MyISAM".

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1500 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-05 23:05:14 +00:00
cmpilato
cf862e4e68 * lib/cvsdb.py
(CheckinDatabase.AddCommit): Add some newlines, to purty up the
    Exception string.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1499 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-05 16:07:05 +00:00
cmpilato
497cc24bbe * lib/cvsdb.py
(CheckinDatabase.AddCommit): Add some more information to any Exceptions
    received while adding commits to the database.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1498 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-04 23:05:39 +00:00
cmpilato
39eab459b4 * lib/viewvc.py
(MarkupHighlight.__call__): Minor indentation fix.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1497 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-04 19:22:35 +00:00
cmpilato
942d84818e Fix issue #280. Follow-up to r1493 with tweaks to INSTALL for the new
svndbadmin usage.

* INSTALL
  (SQL CHECKIN DATABASE): Recommend the use of 'svndbadmin update REV'
    in post-commit hooks, and 'svndbadmin update --force REV' in
    post-revprop-change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1496 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-03 14:37:25 +00:00
cmpilato
6a03c7a4dd Add a new "uri" format to EZT.
NOTE: This is not currently used in ViewVC.  I needed it in another
piece of software, but wanted the tweaks to be publicly available
somewhere.

* lib/ezt.py
  (FORMAT_URI, _uri_printer): New.
  (_printers): Add mapping for new URI-formatting code.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1495 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-01-02 15:39:51 +00:00
cmpilato
dbf67f4c0b Add some missing issue IDs to CHANGES entries.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1494 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-12-21 21:44:42 +00:00
cmpilato
a1c093ca2c For Issue #271, implement 'purge' commands for both cvsdbadmin and
svndbadmin.  Teach the 'rebuild' commands to first purge existing data
and then crawl the repository.  Also, drop support for the 'rev'
parameter to 'svndbadmin rebuild', adding instead a '--force' option
to 'svndbadmin update'.

Suggested, and SQL commands offered, by Mark <mark@mitsein.net>.

* lib/cvsdb.py
  (CheckinDatabase.sql_delete, CheckinDatabase.PurgeRepository): New.

* bin/svndbadmin
  (handle_revision): Add 'force' parameter, used to force update of
    commits already recorded in the database.
  (main): Add 'force' parameter, passed on to handle_revision().
    Handle the new 'purge' command, and teach 'rebuild' to also purge.
  (usage): Update usage info.
  (__main__): Add support for 'update --force' and 'purge', and drop
    support for 'rebuild rev'.  Add a KeyboardInterrupt handler.

* bin/cvsdbadmin
  (usage): Add 'purge' usage info.
  (__main__): Rework command-line parameter handling.  Add support for
    'purge' command, and make 'rebuild' first do a purge.

* CHANGES
  Note this change.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1493 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-12-21 20:51:24 +00:00
cmpilato
c6db566501 Finish issue #276.
* bin/make-database
  Up the length of the people table's 'who' column to 128 characters.
  Suggested by: Ted Mielczarek <luserspaz@tigris.org>

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1492 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-12-21 16:54:41 +00:00
cmpilato
1d2b2d9c35 Allow highlight to choose the syntax language based on the file's
extension and contents.

Patch by: Christophe Delmon <cdelmon@tigris.org>

(Now, if only we could make highlight stop telling us via Apache's
error_log every time it doesn't recognize a filetype...)

* lib/viewvc.py
  (MarkupHighlight.__init__): No longer calculate the file extension,
    and drop the --syntax argument to highlight.
  (MarkupHighlight.__call__): New.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1491 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-12-21 16:26:03 +00:00
cmpilato
862d5b7132 Make viewvc-install able to be run from an arbitrary location (instead
of requiring that you run it while sitting in its containing directory).

* viewvc-install
  (_actual_src_path): New helper function.
  (replace_file): Move this functionality into...
  (install_file): ...here.  Also, normalize some variable names for
    consistency with...
  (install_tree): ...this.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1488 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-12-20 18:08:44 +00:00
rey4
bc295fb361 Interpret relative paths in viewvc.conf as being relative to the
directory where that file resides, instead of being relative to the
grandparent directory of viewvc.py. 

This change lets you set up multiple installations of ViewVC that 
share a common library directory, but are otherwise independent. It
also allows ViewVC to work more nicely with Gentoo's webapp-config.

Warning: This change may break ViewVC installations that use
VIEWVC_CONF_PATHNAME settings pointing at configuration files outside
the ViewVC install directory.

* lib/config.py
  (Config.path): new method returning paths relative to config file

* lib/viewvc.py
  (_install_path): removed function
  (get_view_template, view_cvsgraph_image, view_cvsgraph, view_doc):
    call cfg.path instead of _install_path
  (load_config): replace call to _install_path with equivalent inline
    code

* viewvc.conf.dist
    update comments referring to ViewVC install directory

* CHANGES
    document this change


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1487 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-12-20 16:37:34 +00:00
cmpilato
87fb74e580 Prep PyFontify.py for Python 2.6 readiness, and make it stop giving
the following warning in Python 2.5:

   Warning: 'with' will become a reserved keyword in Python 2.6

Reported by: Philip M. Gollucci <pgollucci@p6m7g8.com>

* lib/PyFontify.py
  (replace): Removed.  Callers now use string.replace().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1486 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-12-19 18:41:56 +00:00
cmpilato
01e10dd1bb Minor improvements to some exception strings and their handling.
* lib/viewvc.py
  (view_doc): Lose newline characters in exception messages.
  (Request.run_viewvc): Rewrite the unfound root exception messages to
    be a little less cryptic.

* templates/error.ezt
  No longer wrap exception messages in <pre> tags.  Also, pad error
  output with a bunch of space characters to IE's "Friend Error
  Messages" don't show up.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1485 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-12-18 20:40:00 +00:00
cmpilato
44d86248d1 Minor stylistic tweaks.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1484 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-12-14 20:01:19 +00:00
cmpilato
cb78995c4a * viewvc-install
(install_file, install_tree): Replace '/' with the OS-specific
    directory separator character in the destination path before processing.
    This is follow-up to r1458.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1483 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-12-14 19:42:09 +00:00
cmpilato
1592197d08 Add some links to ViewVC instances.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1482 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-12-06 20:19:44 +00:00
cmpilato
bb39ba6b22 Finish issue #273.
* templates/docroot/styles.css
  (vc_row_special): New style.

* templates/annotate.ezt
  Markup annotation hunks whose revision matches the request one
  differently.  While here, remove some unnecessary [define] blocks.

Suggested by:  Marco Colombo <marcol@tigris.org>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1481 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-12-04 19:07:04 +00:00
cmpilato
40c37a55f8 Fix a bug that prevented the population of 'rev' for annotate views.
* lib/viewvc.py
  (common_template_data): Accept the 'annotate' parameter as a valid source
    for the 'rev' data item.

Noticed by:  Marco Colombo <marcol@tigris.org>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1480 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-12-04 19:04:16 +00:00
cmpilato
9d16bcb2a7 * INSTALL
(SUBVERSION INTEGRATION): Tweak the example for testing Subversion
    Python bindings installation to be useful, showing how to find the
    installed version of those bindings.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1479 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-11-30 21:36:56 +00:00
cmpilato
5fcdcd8b8a * lib/vclib/svn_ra/__init__.py
Purge the svn_ra module of unnecessary pools.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1476 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-11-09 21:09:05 +00:00
cmpilato
fa035c8ae7 * lib/vclib/svn/__init__.py
Bump version requirement to Subversion 1.3.1.  Also, remove
  unnecessary pools from the entirety of the module.

* lib/vclib/svn_ra/__init__.py
  Bump version requirement to Subversion 1.3.1.

* INSTALL
  Bump Subversion version requirement to Subversion 1.3.1.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1475 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-11-09 20:47:45 +00:00
cmpilato
d83ff39472 Followup to r1439, with the correct logic in generate_page().
* lib/viewvc.py
  (generate_page): Reverse the logic in the if/else to be correct.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1473 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-11-09 17:55:25 +00:00
cmpilato
118c6cc35e Allow ViewVC to work when rcsparse is backed by the tparse module.
* lib/vclib/ccvs/__init__.py
* lib/vclib/ccvs/blame.py
  Use rcsparse.parse() instead of rcsparse.Parser.parse() throughout.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1472 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-11-08 20:01:40 +00:00
cmpilato
5f22029349 * lib/vclib/ccvs/rcsparse/common.py
Remove dependency on compat.  It's time for rcsparse to be free, and by
  golly, it's okay if it requires Python 2.0 now to do it.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1471 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-11-08 19:59:11 +00:00
cmpilato
1920391b2a Add missing CHANGES item for full diff support.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1467 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-11-02 14:55:44 +00:00
cmpilato
a962fae87a * bin/loginfo-handler
(__main__): Fix a syntax error I overlooked.  Follow-up to r1463.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1465 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-11-02 03:56:53 +00:00
cmpilato
ff2ac1d824 (Effectively) whitespace changes only.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1464 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-11-02 03:19:40 +00:00
cmpilato
e4967b894a Update loginfo-handler to be able to deal with the new loginfo format
introduced in CVS's 1.12 line.

Issue number(s): 257
Patch mostly by: Mark <mark@mitsein.net>, tweaked by me.

* bin/loginfo-handler
  (Cvs1Dot12ArgParse): New.
  (HeuristicArgParse): Update comment -- the problems is no longer
    with "current" CVS, but with "older" ones.
  (__main__): Detect the use of newer CVS loginfo formatting, and
    parse the arguments accordingly.  Also, clean up some indentation
    inconsistency.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1463 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-11-02 03:13:53 +00:00
cmpilato
3d65a28a3c Add support for two levels of quietness to the obnoxiously noisy
cvsdbadmin script.

* bin/cvsdbadmin
  (UpdateFile, RecurseUpdate, RootPath): Add new 'quiet_level'
    argument.  Callers updated.
  (usage): Rewrite to indicate the existence of the new -q flag, and
    to look more like the svndbadmin usage message.
  (__main__): Parse the new -q argument.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1462 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-11-02 02:00:35 +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
cmpilato
9caee0c04d * viewvc-install
(install_file, install_tree): Replace '/' with the OS-specific
    directory separator character in src_path before processing.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1458 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-10-27 14:58:04 +00:00
cmpilato
818c168978 Finish issue #266 -- Query result shows file names with @ as email
addresses.

The ultimate problem here was that email address recognition banks on
the final component of addresses "server" only have 2-4 characters in
it.  But the query code was doing a little more here than necessary
anyway, mistakenly using htmlify() instead of its subset, server.escape().

* lib/viewvc.py
  (view_query, english_query, build_commit): Use
    request.server.escape() instead of its superset, htmlify(), to
    format stuff that needs to be HTML-escaped, but doesn't
    necessarily need to try to recognize URLs and email addresses.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1456 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-10-18 01:11:33 +00:00
cmpilato
aaca4217a7 Try to note the changes so far which are aimed for release in 1.1.0.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1455 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-10-18 01:09:23 +00:00
cmpilato
63d07e6065 Begin a section for 1.1.0 in CHANGES.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1454 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-10-18 00:36:48 +00:00
cmpilato
21f68a5118 Finish issue #261 -- detect SVN repository from standalone.
* viewvc/bin/standalone.py
  (serve): Recognize Subversion repository paths provided via -r, too.
  (cli): Update the usage message.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1453 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-10-17 03:50:23 +00:00
cmpilato
7e55acdc5d * viewvc/bin/standalone.py
(serve): Fix some leftover references to the old cvsnt_exe_path
    config option.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1452 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-10-17 03:38:21 +00:00
cmpilato
9115900b3a * www/index.html
Bump the stated latest version number to 1.0.3.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1451 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-10-13 20:49:15 +00:00
cmpilato
8845bc551f Merge security fix made in r1446 from 1.0.x to trunk. That log message read:
Dictate UTF-8 as the output character set for all ViewVC
   template-driven views.
   
   * lib/sapi.py
     (CgiServer.header, ModPythonServer.header): Add "; charset=UTF-8" to
       the Content-type header in ViewVC output.
     (AspServer.header): If no content type is specified, set the content
       type to 'text/html; charset=UTF-8'.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1450 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-10-13 20:48:05 +00:00
cmpilato
4cebbf43df * CHANGES
Merge 1.0.3 change list from the 1.0.x branch.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1449 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-10-13 20:46:56 +00:00
cmpilato
1171d112b7 * lib/vclib/svn/__init__.py
(get_revision_info): Removing some debugging code accidentally
    committed in r1443.  Because life would be too easy if cmpilato
    weren't a sloppy coder, and we certainly can't have *that*.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1444 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-10-13 19:44:29 +00:00
cmpilato
c41ffe04e2 Followup to r1440, in which I butchered some code under the guise of
fixing issue #265.  Sheesh.

* viewvc/lib/vclib/svn/__init__.py
  (get_revision_info): Store ChangedPath items in a different hash
    than the one we get from the Subversion bindings so replacement
    detection works.  While here, add support for Subversion 1.4.0's
    new 'action' changed item member.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1443 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-10-13 19:26:03 +00:00
cmpilato
36e0d19fe3 Tweak releases.txt to point out our Tigris.org milestone sort key pattern.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1442 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-10-13 16:32:28 +00:00
cmpilato
5bf80b54f4 *** WARNING: THIS CHANGE BREAKS STUFF; ALSO NEED r1443 and r1444 ***
Finish issue #265 - ViewVC shows wrong path for items deleted from a
                    parent dir copied in the same revision

* lib/vclib/svn/__init__.py
  (ChangedPathSet): Remove.
  (get_revision_info): Stop using the streamy callback reporting form
    of repos.ChangeCollector(), because its got some ... deficiencies.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1440 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-10-13 15:59:00 +00:00
cmpilato
a6cad82e55 Remove some redundancy by teaching generate_page(), which is *always*
immediately preceded by a call to request.server.header(), to just
make that call itself.

* lib/viewvc.py
  (generate_page): Add 'content_type' parameter, and handle the call
    to request.server.header() here instead of it always preceding
    calls to this function.
  (view_markup, view_roots, view_directory, view_log, view_annotate,
   view_cvsgraph, view_diff, view_revision, view_queryform): Lose
    calls to request.server.header() -- generate_page() does this for
    us now.
  (view_query): Update calls to generate_page(), and lose calls to
    request.server.header().



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1439 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-10-12 17:04:15 +00:00
cmpilato
7784009c8e Bump the stated latest version of the software.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1438 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-09-29 17:15:31 +00:00
cmpilato
692f539c36 * notes/releases.txt
Fix sample `make-release' command-line, and recommended tag commit
  message.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1437 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-09-29 17:15:13 +00:00
cmpilato
bfdd4c0988 Merge 1.0.2 CHANGES into trunk's copy of the file.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1436 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-09-29 16:57:48 +00:00
cmpilato
6b84e92bdf Follow-up to r1407, fixing some calls to modified APIs that I
overlooked in that revision.  This fixes issue #264, reported against
the nightly build.

* bin/loginfo-handler
  (ProcessLoginfo): Pass cfg.utilities instead of cfg.general to
    BinCVSRepository().

* bin/cvsdbadmin
  (usage): Pass cfg.utilities instead of cfg.general to
    BinCVSRepository()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1431 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-09-29 15:16:15 +00:00
cmpilato
3e882435f2 * viewvc.conf.dist
Make some tweaks recommended in IRC by user "[1]tony" to help folks
  better understand the configuration file format and usage.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1430 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-09-28 17:51:17 +00:00
rey4
aaf85a14a6 Update the PHP CGI hack and add a comment to the config file pointing
out the CLI/CGI distinction. Thanks to Mark <mark@mitsein.net> and
Brian G. Peterson <brian@braverock.com> for bringing this issue up
on the users' list.

* lib/viewvc.py
  (markup_stream_php): update the cgi hack

* viewvc.conf.dist
  (utilities.php): add comment


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1428 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-09-27 20:06:22 +00:00
cmpilato
acd8ab25e9 Minor vclib interface cleanup, adding a new Annotation object, and
having the Repository.annotate() implementations return lists of them
(instead of lists of those cool-but-overused-_item-thingies).

* lib/vclib/__init__.py
  (Repository.annotate): Note that this interface now returns
    Annotation objects.
  (Annotation): New.
  Also, do some docstring addition/modification elsewhere in this file.

* lib/vclib/ccvs/blame.py
  (BlameSource.__getitem__): Return vclib.Annotation objects now.
  (_item): Remove as unneeded.

* lib/vclib/svn/__init__.py
  (BlameSource.__getitem__): Return vclib.Annotation objects now.
  (_item): Remove as unneeded.

* lib/vclib/svn_ra/__init__.py
  (SubversionRepository._blame_cb): Store vclib.Annotation objects now.
  (_item): Remove as unneeded.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1427 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-08-18 22:35:14 +00:00
cmpilato
41e1ae4171 Expose the path for each root in the [roots] common template data
object, again with the same warnings applied to [rootpath] in r1425.

* lib/viewvc.py
  (common_template_data):  Expose the path for each root in the "roots"
    data item.

* docs/upgrading-howto.html,
* docs/template-authoring-guide.html
  Update the docs.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1426 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-08-18 16:05:29 +00:00
cmpilato
eb70cfaaec * lib/viewvc.py
(common_template_data): Expose request.rootpath as "rootpath".

* docs/upgrading-howto.html,
* docs/template-authoring-guide.html
  Note this new exposition, though with a warning about its use in an
  insecure environment.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1425 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-08-17 15:20:44 +00:00
cmpilato
7a51a39ba0 * lib/compat.py
(mkdtemp): Flesh out the parameter list for mkdtemp(), passing those
    params to mktemp().

* viewvc/lib/viewvc.py
  (MarkupEnscript.__call__): Give the temporary directory a "viewvc"
    prefix so it is more easily identifiable in the case of a
    problem.  Also, fix a minor indentation inconsistency.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1424 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-08-16 23:59:12 +00:00
cmpilato
3dcc42d802 Fix a bug noticed by Michael Guntsche <mike@it-loops.com> which caused
file formats covered by custom "streamer" syntax highlighters to not
be passed through escript or highlight when their respective custom
stream was disabled.

* lib/viewvc.py
  (view_markup): Correct the syntax highlighter choosing logic.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1422 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-08-16 16:25:46 +00:00
cmpilato
696feb50e0 Fix some bugs introduced in r1407. Noticed by maxb.
* lib/viewvc.py
  (download_tarball): Don't reference non-existant variable cfg until
    creating it as a reference to request.cfg.
  (MarkupPHP.__init__): Drop the 'php_exe_path' variable, and add
    'cfg'.  Use 'cfg' to get at the 'php_path' configury.
  (markup_stream_php): Update call to MarkupPHP().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1421 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-08-03 21:39:46 +00:00
cmpilato
edc66442b4 Update contact information with the IRC channel.
* www/index.html
  Note the new IRC channel.

* viewvc.org/contact.html
  Note the new IRC channel, reorganize the text a bit, and provide a
  handy-dandy contact summary.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1420 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-08-02 16:06:02 +00:00
cmpilato
f64490de1c Finish issue #245 by making the generated RSS feed URL match
scheme-wise with the URL used to access ViewVC.  Patch by Troels Arvin
<tarvin@tigris.org>, tweaked by cmpilato.

* lib/viewvc.py
  (build_commit): If the environment variable HTTPS is set to "on", then
    construct the rss_url data dictionary item with an "https" method instead
    of an "http" one.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1417 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-08-01 18:12:30 +00:00
cmpilato
491e02f504 * lib/vclib/svn/__init__.py
(BlameSource.__init__):  Pass the --non-interactive flag to 'svn blame'
    so it doesn't wedge when cache authstuffs aren't available or
    sufficient.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1416 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-08-01 17:07:07 +00:00
cmpilato
60991a4743 Finish issue #208 (Annotate aborts on #include "./filename"). Patch
more or less by Russell Yanofsky.

* lib/blame.py
  (link_includes): Calculate include paths in such a way that '.' is
    dropped and '..' is normalized.  This should prevent us from
    sending paths through Subversion's APIs that aren't legal (and
    cause assertions to fire).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1414 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-08-01 16:45:35 +00:00
cmpilato
2bcda59f31 Fix some grammar issues and, while here, rant about SF.net a little bit.
Sorry -- unable to resist.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1413 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-31 21:23:09 +00:00
cmpilato
9a73f275ec Website tweaks, mostly visual and validational in nature.
* viewvc.org/who.html,
* viewvc.org/license-1.html,
* viewvc.org/download.html,
* viewvc.org/contributing.html,
* viewvc.org/index.html,
* viewvc.org/contact.html
  Add the cutesy, "Hey, we're valid XHTML" logo; remove the group email
  address (that's what the Contact page is for); fix XHTML validation issues; 
  add a working DOCTYPE marker; add <meta> definitions of a UTF-8 character
  set.

* viewvc.org/styles.css
  Minor tweaks to font sizes and margins, mostly.  Nothing altogether
  interesting.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1412 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-31 20:56:48 +00:00
cmpilato
aff7923450 Remove useless .cvsignore file.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1411 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-31 20:54:00 +00:00
cmpilato
06c202f98a * docs/template-authoring-guide.html
Fill in the remaining blanks in the template authoring guide, and fix
  one erroneous "depth" indicator in the markup.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1410 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-31 18:53:17 +00:00
cmpilato
7a038950d7 * docs/upgrading-howto.html
Bring this, I think, up-to-date with the 1.1.0 work-in-progress.
  Also, fix some colors to avoid using green save for "added" variables.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1409 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-28 11:59:31 +00:00
cmpilato
e34725c830 Remove spurious blank line.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1408 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-28 11:10:17 +00:00
cmpilato
528d4aec3d Cleanup ViewVC's configuration and use of external utilities by
creating a new section of the configuration file strictly for defining
the locations of these helper applications.

This closes issue #229 (configurable path to sed) and issue #62
(configurable path to diff), and perhaps others I failed to find.

* viewvc.conf.dist
  Add a new "utilities" section for corraling all the various
  tool-location configurations, and relocate (with some tweaks) a
  bunch of options:
     general.rcs_path => utilities.rcs_dir
     general.cvsnt_ext_path = utilities.cvsnt
     general.svn_path => utilities.svn
     options.enscript_path => utilities.enscript
     options.highlight_path => utilities.highlight
     options.py2html_path => utilities.py2html_dir
     options.php_exe => utilities.php
     options.cvsgraph_path => utilities.cvsgraph
     utilities.diff (new)
     utilities.gzip (new)
     utilities.sed (new)
     options.use_py2html (new)

* lib/config.py
  (_sections): Add 'utilities' section.
  (Config.set_defaults): Reflect options tweaks made to
    viewvc.conf.dist in the code here.

* lib/viewvc.py
  (Request.run_viewvc): Track renamed utilities.svn option.  Now pass
    cfg.utilities into BinCVSRepository(), CCVSRepository(), and
    SubversionRepository().  Collapse now-identical
    SubversionRepository() calls.
  (markup_stream_python): Return immediately if options.use_py2html
    isn't set.  Track renamed utilities.py2html_dir option.
  (view_cvsgraph_image, view_cvsgraph): Track renamed
    utilities.cvsgraph option.
  (MarkupPHP.__init__): Track renamed utilities.php option, and allow
    for 'php' as a fallback value.
  (MarkupHighlight.__init__): Track renamed utilities.highlight option.
  (MarkupEnscript.__init__): Track renamed utilities.enscript option,
    and honor new utilities.sed option.
  (download_tarball): Use new utilities.gzip option.

* lib/vclib/__init__.py
  (_diff_fp.__init__): Add 'diff_cmd' parameter.

* lib/vclib/svn/__init__.py
  (SubversionRepository.__init__): Drop 'svn_path' parameter, and now
    accept 'utilities'.
  (SubversionRepository.rawdiff): Pass self.diff_cmd to _diff_fp().

* lib/vclib/svn_ra/__init__.py
  (SubversionRepository.rawdiff): Pass self.diff_cmd to _diff_fp().

* lib/vclib/ccvs/__init__.py
  (CCVSRepository.rawdiff): Pass self.utilities.diff or 'diff' to _diff_fp().

* lib/vclib/bincvs/__init__.py
  (CVSRepository.__init__): Add 'utilities' parameter.
  (BinCVSRepository.__init__): Lose as no-longer-necessary.
  (BinCVSRepository.rcs_popen): Track renamed options, and renamed
    member variable that hold those options.

* docs/upgrading-howto.html
  Note these options changes.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1407 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-28 11:04:12 +00:00
cmpilato
789f13c9f7 Stub out a section in the upgrading-howto.html document for 1.1.0.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1406 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-28 10:22:17 +00:00
cmpilato
090dbd7d3b Add a step in releases.txt for updating the Issue Tracker configuration.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1405 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-28 08:18:20 +00:00
cmpilato
a92daef556 Add 'nightly' to the svn:ignores.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1404 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-26 20:43:48 +00:00
cmpilato
83b1c6937a * viewvc.org/download.html,
* viewvc.org/contributing.html,
* viewvc.org/index.html,
* viewvc.org/contact.html
  Oops.  Forgot to commit these removed nav references to upgrading.html.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1403 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-26 20:30:59 +00:00
cmpilato
f817d8149c Add .htaccess file. No sense in not versioning it.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1402 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-26 20:29:42 +00:00
cmpilato
8bbe853ffe Do a documentation reorganization I've been dying to do for some time
now.  Get stuff that's aimed at regular developers off our website,
get the website out of our release tarballs, while letting the docs/
that ViewVC admins need remain in the tarballs.

* docs/
  New directory.

* docs/url-reference.html,
* docs/template-authoring-guide.html
  Moved these documents, which hardly need to live on our public website, here ...

* viewvc.org/url-reference.html,
* viewvc.org/template-authoring-guide.html
  ... from here.

* docs/upgrading-howto.html
  Move (and renamed, and de-website-ized) this...

* viewvc.org/upgrading.html
  ... from here.

* notes/
  New directory for developer notes.

* notes/releases.txt
  New, cored out of the contributing.html file, and greatly updated to
  track the reality of our new Subversion-land release process.

* notes/TODO
  Move here ...

* TODO
  ... from here.

* viewvc.org/who.html,
* viewvc.org/license-1.html
  Lose references to upgrading.html.

* viewvc.org/contributing.html
  Lose references to upgrading.html, and move the release rolling
  instructions out to notes/releases.txt.
 
* tools/make-release
  Also delete viewvc.org/ and notes/ from the distribution.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1401 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-26 20:19:22 +00:00
cmpilato
0bb2dc9f16 * viewvc.org/template-authoring-guide.html
Track new location of tarball_href.  Followup to r1399.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1400 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-24 14:53:41 +00:00
cmpilato
8612acd3c2 * lib/viewvc.py
(common_template_data): Populate tarball_href data dictionary member here,
    instead of ...
  (view_directory): ... here.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1399 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-24 14:52:39 +00:00
cmpilato
3d98a33ce7 Fix issue #18 (Annotate not working in windows for subversion).
Thanks to Hernán Martínez Foffani <hernan.martinez@ecc.es> for testing
this patch on Windows.

* lib/vclib/svn/__init__.py
  (BlameSource.__init__): Patch up the URLs passed to 'svn blame' on
    systems that don't use forward-slashes for path separators.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1396 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-21 09:47:19 +00:00
cmpilato
362ff5cde6 * viewvc-install
Complete rework this script for uniform code formatting, more readable
  output, support for a fully non-interactive install mode, installation
  of the unmodified configuration files (so folks can see their customizations
  well after they make them), and any other cleanups I could get my hands on.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1394 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-21 09:36:10 +00:00
cmpilato
d6489c2026 * CHANGES
Merge in 1.0.1 changes.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1392 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-21 01:02:38 +00:00
cmpilato
b8cbcda7ae * www/index.html
Bump note about the latest release to 1.0.1.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1391 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-21 00:42:24 +00:00
cmpilato
2fa593f359 Repair a paragraph suffering from missing words.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1390 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-20 22:31:54 +00:00
cmpilato
dcc79ade05 Correct a bunch of paths in the INSTALL document. Reported by
Arnaud Quiblier <aquiblier@gmail.com>.

* INSTALL
  Tweaky tweaky...


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1386 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-20 16:46:52 +00:00
cmpilato
323f09f7af Finish issue #250 -- Tarballs from Subversion repositories don't
preserve empty directories.

* lib/viewvc.py
  (generate_tarball): Add new (optional) dir_mtime parameter, used to specify
    the modification time of the current directory while generating tarball
    data.  Now, allow empty directories in Subversion tarballs (while
    preserving the "pruning" behavior for CVS tarballs).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1384 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-14 20:03:15 +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
cmpilato
f448035ca4 * bin/standalone.py
(GUI.__init__): Fix minor spelling errors.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1381 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-14 18:23:29 +00:00
cmpilato
d8d2075d65 Finish issue #235.
* bin/standalone.py
  (Options):  Add daemon member.
  (cli): Add support for --daemon/-d option.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1380 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-14 18:08:28 +00:00
cmpilato
08c145ddc0 * bin/standalone.py
(cli): Tweak the layout of the usage message, print it to stderr,
    and report error details.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1379 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-14 17:37:48 +00:00
cmpilato
bb4204af9a Finish issue #241.
* lib/viewvc.py
  (get_file_view_info): Fix an oops which caused some whack URL
    generation for download-as-text links on files whose path has changed
    over time.
   


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1377 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-14 15:47:18 +00:00
cmpilato
2fcd41ded0 Finish issue #237.
Patch by: Russell Yanofsky <russ@yanofsky.org>
Verified by: Oliver Koltermann <ok1@tigris.org>

* lib/vclib/bincvs/__init__.py
  (_tag_tuple): Return () instead of raising a ValueError for
    single-component revisions.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1375 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-14 15:29:25 +00:00
cmpilato
df68135a6f Add some helpful text and warnings to the sample conf file, closing issue 248.
* viewvc.conf.dist
  Add a skeletal glossary of sorts, and warn that "forbidden" is only for
  modules, not roots.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1374 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-07-12 04:18:39 +00:00
maxb
87bbbba821 * lib/vclib/ccvs/rcsparse/texttools.py: Document what the texttools tag table
actually means, in terms of logical control flow.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1373 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-06-02 18:10:52 +00:00
maxb
3b40b8e245 * tparse/tparse.h: For istream, include <istream>, not <iostream>.
Incidentally, this avoids initializing the cin/cout/cerr/clog
    infrastructure - which is good, because that's somehow triggering a
    platform-specific bug on Cygwin, at the moment!


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1372 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-05-26 23:31:41 +00:00
maxb
b9102d4649 Resolve some inconsistency in the rcsparse library, concerning the parsing of
colons, which has an impact on symbols and locks.

Fixes a bug where the texttools backend would fail to parse RCS files
containing locks.

Fixes inelegance in the default backend, which no longer needs to override a
rather large chunk of the common code.

* lib/vclib/ccvs/rcsparse/default.py
  (_TokenStream.token_term): Add colon to set.
  (_TokenStream.get): Handle colon as a discrete token, just like semicolon.
  (Parser.parse_rcs_admin): Remove override definition entirely.

* lib/vclib/ccvs/rcsparse/common.py
  (_Parser.parse_rcs_admin): Fix "locks" clause to be consistent with colon
    being a token.

Lastly, the tparse backend: the changes made here are roughly congruent to
those made to the default backend, however they are completely untested, since
the current tparse in the repository seems broken - it dies due to memory
corruption.

* tparse/tparse.cpp (Token_term): Add colon to set.
  (TokenParser::get): Handle colon as a discrete token, just like semicolon.
  (tparseParser::parse_rcs_admin): Remove bizarre code which attempted to
    handle both the case of being, and not being, a discrete token via runtime
    detection.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1371 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-05-26 23:18:46 +00:00
maxb
dba9027f85 * tparse/Setup.py: Set svn:executable.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1370 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-05-26 19:14:45 +00:00
cmpilato
70530d1018 Apply the patch in issue #239, provided by "mbroadbent (Mark B)".
* templates/include/footer.ezt
  Fix an XHTML validation error caused by not closing an <A> tag.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1367 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-05-26 15:43:41 +00:00
cmpilato
464cf13729 * lib/viewvc.py
(DiffSource.__init__, DiffSource._get_row, DiffSource._flush_row):
    Add support for tracking the left-hand line numbers, too.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1366 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-05-20 07:19:32 +00:00
cmpilato
f70e9fdc4e * lib/viewvc.py
(view_diff): Fix call to common_template_data(), and avoid a path-from-parts
    reconstruction that's already been performed.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1365 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-05-20 07:08:53 +00:00
cmpilato
0e750439f8 Merge the commonize-navdata branch into the trunk. For change log
information, see these revisions:

r1348 | cmpilato | 2006-04-25 10:01:17 -0400 (Tue, 25 Apr 2006) | 17 lines
r1343 | cmpilato | 2006-04-20 04:00:21 -0400 (Thu, 20 Apr 2006) | 23 lines


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1364 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-05-19 15:40:24 +00:00
cmpilato
eedbe8b649 * tools/make-release
Only try to delete directories that exist (to reduce noise).

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1363 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-05-19 15:37:56 +00:00
cmpilato
a9de320c0e Consistify version heading formats, and lose intra-release dates.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1360 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-05-18 17:30:06 +00:00
rey4
dabc194191 Update old paths in installation docs. Patch and bug report from
Jens Seidel (jensseidel) in issue 236

* INSTALL
* viewvc-install


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1358 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-05-15 22:37:24 +00:00
rey4
3fdfabc8ee Fix exception on log page when use_pagesize is enabled. Patch from
Jay Rossiter / Signe <signe@cothlamadh.net> on users' list.

* lib/viewvc.py
  (view_log): call paging() with right arguments


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1357 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-05-15 22:21:15 +00:00
rey4
87c95ac6f8 Merge -r1354 from the `commonize-navdata' branch. It was an accidental
commit, the change was supposed to be for the trunk

* www/index.html
    update latest release section


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1355 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-05-02 13:38:42 +00:00
cmpilato
4b30fca3bf * CHANGES
Add date for the 1.0.0 release.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1353 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-05-01 21:21:30 +00:00
cmpilato
bebbc247c9 Merge -r1349 from the `commonize-navdata' branch (it was actually
intended for trunk anyway).

* viewcvs.sourceforge.net/
  Remove this tree.  It really doesn't need to persist in HEAD, and
  the SourceForge publishing directory isn't even a working copy of
  this location (because at the time, SF didn't support Subversion).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1350 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-05-01 19:30:54 +00:00
rey4
c72910f422 Add title attributes to links that don't have other descriptive text.
Change related to issue 227 filed by Steve Rowe (steve_rowe).

* templates/include/dir_header.ezt
* templates/include/header.ezt
* templates/dir_new.ezt
* templates/revision.ezt


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1347 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-24 02:18:02 +00:00
rey4
669ea3162b Implement support for full diffs. Change based on a patch from
Jacob Nevins (sourceforge user "jtn") in issue 153.

* lib/vclib/__init__.py
  (_diff_args): perform full diff when "context" option is None
  
* lib/viewvc.py
  (view_diff): add logic for full diffs
  
* templates/diff.ezt
* templates/include/diff_form.ezt
    add option for full diffs

* viewvc.org/template-authoring-guide.html
* viewvc.org/url-reference.html
    update documentation for "diff_format" template variable and url param
  
    


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1346 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-23 21:53:00 +00:00
rey4
d9777eef27 Fix possible incompatibility between loginfo-handler script and
cvs 1.12.9. Based on bug report and patch from sourceforge user
"grubert" in issue 151

* bin/loginfo-handler
  (HeuristicArgParse): accept alternate command lines for
    commits of new and imported directories


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1345 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-23 20:38:54 +00:00
rey4
eb5ccaf906 Fix bug intepreting EZT substitution patterns
* lib/ezt.py
  (_write_value): fix logic error from wrong indentation


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1344 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-21 13:27:20 +00:00
cmpilato
d61e0b8e2c * viewvc.org/download.html
Thomas Güttler points out that apparently tigris.org's new "guest"
  user password is the empty string.
  


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1341 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-20 06:59:01 +00:00
cmpilato
e0d1a728a5 Fix a bug in the revision view URL generation and auto-upgrade.
* lib/viewvc.py
  (Request.run_viewvc): Translate 'rev' parameter to 'revision'
    (instead of to 'pathrev') in the revision view.

* templates/revision.ezt
  Use "revision" instead of "rev" for the jump_rev form input box.
  Patch by fengxj <fengxiangjun@neusoft.com>.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1339 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-20 06:53:42 +00:00
cmpilato
b749971cdf * templates/dir_new.ezt
Use pixels instead of percentages for the first column.  Also, make sure all
  the *_icon_link items are defined for all path types.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1338 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-19 05:54:36 +00:00
cmpilato
171670a621 * templates/dir_new.ezt
Followup to r1335.  Drop whitespace from the icon column, and stop setting
  the font-size to 0 there.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1337 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-19 05:40:40 +00:00
cmpilato
4c96e86027 Make the dir_new template able to show as much of the log message as
can fix on the screen, and have a fixed layout (which promotes rapid
navigation).

* lib/viewvc.py
  (view_directory): Don't truncate rows.log any more, but provide a
    new member rows.short_log that is truncate.

* viewvc.org/upgrading.html
  Note rename of directory entries' "log" variable to "short_log".

* viewvc.org/template-authoring-guide.html
  Describe entries.log and (new) entries.short_log.

* templates/docroot/styles.css
  (table.fixed, table.fixed td): New fixed table styles, for use with
    the dir_new template.

* templates/dir_new.ezt
  Use new fixed table styles, and display as much of the log messages
  as screen-real-estate-ily possible (with ellipsis for truncation on
  IE, even).

* templates/directory.ezt
  Use entries.short_log now instead of entries.log.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1335 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-14 04:58:33 +00:00
cmpilato
24558586a8 * templates/docroot/styles.css
New "vc_icon" style.

* templates/include/footer.ezt,
* templates/include/file_header.ezt,
* templates/dir_new.ezt,
* templates/query_form.ezt,
* templates/revision.ezt,
* templates/directory.ezt,
* templates/roots.ezt
  Use 'class="vc_icon"' instead of 'width="16" height="16"'.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1334 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-14 04:35:13 +00:00
rey4
9bc2a1e1f2 Make rlog parsing compatible with output from Debian's 5.7-18
RCS package, which outputs CVS commit ids when present. Change
based on patch Olivier 'zer0' MATZ <zer0@droids-corp.org>
sent to the issues list.

* lib/vclib/bincvs/__init__.py
  (_re_log_info): update to match lines with commit ids


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1333 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-14 03:45:31 +00:00
rey4
9ec5d1f09e Doc updates
* CHANGES
* INSTALL
* viewvc.org/index.html
* viewvc.org/upgrading.html
* windows/README


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1331 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-09 16:02:01 +00:00
cmpilato
956482e96b * www/index.html
(Latest Release): New section.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1330 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-06 20:48:18 +00:00
cmpilato
3c55e5eaf8 * lib/viewvc.py
(__version__): Bump to 1.1-dev.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1328 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-06 19:54:29 +00:00
cmpilato
d438a4b113 * viewvc.org/contributing.html
(Release Management): Update instructions to match new tag/branch naming
    scheme.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1326 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-06 19:27:42 +00:00
rey4
10a237f380 Change make-release script to generate ZIPs with CRLF line endings.
Also, no longer include the elemx, tests, tools, tparse, and www
directories in releases.

* tools/make-release


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1313 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-06 17:22:39 +00:00
rey4
a5c7a1279f Remove Codewarrior project file for aspfool. It's a good compiler,
but the bloated binary project file format sucks and nobody uses it.

* aspfool/aspfool.mcp
* aspfool/README


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1312 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-06 16:52:38 +00:00
rey4
c195eb1e46 Restore ViewCVS 0.9.x behavior when "checkout_magic" option is disabled
so disabling it doesn't break compatibility with old log URLs.

Add new "default_file_view" option so people who won't miss the old log
URLs can view static HTML sites in ViewVC without using checkout_magic.

Also, deprecate the "checkout_magic" option and make it disabled by
default. Don't want that last part to get lost, so I'll repeat:

  =================================================================
   WARNING: This commit changes the default "checkout_magic" value
  =================================================================

Reasons for disabling "checkout_magic" by default include the security
hole it leaves for people trying to do URL authorization and its general
ugliness. People who actually use "checkout_magic" for the static HTML
browsing should prefer the "default_file_view" syntax now that it
is available. And people who really need "checkout_magic" for the
compatibility with ViewCVS 0.9.x log URLs can easily enable it.

* lib/viewvc.py
  (Request.run_viewvc, Request.get_link):
     handle "checkout_magic" and "default_file_view" options

* lib/config.py
* viewvc.conf.dist
    add "default_file_view" option and disable "checkout_magic" by default

* CHANGES
* viewvc.org/upgrading.html
* viewvc.org/url-reference.html
    update documentation


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1311 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-04 03:11:02 +00:00
rey4
93e802daf4 Make various improvements to URL reference document. In particular,
go back and add required/optional/depends columns to the tables in the
URL syntax section.

Now the document does seem ok, so can we pretty please have a release?

* viewvc.org/url-reference.html


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1310 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-03 23:54:34 +00:00
cmpilato
253c4bd625 Finish issue #226 - RSS feed title name always reads "CVS"
* templates/rss.ezt
  Make the RSS feed use "REPOSNAME commits[ (in DIRECTORY)]" for its title, 
  and "VC-SYSTEM commits to the[ DIRECTORY directory of the] REPOSNAME
  repository" for its description (where the all-caps words are replaced
  with the relevant data).



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1309 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-03 18:25:33 +00:00
cmpilato
a889e3280a * lib/viewvc.py
(Request.run_viewvc): Don't overwrite good parameters 'pathrev' and
    'revision' with old 'rev' values.  And revert a little change from r1299
    which caused some of the redirect logic to be skipped in we're already
    done the 'rev'-to-something-else translation.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1308 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-03 14:50:32 +00:00
rey4
c3382c842f Basically finish up URL reference, filling out section on Backwards
compatibility and filling in some other gaps.

* viewvc.org/url-reference.html


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1307 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-03 04:37:49 +00:00
rey4
e14ed404f8 * viewvc.org/url-reference.html
replace more occurrences of "rev" with "revision"


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1306 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-03 02:26:13 +00:00
rey4
55287d6f16 Break up "url fragment" tables in URL reference document into separate
"path components" and "query parameters" tables as discussed on commit
list.

Turns out most of the "path components" tables only have a single row,
which kind of defeats the purpose of having a separate tables, but 
no reason to worry about that now...

* viewvc.org/url-reference.html


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1305 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-03 02:18:31 +00:00
rey4
a30f7b5dc8 Remove summary tables and brackets from URL document
* viewvc.org/url-reference.html


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1304 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-03 01:50:51 +00:00
rey4
9d9092cb08 Fix ambiguities in URL handling for tarballs. These ambiguites didn't
lead to problems that anyone was likely to encounter, but should be fixed
now that we're trying to come up with a solid URL specification.

Problem #1 is that the .tar.gz suffix was not always being stripped from
the URL path, instead it was only stripped when the path did not exist in
the repository. This meant that a tarball URL like 
"/viewvc.cgi/my/path.tar.gz?view=tarball" would stop working if a
real file or directory called "my/path.tar.gz" were ever added to the
repository. The new code just strips the ".tar.gz" suffix unconditionally.

Problem #2 is a little hairier. It is the topic of issue 210 that was
partially addressed in r1256. The issue after that change was that a URL
like "/viewvc.cgi/REPOS-root.tar.gz?view=tarball&root=REPOS" would stop
working correctly if a directory called "REPOS-root" was ever added to
to repository. Before the directory was added, the URL would download a tarball
of the whole repository. After, the tarball would contain the only the
directory. When "root_as_path_component" mode is enabled, the fix for this
is simple, we just change the syntax for a whole-repository tarball to look
like "/viewvc.cgi/REPOS.tar.gz", which leaves no ambiguity. When
root_as_path_component is disabled, the ambiguity has to be resolved in an
ugly way, by having ViewVC tack on an extra parameter ("parent=1") to root
tarball URLs to distinguish them from directory tarball URLs.

Old tarball URLs that worked before this change should continue to work,
though some of them will redirect to URLs using the "parent" parameter
and other newness.

* lib/viewvc.py
  (Request.run_viewcvs):
     add tarball suffix handling that doesn't depend on what paths exist in
     the repository. Keep the old tarball suffix code around, but only for
     the sake of handling old-style URLs and issuing redirects

  (Request.get_link):
     change the preferred links to root tarballs

  (_legal_params): add "parent" parameter

* viewvc.org/url-reference.html
    mention new "parent" parameter


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1303 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-02 20:43:11 +00:00
rey4
95ad462037 * lib/viewvc.py
(view_log): don't add unused parameter to "select for diff" links


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1302 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-02 18:39:40 +00:00
rey4
7572555e01 Add information about compatibility with old versions of Highlight
* windows/README
    put it here because there doesn't seem to be any other place in the
    documentation where we talk about known issues with 3rd party software.
    I don't want to reorganize the documentation right now but I don't want
    to lose this information either.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1301 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-02 18:21:53 +00:00
cmpilato
11127db6f6 * lib/viewvc.py
(_orig_path): Update comment which include 'rev=' examples.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1300 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-31 00:16:16 +00:00
cmpilato
da94713852 * lib/viewvc.py
(Request.run_viewvc): Move the 'rev' param auto-translation up a bit,
    and don't perform pathtype checks if we're already in need-to-redirect
    mode.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1299 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-31 00:05:45 +00:00
cmpilato
db3e7c3e00 Rename the 'rev' CGI parameter to 'revision' so that ViewVC can detect
URLs that predate the new 'pathrev' stuff, and graciously upgrade
those to the new format.  

NOTE: URLs created between the introduction of 'pathrev' and now might
break, but this was deemed an acceptable cost.

Suggested by:  Russell Yanofsky

* lib/viewvc.py
  (_legal_params): Add 'revision' as a copy of 'rev'.
  (Request.run_viewvc): Redirect URLs that have an old-style 'rev'
    parameter.  (For Subversion, those become 'pathrev' params; for
    CVS they become 'revision' params.)
  (): Generate URLs using the new 'revision' param instead of 'rev'.

* viewvc.org/url-reference.html
  Track the new URL syntax.  I did *not* do the work of documenting the
  old syntax and how it maps to the new.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1298 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-30 23:48:12 +00:00
cmpilato
92af4035f3 At Garrett Rooney's suggestion, use a fast-becoming-a-standard RSS
icon instead of my fast-whip-out-an-icon custom one.  Thanks to Paul
Cuerna for the URL (http://www.feedicons.com/).

* templates/include/footer.ezt
  Reference new RSS icon.

* templates/docroot/images/rss.jpg
  Remove, in favor of...

* templates/docroot/images/feed-icon-16x16.jpg
  ... this beauty.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1297 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-30 23:01:12 +00:00
cmpilato
e51335b5fe Advertise RSS capabilities even to browsers that don't have built-in
support for RSS.

* templates/docroot/images/rss.jpg
  New image.

* templates/include/footer.ezt
  Tweak bottom matter of ViewVC pages to include new RSS image (where
  available).  



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1296 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-30 21:59:34 +00:00
cmpilato
5d0109e325 * viewvc.org/url-reference.html
Make the stylesheet more like that of the template authoring guide.

* viewvc.org/template-authoring-guide.html
  Collapse some style definitions, and add a little intro paragraph.

* viewvc.org/contributing.html
  Hook the template authoring guide and URL reference into this document.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1295 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-27 19:31:35 +00:00
rey4
f586a5ebed Add URL reference document, currently rough and incomplete. Idea from
C. Michael Pilato in dev-list discussion.

I wanted to knock this out this weekend, but didn't get too far. One
more weekend should be enough though, and I welcome any feedback, especially
ideas on how to organize it better.

* viewvc.org/url-reference.html
    new


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1294 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-27 14:36:58 +00:00
maxb
6b98e0a8ec Improve viewvc-install's response to invalid arguments.
* viewvc-install: Move introductory info printing after argument passing, so
    that it is not shown if there is an argument parsing error.
  Catch GetoptError, and report nicely.
  Do not pass None to getopt where it wants a string.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1293 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-26 20:23:14 +00:00
rey4
fe995627d3 Get rid of Highlight line number workaround. Highlight 2.4.5 came out
yesterday and fixes all the issues we had with line numbering. This change
also allows ViewVC to work with old versions of Highlight all the way back
to 2.2.10.

Also, remove "highlight_style" configuration option as suggested by
Andreas Amann (aamann) in issue 126.

* INSTALL
    document new version requirements
    
* lib/viewvc.py
  (MarkupHighlight.__init__):
    stop passing --style and --line-number-start options to highlight

* lib/config.py
* viewvc.conf.dist
* viewvc.org/upgrading.html
    remove "highlight_style" option


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1292 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-21 22:47:11 +00:00
rey4
176ede2fef Get rid of the "derived from cvsweb" notice at the top of viewvc.py
as Greg Stein suggested in issue 167.

* lib/viewvc.py


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1291 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-20 03:39:54 +00:00
rey4
72459917f7 Restore copyright statements for Curt Hagenlocher accidentally
deleted in r1288

* lib/blame.py
* lib/vclib/ccvs/blame.py


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1290 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-20 03:27:02 +00:00
rey4
95db9e7f64 * viewcvs-install
* viewvc-install
    rename one more file



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1289 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-18 02:08:47 +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
41296bf318 Avoid potential problem with pipe_cmds
* lib/popen.py
  (_pipe.close): use os.waitpid instead of os.wait to avoid messing with
    processes that dont belong us


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1286 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-17 20:25:34 +00:00
rey4
19fbe15fe9 Make cvsdbadmin script work correctly when it is used to update
individual modules or directories underneath a cvs root. It will
now crawl up the directory path looking for a CVSROOT directory
so it can use the right path for the "repositories" table and
allow results to show up in queries

* bin/cvsdbadmin
  (RootPath): new
  (__main__ section): use RootPath to find correct cvs roots


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1285 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-17 16:47:57 +00:00
rey4
49d332a996 Fix error messages when a path string is passed to vclib.ItemNotFound
instead of a list of path parts. We seem to do that a few places in
the svn module.

* vclib/__init__.py
  (ItemNotFound.__init__): accept path strings as arguments


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1284 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-17 16:39:17 +00:00
cmpilato
66923a4982 * lib/viewcvs.py
(MarkupEnscript.__init__): Revert a change made in r1255 which
    tweaked the sed expression.  The goal was to try to also strip out
    the <PRE> and </PRE> tags from the output, but the expression I
    used also had the undesired effect of dropping the whole last line
    of a non-newline-terminated file.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1283 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-16 04:13:19 +00:00
cmpilato
34d32b394e Some improvements to the py2html integration. Thanks (I think...) to
David Martínez Moreno (Ender) for sending me down this path.

* lib/py2html.py
  Update to version 0.8.  Patch by David Martínez Moreno <ender@debian.org>.

* lib/viewcvs.py
  (markup_stream_python):  Call PrettyPrint.set_mode_rawhtml_color().

* lib/PyFontify.py
  Rework this file to use spaces instead of tabs.  Use the 're' module
  instead of 'regex'.  Fix a bug which caused "raise" to not be
  noticed as a keyword (though "rais" would be).  Add "assert" and
  "exec" to the keywords list.

* templates/docroot/styles.css
  Reformat the highlight styles, and made the .kwd style have a little color.
  Also, add the styles that py2html uses.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1282 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-13 19:56:31 +00:00
cmpilato
342ec95573 * TODO
* bin/cvsdbadmin
  Minor spelling and whitespace fixes.  Patch by David Martínez 
  Moreno <ender@debian.org>.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1281 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-13 15:41:44 +00:00
cmpilato
5912f400e6 Make py2html.py executable (it has a shell script mode).
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1280 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-13 15:31:48 +00:00
cmpilato
73f5b59865 * bin/svndbadmin
(handle_revision):  Add 'verbose' parameter, and use it.
  (main):  Add 'verbose' parameter, and pass it off to handle_revision().
  (usage):  Update the usage message (and make it a little more ... useful).
  (__main__):  Look for the -v (verbose) flag.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1279 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-10 15:26:58 +00:00
cmpilato
a2db8718cf Make some fixes to the pipe handling code to avoid zombie processes.
Patch by Paul Sokolovsky <psokolovsky@vasoftware.com>.

* lib/popen.py
  (pipe_cmds): Instead of storing only the process ID of the last
    child process in a multi-process pipe, keep them all, and wait on
    them all to finish.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1278 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-07 14:57:27 +00:00
cmpilato
71cf9e54ca Um. Character entities in comments are somewhat pointless. Replace the ones
I added in r1276 with double-semicolons.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1277 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-06 20:01:11 +00:00
cmpilato
3b592577a1 With Greg Stein's blessing, drop his name from the template comments.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1276 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-06 19:58:46 +00:00
cmpilato
e8a49a088c Remove SourceForge migration checklist, and lose implementation details of
features.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1275 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-06 18:55:38 +00:00
cmpilato
8977d400de Consistify capitalization.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1274 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-06 18:54:27 +00:00
cmpilato
16d80cb070 Add viewvc.org to the left-nav bar.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1273 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-06 18:53:41 +00:00
rey4
c2e18ca589 Make vhost configuration work under mod_python. Patch by
Robert Spier <rspier@pobox.com> from the dev list.

* bin/mod_python/viewcvs.py 
  (index): load_config needs a sapi object to properly handle vhosts


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1272 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-03-01 12:28:09 +00:00
cmpilato
0049b7fed9 * templates/markup.ezt
Check for existence of date, ago, and author before displaying them or their
  surrounding text.  This is a follow-up to r1270.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1271 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-28 18:08:23 +00:00
cmpilato
7aaf4dc8b7 Finish issue #215.
* lib/viewcvs.py
  (view_markup): Ensure initialization of variables when show_log_in_markup
    is disabled.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1270 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-27 14:07:07 +00:00
rey4
44131b424d Revert unintended change from r1267. Garrett Rooney
<rooneg@electricjellyfish.net> pointed it out on the
dev list.

* bin/mod_python/viewcvs.py


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1269 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-26 23:45:50 +00:00
rey4
4c51a8faf6 Fix windows install issues #213 and #214.
Yahor Sinkevich (_tom) made me do it.

* viewcvs-install
  (install_tree): dont copy "_svn" directories

* windows/README
    say up front that binary subversion bindings may tie you to a
    specific version of python. also make it clear that ViewVC
    doesn't need CVSNT to browse Subversion repositories


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1268 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-25 17:17:29 +00:00
rey4
10ff60245b Fix bug from r1266 in integrated query view reported by
Larry Silverman <cerulean47@gmail.com> on the users
list.

* lib/viewcvs.py
  (build_commit): handle the case where dir_strip is ""


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1267 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-25 16:52:24 +00:00
rey4
d8224da3c4 Make the integrated query page work when the repository directory
entered in cvs_roots is a subdirectory of a cvs root rather than a
top-level root directory.

Also, raise an exception when a repository being queried doesn't
exist in the database instead of returning 0 matches.

* lib/cvsdb.py
  (FindRepository): new
  (CleanRepository): add docstring

* lib/viewcvs.py
  (build_commit): strip off top-level directory paths from query results
    when the configured root is a subdirectory of the database root
  (view_query): call cvsdb.FindRepository and use information returned
    to convert paths relative to configured root to database paths



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1266 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-22 04:26: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
757e115829 Restore highlight "line-number-start" option. Quoth Andreas Amann
(aamann) in issue 126:

  "the --line-number-start is needed as of 2.4.2 (latest is 2.4.3)
  otherwise line numbers will start at 0 instead of 1"

* lib/viewcvs.py
  (MarkupHighlight.__init__):
    update highlight command line


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1264 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-16 18:24:11 +00:00
cmpilato
0b1a9fde95 Fix a bug which caused 404's for revision views of the default
repository when root_as_url_component is disabled.

* bin/standalone.py
  (StandaloneServer.is_viewcvs): Allow '?' as a path terminating
    character (just like '/') when checking to see if the input path is
    under ViewVC's control.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1263 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-15 19:06:23 +00:00
cmpilato
f93fb6d68a * viewcvs-install
(InstallFile): Whitespace tweak.
  (install_tree): Tweak text of installer prompts to assist folks with
    the somewhat obscure idea of DESTDIR.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1262 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-15 15:09:57 +00:00
cmpilato
0525532ef7 Use <em> instead of <i>, <strong> instead of <b>.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1261 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-14 22:18:33 +00:00
cmpilato
9803cd5958 Finish issue #178 -- remove references to symbolic revisions in
instructions for Subversion diffs.

* lib/viewcvs.py
  (setup_diff): Call repos._getrev() on the diff input revisions so
    'HEAD' gets resolved to a number.

* templates/include/diff_form.ezt
  Use tag-existence-aware instructions on the diff-form.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1260 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-14 22:09:54 +00:00
cmpilato
0aad71271f Re-order COMMITTERS based on first commit of each username.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1259 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-14 21:51:17 +00:00
cmpilato
ccab4b33ae Add a COMMITTERS file.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1258 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-14 21:41:47 +00:00
cmpilato
2134d1f657 Finish issue #174 -- markup view of HEAD shows HEAD metadata, but
uses last-changed-rev for other display markings.

* lib/viewcvs.py
  (view_markup): Use the resolved revision instead of the input
    revision when fetching metadata.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1257 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-14 21:28:34 +00:00
cmpilato
c2434be105 Finish issue #210. Patch by Gerard Gerritsen <sigcafe@tigris.org>,
tweaked by me.

* lib/viewcvs.py
  (Request.run_viewcvs): Handle requests for [rootname]-root.tar.gz
    specially as tarball download views of the root of the repository.
  (Request.get_link): If we are prepping a URL for tarball generation
    on the root of a repository, use the filename [rootname]-root.tar.gz
    instead of just root.tar.gz.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1256 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-14 20:39:15 +00:00
cmpilato
59d97089e1 Finish issue #212 -- XHTMLify the highlight integration.
* lib/viewcvs.py
  (MarkupEnscript.__init__): Have sed strip the <PRE> wrappers around
    enscript output, too.
  (MarkupHighlight.__init__): Drop the --line-number-start and
    --include-style options to highlight; add --xhtml and --fragment.
    Lose the 'sed' invocation too, as it is no longer necessary.
  (view_markup): No longer pass '<pre>' and '</pre>' to the
    MarkupPipeWrapper() call -- the template will handle that.

* templates/markup.ezt
  Add <pre>...</pre> wrappers around the markup stream.  Also, name
  that whole <div> "vc_markup".

* template/docroot/styles.css
  Embed the highlight stylesheet.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1255 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-14 20:13:00 +00:00
cmpilato
e12dce81e1 Fixup <br> tags (to <br />).
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1254 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-14 19:47:41 +00:00
cmpilato
09bddb189a Require Subversion 1.2.0 or better for the 'svn' module.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1253 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-13 22:26:39 +00:00
rey4
1f416a919f Fix EZT callback implementation so along with being able to write raw data
to the output, callbacks can also write formatted output (controlled by
[format] directives.) EZT now passes Context object arguments to callbacks
instead of file pointers, so more functionality can be exposed to Callbacks
in the future without loss of backwards compatibility.

Also make improvements to implementation of [format] so directives will
take effect in files included through variable references ([include path])
just like files included through string constants ([include "path"]).
And make it possible to specify custom format types (beyond "raw" "html"
"xml") with callbacks and without the need to modify ezt.py.

* lib/ezt.py
  (__doc__): update documentation
  (Template._printers, Template._cmd_print_html, Template._cmd_print_xml):
    remove
  (Template._parse, Template._cmd_format, Template._cmd_end_format, 
   _raw_printer, _html_printer, _printers): update [format] implementation
  (Template.parse): update call to _parse
  (Template.execute): update call to _execute
  (Template.generate, Template._execute, Template._cmd_print,
   Template._cmd_format, Template._cmd_include, Template._cmd_if_any,
   Template._cmd_if_index, Template._cmd_is, Template._do_if,
   Template._cmd_for, Template._cmd_define):
    move file pointer into Context object
  (_write_value): handle callbacks as printers and callbacks that use printers
  (_context, Context): rename _context class to Context and fill out methods
    since object is now exposed outside EZT as an interface for accessing EZT
    functionality from callback functions

* lib/viewcvs.py
  (MarkupPipeWrapper.__call__, MarkupShell.__call__):
    update for new (futureproofed) callback implementation


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1252 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-10 04:24:12 +00:00
cmpilato
4a85813c24 * viewvc/lib/vclib/svn/__init__.py
(BlameSourceKludge): Remove.
  (SubversionRepository.annotate): Go back to using BlameSource --
    Russell fixed it in r1236.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1251 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-09 18:41:34 +00:00
cmpilato
fd1afe5fdb * viewvc/templates/diff.ezt
Avoid creating references to undefined "vc_idiff_" class.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1250 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-06 18:36:46 +00:00
cmpilato
d28ec94d3c * viewvc/lib/idiff.py
(_item.__init__): Call update() with the proper argument.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1249 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-06 18:30:10 +00:00
rey4
40a2cdda10 Fix issue #205 "Illegal id tags in tempates" reported by
Andreas Amann (aamann) using patch he provided.

* templates/diff.ezt
* templates/annotate.ezt
    put a letter in front of id tags that begin with numbers


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1248 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-05 18:37:37 +00:00
rey4
a6391ce319 Fix HTML escaping in new unified diff view
* lib/idiff.py (_differ_split)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1247 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-05 18:26:46 +00:00
rey4
1700dcd3c8 Implement trac-style unified diffs (with line numbers along the side
and intraline changes highlighted). This feature requires Python 2.2
and is disabled by default.

* templates/diff.ezt
    add table for highlighted unified diffs

* lib/idiff.py
  (unified, _trim_context, _differ_split): new

* lib/viewcvs.py
  (view_diffs): set new "unified" template var on diff page


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1246 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-05 17:32:44 +00:00
rey4
ffe781b297 Check in some files that were supposed to be included in r1244
* templates/docroot/styles.css
* templates/diff.ezt
* viewcvs.conf.dist


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1245 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-04 22:51:55 +00:00
rey4
52b8b89883 Add rudimentary support for intraline diffs. Implementation is pretty
clean, but it doesn't provide all the bells and whistles of our normal
diff interface. It's disabled by default and requires python 2.4 to
run.

* templates/docroot/styles.css: 
    add new styles

* templates/diff.ezt:
    add table for intraline diffs

* lib/config.py:
* viewcvs.conf.dist
    add new "hr_intraline" option

* lib/vclib/svn/__init__.py
  (FileContentsPipe.readline): prevent from returning "" before eof and
    from stripping out newlines
  (FileContentsPipe.readlines): new
  
* lib/idiff.py
    new

* lib/viewcvs.py
  (view_diff): set new "sidebyside" template variable



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1244 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-04 22:48:00 +00:00
rey4
ddaebb0f26 Make EZT library support python iterators so you can pass in things like
like generator functions. This patch was attached to issue 201. I am the
author, but credit goes to Greg Stein for valuable feedback which allowed
me to simplify the initial implementation.

* lib/ezt.py
  (Template.generate, Template._cmd_if_index, Template._cmd_for,
   _get_value): replace ctx.for_index member with ctx.for_iterators
  (_Iterator, OldIterator, _iter): new


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1243 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-04 22:21:47 +00:00
rey4
f24f6e5119 Fix issue 204, 'Invalid "Repository Listing" location' reported by
Erik C. Thauvin (ethauvin)

* lib/viewcvs.py
  (Request.get_link):
    return "/" instead of "" when generating top level links


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1242 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-04 19:54:34 +00:00
rey4
c4edb250aa Rename ndiff.py and difflib.py modules, which are only provided for
python 1.5 compatibility.

* lib/difflib.py
* lib/ndiff.py
* lib/compat_ndiff.py
* lib/compat_difflib.py
    rename 

* viewcvs-install
    update ndiff invocation


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1241 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-03 05:16:29 +00:00
rey4
0000ed88bb Rename the "Project Root" drop down box to "Repository" in the
default templates. We already say "CVS Repositories" and
"SVN Repositories" inside the drop down box, so we might as well
use same term outside. Also, "Root" has a specific meaning in CVS
(a top level directory containing a CVSROOT folder, a bunch of
modules, and no files) and CVS repositories in the drop down box
are not necessarily CVS roots.

* templates/include/header.ezt


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1240 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-01 00:40:33 +00:00
rey4
68673daba3 Allow CVS roots to be specified as root_parent directories, that way
ViewVC can list CVS modules alongside Subversion repositories.

* lib/viewcvs.py
  (load_config): include modules in CVS root_parent directories (not just
    roots) in repository list


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1239 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-02-01 00:34:24 +00:00
rey4
8afaca5f75 Fix mismatch between config.py and config file
* lib/config.py
  (Config.set_defaults): set "php_exe_path" instead of "php_path"


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1238 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-01-31 19:15:52 +00:00
cmpilato
ef93e8eed3 * viewvc.org/download.html,
* viewvc.org/contributing.html
  Update the downloading and Subversion checkout instructions.  Also, provide
  a link to the nightly builds.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1237 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-01-27 14:53:14 +00:00
rey4
42b55eb5f9 Improve error reporting when svn blame fails. Also fix some bugs in
BlameSource. Maybe now we don't need BlameSourceKludge anymore...

* lib/vclib/svn/__init__.py
  (BlameSource.__init__): add missing first_rev parameter
  (BlameSource.__getitem__): remove check for fp.eof() which may
    return true when the process has finished executing but data
    can still be read from the pipe
  (BlameSource.__getitem__, BlameSourceKludge.__getitem__):
    use regex to parse blame info so we can show a detailed error
    message instead of just an exception when split() or int() fail

* lib/popen.py
  (_pipe.eof): add note about implementation problem


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1236 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-01-22 17:01:02 +00:00
cmpilato
f88451caaa Finish issue #34 by making annotation lines bookmarkable, and linking
to them from the diff page.

* viewvc/templates/annotate.ezt
  Make each row bookmarkable.

* viewvc/templates/diff.ezt
  Make line numbers into links to the annotate page.

* viewvc/lib/viewcvs.py
  (view_diff): Add an annotate_href to the data dictionary.

* viewvc/viewvc.org/template-authoring-guide.html
  (variables-diff): Document new annotate_href and changes.line_number
    variables.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1235 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-01-21 13:08:54 +00:00
cmpilato
695dd93b47 Implement support for line numbers in the diff view.
* viewvc/lib/viewcvs.py
  (DiffSource.__init__): Initialize a new line_number member.
  (DiffSource._get_row, DiffSource._flush_row): Calculate line number
    information from the diff output.

* viewvc/templates/diff.ezt
  Show line numbers with the diff, and make those line numbers
  bookmarkable (for sub-page granularity).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1234 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-01-21 12:44:34 +00:00
cmpilato
d3358ad705 Really finish issue #177. Fix a little bug with the bugfix done in r1232.
* viewvc/lib/vclib/svn/__init__.py
  (SubversionRepository.annotate): Always cross copies when looking
    for the first and last revisions in the file's history.  Duh.  



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1233 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-01-21 09:26:19 +00:00
cmpilato
d1d1b73cde Finish issue #177.
Fix a bug with Subversion annotate views which allowed the first
revision of a file's life to be a link to a diff against a
non-existent path/rev location.

NOTE: This doesn't fix the problem for remote repositories (accessed
      via the svn_ra module).

* viewvc/lib/vclib/svn/__init__.py
  (_get_history):  Make 'options' optional.
  (BlameSource.__init__, BlameSourceKludge.__init__):  Accept new
    first_rev parameter which is the first revision in the history of
    the file.
  (BlameSource.__getitem__, BlameSourceKludge.__getitem__):  Don't
    store a 'prev' revision that's older than the first revision of
    the file.
  (SubversionRepository.annotate): Instead of using _get_last_history_rev(), 
    call_get_history() to find both the first and the last revision in
    the file's history.  Update call to BlameSourceKludge().



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1232 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-01-21 06:54:04 +00:00
cmpilato
e93648496d * www/index.html
Override a few more styles to hide the "Description" box.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1231 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-01-19 02:06:08 +00:00
cmpilato
4510863e42 Try a different hack (the same one I used on subversion.tigris.org) for
hiding the project info box on the webpage which doesn't also have the
unfortunate side effect of losing the links for project editing, 
requesting membership, and other such useful things.

* index.html
  Lose a JavaScript redirect hack for a style override hack.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1230 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-01-19 01:46:47 +00:00
rey4
11174518d5 Fix mod_python issue, #188 reported by Andreas Amann (aamann).
* lib/viewcvs.py
  (generate_page): pass file object associated with current request
   to EZT instead of sys.stdout, which under mod_python is a proxy
   that tries to figure out the current request based on the current
   thread id. It can't be used in worker threads spawned by
   popen.pipe_cmds


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1229 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-01-18 01:34:11 +00:00
cmpilato
1f40fe9094 * viewvc/viewcvs.conf.dist (enscript_path),
* viewvc/lib/config.py (Config.set_defaults)
  Set use_highlight to 0 by default, so that the default configuration
  has a mildly higher chance of not being broken out of the box.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1228 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-01-17 01:43:12 +00:00
cmpilato
95fd278332 Add a new --script-alias option to standalone.py, to allow folks to
dynamically fake a non-root location for a running ViewVC process.
Reasoning?  It offends me that "viewcvs" was hardcoded in ... just
seems wrong.

* bin/standalone.py
  (Options): Populate a new script_alias member.
  (StandaloneServer.do_POST, StandaloneServer.is_viewcvs,
   StandaloneServer.redirect, StandaloneServer.run_viewcvs): Use
    options.script_alias instead of a hardcoded "viewcvs".
  (cli): Parse new --script-alias/-s option for dynamically defining
    the ScriptAlias.  Rework the usage message for my own pleasure.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1227 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-01-05 19:24:13 +00:00
cmpilato
993b156089 Finish issue #189 -- stale URLs for enscript in INSTALL file and website.
* INSTALL
* viewvc.org/index.html
  Update URLs for enscript to http://www.codento.com/people/mtr/genscript,
  as suggested by Eric Garrido <eric@tigris.org>.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1226 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-01-04 20:25:38 +00:00
rey4
ed6a269934 Resolve issue 147 "patch for aix co." Patch by sourceforge user
coshx.

* lib/vclib/bincvs/__init__.py
  (_re_co_filename): broaden regex


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1225 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-30 07:30:45 +00:00
rey4
0a889562f3 Use built in enscript file detection. This is an updated implementation
of an patch from Andreas Amann (sf user ahndee) in issue 156.

* lib/viewcvs.py
  (MarkupShell.__call__): make input file pointer optional
  (MarkupEnscript.__init__, MarkupEnscript.__call__): write input to
    temporary file so enscript can decide what kind of highlighting to do
    based on the file name
  (enscript_extensions, enscript_filenames): removed
  (view_markup): update call to MarkupEnscript

* lib/compat.py
  (mkdtemp): new function

* lib/config.py
* viewcvs.conf.dist
* viewvc.org/upgrading.html
    remove "disable_enscript_lang" option


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1224 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-30 07:29:22 +00:00
rey4
4e4e961b2d * windows/README
minor updates


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1223 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-29 17:13:41 +00:00
rey4
95d99a5826 Fix issue 187, "viewcvs.conf.dist contains outdated references." Patch
and bug report by Gerard Gerritsen (sigcafe).

* viewcvs.conf.dist
    fix typos and old reference to dir_alternate in comments


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1222 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-29 15:17:31 +00:00
rey4
0467a8e1d1 Fix exception in tarball view for CVS repositories when
use_rcsparse is enabled.

* lib/vclib/ccvs/__init__.py
  (CCVSRepository.dirlogs): set DirEntry.path member


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1221 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-29 15:08:27 +00:00
rey4
360c5d9e66 Make popen.pipe_cmds() accept an "out" argument that controls where
output from last command goes. For now only the unix implementation
respects it, windows implementation always writes to standard output
as before.

* lib/popen.py
  (pipe_cmds): add "out" argument

* lib/viewcvs.py
  (MarkupShell.__call__): update call to pipe_cmds()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1220 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-29 14:49:42 +00:00
rey4
03070a2320 Attempt to make directory log page a little less confusing.
* templates/include/file_header.ezt
    link to current directory listing instead of parent directory

* templates/include/log_header.ezt
    don't display "Links to HEAD:" stuff for directories. With
    change above it's redundant

* templates/log.ezt
* templates/log_table.ezt
    label directory links as "Directory Listing" instead of "(view)"


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1219 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-23 16:03:14 +00:00
rey4
2d808ae415 Add limit_changes configuration option to limit the number of changed
paths shown in the subversion revision view and in query results.

* lib/config.py
* viewcvs.conf.dist
    add "limit_changes" option

* lib/cvsdb.py
  (LazyCommit): new class
  (CheckinDatabase.LazyCommit): return LazyCommit objects instead of
    fetching all properties of all commits

* lib/viewcvs.py
  (_sticky_vars, _legal_params): add "limit_changes" query parameter
  (view_revision): handle "limit_changes" and add links to manipulate it
  (view_queryform, build_commit, view_query): same

* templates/query_form.ezt
    add field to set "limit_changes"

* templates/query_results.ezt
    wherever changed files are being hidden, add link to show all files

* templates/revision.ezt
    same, and if that link is clicked, show another link to restore
    the default limit_changes so you can toggle back and forth

* viewvc.org/template-authoring-guide.html
* upgrading.html
    document new template variables and configuration option
  


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1218 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-23 13:24:26 +00:00
rey4
6ae579587e Line wrap windows README file. I had been using a little python script
to do this for windows releases, but it's better just to pre-wrap it
and keep the release process simple.

* windows/README


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1217 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-23 05:56:23 +00:00
rey4
7bb6cac37e Add precompiled aspfool.dll. It's needed to run ViewCVS under
ASP and it's not very big. File is from "ViewCVS for Windows"
page at http://russ.hn.org/viewcvs/ which I'm about to take
down.

* windows/aspfool/aspfool.dll
    new


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1216 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-22 19:50:11 +00:00
rey4
1c87fc7fa7 Fix issue 104 "ViewCVS Broken on WinNT" with patch provided by
sourceforge user "tomy"

* lib/win32popen.py
    don't import win32security, not needed and doesn't work on NT4


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1215 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-22 17:04:44 +00:00
rey4
5e595215ec Documentation updates & template cleanups for recent changes.
* lib/viewcvs.py
  (common_template_date):
    only set "rss_href" when it will be valid URL

  (build_commit):
    only set commits.rev for subversion queries

    rename some of the new RSS template variables
      commits.title -> commits.short_log
      commits.url -> commits.rss_url
      commits.date -> commits.rss_date
  
* templates/include/header.ezt
* templates/rss.ezt
    update for changed template variables

* viewvc.org/template-authoring-guide.html
* viewvc.org/upgrading.html
* CHANGES
    update documentation


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1214 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-22 16:55:26 +00:00
rey4
70ffad13c1 Update URL to the highlight program. Inadvertently gave a URL to
GNU Highlight instead of the Highlight program we support. The two
programs have the same name, and do the same things, but are not at
all related. Patch by Wataru Hirayama <hirayama@rr.iij4u.or.jp>

* INSTALL


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1213 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-22 14:47:13 +00:00
rey4
dabb055603 Add RSS capability to ViewVC using patch from Paul Koning (pkoning)
in issue 179. (All changes are his except for a fix in standalone.py,
and a line initializing "commits.url" template variable to None
in build_commit).

* lib/config.py
* viewcvs.conf.dist
    add [cvsdb] rss_row_limit config option

* lib/cvsdb.py:
  (CheckinDatabase.CreateSQLQueryString): make "LIMIT" value customizable
  (CheckinDatabaseQuery.__init__): set new "limit" member
  (CheckinDatabaseQuery.SetLimit): new

* lib/viewcvs.py:
  (_legal_params): add "limit" parameter
  (common_template_data): add "rss_href" variable
  (make_rss_time_string): new
  (build_commit): add commits.title, commits.rev, commits.author,
    commits.date, commits.url template variables
  (view_query): handle "limit" parameter and new "rss" format

* templates/include/header.ezt
    use new rss_href variable

* templates/rss.ezt
    new

* bin/standalone.py
  (run_viewcvs): set HTTP_HOST environment variable
 


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1212 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-22 05:16:23 +00:00
rey4
9aef5f5ad6 Add "port" option to connect to specified mysql port.
Patch written by sunjammerx in issue 106.

* lib/config.py
  (Config.set_defaults):
    set default port

* lib/cvsdb.py
  (CheckinDatabase.__init__, ConnectDatabaseReadOnly, ConnectDatabase):
     handle port value

* lib/dbi.py
  (connect):
    same

* INSTALL
* viewcvs.conf.dist
    update


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1211 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-22 03:07:31 +00:00
rey4
053658384c Make "Revision Log" links on markup, annotate and diff pages
jump to the current revision on the log page, like they used
to in 0.9.x. This patch by Jordan Russell <jr-list-2005@quo.to>
from issue 109.

* lib/viewcvs.py
  (common_template_data):
    set "log_rev_href" template variable

* templates/include/file_header.ezt
    use "log_rev_href" template variable

* viewvc.org/template-authoring-guide.html
    update


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1210 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-21 20:45:11 +00:00
rey4
93c239a2af Fix issue 181, query results groups subversion commits from different
revision numbers. Patch by Paul Koning (pkoning)

* lib/viewcvs.py
  (view_query):
    when roottype != cvs, only group commits from same revision


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1209 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-21 15:18:45 +00:00
rey4
9b5c4db217 Add support for colorizing using highlight. This is a stripped down version
of a patch by Andreas Amann (aamann) from issue 126.

* lib/viewcvs.py
  (MarkupHighlight):
    new EZT callback for invoking highlight

  (view_markup):
    use MarkupHighlight class when "use_highlight" option enabled

* lib/config.py
* viewcvs.conf.dist
    add new configuration options for highlight

* templates/docroot/styles.css
    add ".line" style to make highlight line number stand out
    
* INSTALL
    mention highlight required version and home page


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1208 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-20 18:42:32 +00:00
rey4
5c7258464e Simplify enscript and php colorizing using EZT callbacks
* lib/viewcvs.py
  (MarkupShell):
    base class for colorizing callbacks that use shell tools

  (MarkupEnscript, MarkupPHP):
    make these into callbacks instead of pseudo-file pointers, eliminate
    the need for temporary files since with callbacks these tools can
    run in the middle of template execution and send their output to 
    straight to stdout.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1207 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-20 17:11:01 +00:00
rey4
08cc30e0cd Change required CvsGraph version from 1.4 to 1.5 to close out
issue 171 reported by Gerard Gerritsen (sigcafe)

* INSTALL


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1206 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-19 21:15:56 +00:00
cmpilato
f609e62ba2 * templates/include/header.ezt
Make the ViewVC logo a link to http://www.viewvc.org/.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1205 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-19 17:07:21 +00:00
cmpilato
eb9ee85f90 * templates/docroot/images/logo.png
Grumble.  Fix the background "color" of the transparent portions to
  be white for whack Internet Explorer's sake.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1204 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-19 17:04:56 +00:00
cmpilato
fbd59621cf * lib/viewcvs.py
(parse_date): Use compat.timegm() instead of time.mktime().  This closes
    issue #5, and comes with rey4's money back guarantee.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1203 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-19 16:14:34 +00:00
cmpilato
9fdeff7fd0 * templates/docroot/images/logo.png
Tweak the logo to reflect the new project name.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1202 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-19 16:04:29 +00:00
cmpilato
72146c0875 Revert the changes made in r1196. They were wrong. Actually, cmpilato
was wrong -- the changes merely followed his lead.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1201 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-19 14:58:20 +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
4f0805fcc1 Fix issue 172, typo in query results table header reported by
Paul Koning (pkoning). This is also issue 175.

* templates/query_results.ezt
    fix html-o


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1199 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-17 15:42:01 +00:00
rey4
cd05e5c22b Fix issue 173, cvsdb references MySqlDb connection escape() method not
present in old versions of mysql-python.

escape() has been a method of the _mysql.Connection objects since the very
beginning, but didn't get exposed in the python objects until 0.9.2
when they made the python class inherit from the C one. Python connections
have had an equivalent literal() method since 0.9.0.

* lib/cvsdb.py
    call conn.literal() method instead of conn.escape()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1198 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-17 15:40:52 +00:00
rey4
752c3b05d4 Fix issue 166 "empty diff generates an exception" reported by
Yoshinori Okuji (yo). This is also issue 184 

* lib/viewcvs.py
  (rcsdiff_date_reformat):
    avoid an exception when date is None


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1197 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-17 15:37:22 +00:00
cmpilato
5cb9ec78ac Finish Issue #5.
* lib/viewcvs.py
  (parse_date): Use time.altzone when DST is in effect.  Fix suggested
    by SourceForge user "johmart".

NOTE:  This change was reverted in r2001.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1196 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-16 17:46:39 +00:00
cmpilato
75e08ad3bf * www/index.html
Ah, forget the custom style stuff right now.  The color clash with the
  Tigris.org branding is awful.

* www/images,
* www/styles.css
  Removed.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1195 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-15 21:54:17 +00:00
cmpilato
5cd3a20158 * www/index.html
Minor tweaks to preformatted section.

* www/styles.css
  Gut out unused styles, and remove more font size dictation.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1194 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-15 21:47:45 +00:00
cmpilato
0f1185f221 * www/index.html
Use CSS for preformatted text instead of <pre> tags.

* www/styles.css
  Stop shrinking the font size.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1193 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-15 21:40:11 +00:00
cmpilato
299afac8b7 Begin sorta kinda figuring out how to distribute data on the new
tigris.org project site.

* www/index.html
  Describe ViewVC (taken from viewvc.org/index.html).

* www/styles.css,
* www/images
  Copy from viewvc.org/images/.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1192 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-15 21:37:19 +00:00
cmpilato
285572e89c Fix email addresses on the website. Noticed by Richard Calmbach.
* viewvc.org/who.html
* viewvc.org/license-1.html
* viewvc.org/upgrading.html
* viewvc.org/download.html
* viewvc.org/contributing.html
* viewvc.org/index.html
* viewvc.org/contact.html
  s/@viewcvs.tigris.org/@viewvc.tigris.org/

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1191 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-15 15:36:43 +00:00
cmpilato
92b4270895 * www/index.html
Move some stuff from the project attributes into the index.html file.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1190 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-14 22:56:05 +00:00
cmpilato
cd9a2d3a44 Goofing off a little bit in the www/ area, preparing for some real
site content creation.

* www
  New tigris.org magic website directory.

* www/project_tools.html
* www/index.html
  New site files.



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1189 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-14 22:53:17 +00:00
cmpilato
a03977c386 Add *.pyc to the ignores list for the lib directory and its subdirs.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1188 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-13 21:35:06 +00:00
cmpilato
08efb7ca46 Finish issue #165 - Can't get valid log display for directories (subversion)
* lib/viewcvs.py
  (view_log): Pass '1' for the 'svn_show_all_dir_logs' option in calls to
    repos.itemlog().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1187 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-13 20:21:10 +00:00
cmpilato
2a96f56114 Fix issue #176 - Subversion annotate doesn't honor rev number.
* lib/vclib/svn/__init__.py
  (BlameSource.__init__, BlameSourceKludge.__init__):  Use both the @-syntax
    and the -r parameter to 'svn' to get the right blame information.
    Patch by Paul Koning <pkoning@tigris.org>.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1186 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-13 20:10:44 +00:00
rey4
27db52403e Fix exception caused by r1173 when kv files are used. This is issue 170
reported by cmpilato.

* lib/viewcvs.py:
  (Config.load_config):
    re-add line from before r1173 that assigns "base" member


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1185 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-13 06:01:19 +00:00
rey4
ca8d7b89d4 Fix MySQL 4.1 incompatibility in make-database script. Patch provided by
sourceforge user "dchabal" in issue 131. The same bug was also reported
in issues 1, 17, 146.

* bin/make-database
    remove "DEFAULT '0'" clauses from auto_increment column declarations


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1184 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-12 17:28:59 +00:00
rey4
d6f18dc5bf Don't forget to install mod_python handler. Fixes issue 163 reported
by Andreas Amann (aamann) caused by revision 1173

* viewcvs-install
  (FILE_INFO_LIST):
    add new handler.py file


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1183 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-11 14:51:45 +00:00
rey4
d742c7fe32 Fix invalid variable reference in log_table template reported by
Gerard Gerritsen (sigcafe) in issue 164

* templates/log_table.ezt
    s/stick/pathrev/



git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1182 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-11 14:46:55 +00:00
rey4
3154c3a102 Simplify pathrev/lastrev code, removing cruft left over from
previous iterations. This change shouldn't affect any
user-visible ViewVC behavior.

* lib/viewcvs.py
  (_last_rev):
    removed

  (view_directory):
    update call to pathrev_form

  (pathrev_form):
    find lastrev inside here instead of taking lastrev parameter
    call svn.last_rev instead of _last_rev
    make some other simplifications

  (redirect_pathrev):
    call svn.last_rev instead of _last_rev


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1181 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-10 19:03:24 +00:00
rey4
311d9ec761 Fix HEAD links on log page broken in r1150
* lib/viewcvs.py
  (Request.get_link):
    don't hide view parameters when other parameters are None. This
    fixes the HEAD annotate link

  (get_file_view_info):
    add pathrev argument

  (view_log):
    pass None as pathrev argument to get_file_view_info, that way the links
    point to HEAD instead of the current sticky tag


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1180 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-10 19:01:59 +00:00
rey4
9cb702c219 Prevent exception when jumping to a pathrev earlier than the revision
where the current path was added. This was the behavior in r1146 which
was changed in r1159

* lib/vclib/svn/__init__.py
  (last_rev):
    use alternate implemention when peg_revision > limit_revision


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1179 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-10 18:59:38 +00:00
rey4
2a6beda68b Fix bincvs co bug.
* lib/vclib/bincvs/__init__.py:
  (_re_co_side_branches):
    handle "no side branches present" error which seems to occur sometimes
    when you check out a branch tag.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1178 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-10 18:58:51 +00:00
rey4
f2d2d530f1 Revert portion of r1176 that stopped exposing the "prefer_markup" value
(formerly "viewable") to all templates. Even though the default templates
don't use these values, people might want to use them in custom templates.

* lib/viewcvs.py
  (get_file_view_info):
    add prefer_markup return value

  (nav_header_data):
    add "prefer_markup" template variable

  (view_directory):
     update call to get_file_view_info()

  (view_log):
     set "entry.prefer_markup" template variable
     set "prefer_markup" template variable
     set "tag_prefer_markup" template variable

* viewvc.org/template-authoring-guide.html
* viewvc.org/upgrading.html
    update docs


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1177 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-09 08:17:27 +00:00
rey4
754e9dbc30 Update template authoring guide and make template cleanups.
* lib/viewcvs.py
  (get_file_view_info):
    get rid of viewable return value

  (nav_header_data):
    get rid of "viewable" template variable

  (view_directory):
    rename "entries.viewable" variable to "entries.prefer_markup"
    rename "selection_form" variable to "search_re_form"
    rename "search_tag_action" variable to "search_action"
    rename "search_tag_hidden_values" variable to "search_re_hidden_values"

  (view_log):
    rename "entries.html_log" variable to "entries.log"
    restore value of "entries.next_main" variable to what it was in ViewCVS
      0.9.x
    get rid of "entries.viewable" template variable
    get rid of "viewable" template variable
    get rid of "tag_viewable" template variable

  (view_revision):
    rename "changes.filename" variable to "changes.path"
    rename "changes.base_path" variable to "changes.copy_path"
    rename "changes.base_rev" variable to "changes.copy_rev"

  (build_commit)
    rename "commits.desc" variable to "commits.log"
    get rid of "commits.rev_href" variable and replace with
      "commits.view_href", "commits.download_href", and
      "commits.prefer_markup"

* templates/include/dir_footer.ezt
* templates/include/file_header.ezt
* templates/dir_new.ezt
* templates/directory.ezt
* templates/log.ezt
* templates/log_table.ezt
* templates/query.ezt
* templates/query_results.ezt
* templates/revision.ezt
    update templates for changed variables

* CHANGES
    fix blurb about paging

* viewvc.org/upgrading.html
    update information about 0.9.x variables

* viewvc.org/template-authoring-guide.html
    fill it out


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1176 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-08 18:18:08 +00:00
cmpilato
e4f868ffdc * templates/include/diff_form.ezt
Restore the diff_select FORM's NAME attribute so the JavaScript
  stuffs work.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1175 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-07 19:07:01 +00:00
rey4
baafc550a9 Check in another directory listing template following discussion that
started at

  http://mailman.lyra.org/pipermail/viewcvs-dev/2005-November/002139.html

The major differences from directory.ezt are:

  - there is a new column of icons providing links to most other views

  - revision, date, author, and log message columns are merged into a
    single "Last Change" column which is more compact and easier to
    decipher when reading from left to right. The fact that you can't
    do things like sort by log message or read down the author column
    shouldn't be a problem because in the most cases, doing these things
    doesn't make any sense.

Ideally everybody will fall in love with this template, and we'll be able
to make it the default, release ViewVC 1.0, and put these old UI issues to
rest. Otherwise we can tweak and butcher this template until we agree that
its good enough to be the default, and move on from there.

* templates/dir_new.ezt
    new template file

* lib/viewcvs.py
   (sort_file_data):
     when sorting in reverse, leave directories at the top and files
     with no revision information at the bottom. Also make sorting by
     revision number the same as sorting by date in cvs.

   (view_directory):
     add "row.revision_href" links for directory entries

* templates/docroot/images/annotate.png
    new icon for annotate view. image is "stock_people.png" from gnome

* templates/docroot/images/download.png
    new icon for download view. image is
    http://www.gentoo-portage.com/img/download.png

* templates/docroot/images/list.png
    new icon for directory listings. image is "stock_view-details.png"
    from gnome

* templates/docroot/images/log.png
    new icon for log view. image is "stock_list_enum.png" from gnome

* templates/docroot/images/view.png
    new icon for markup view. image is "stock_show-all.png" from gnome

* templates/dir_alternate.ezt
    removed, nobody seems to like it


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1174 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-06 19:22:41 +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
80436a855c * lib/viewcvs.py
(_get_diff_paths_parts): Was _get_location.  This is a reversion of
    a changed accidentally committed in r1171.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1172 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-05 14:35:35 +00:00
cmpilato
74090cdc09 * viewvc/lib/viewcvs.py
(view_directory, redirect_pathrev, view_log): Only call _last_rev()
    when viewing a Subversion repository (per the assert in the
    function).
  (_get_location): Was _get_diff_paths_parts.  *** THIS CHANGE WAS A 
    MISTAKE, REVERTED IN r1172 ***

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1171 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-02 20:46:24 +00:00
cmpilato
3f03d0923e Some diff-related fixes.
* lib/vclib/bincvs/__init__.py
  (BinCVSRepository.rawdiff): Stop being so picky about the diff
    header sanity.  Start looser, and we'll tighten up as we need to.

* lib/vclib/__init__.py
  (_diff_fp.close): Add 'self' to the parameter list.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1170 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-22 16:32:59 +00:00
cmpilato
5f34e658fc * viewvc.org/index.html
Oops.  Missed a ViewCVS -> ViewVC in the title.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1169 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-17 15:00:15 +00:00
cmpilato
22a6e8b209 * templates/markup.ezt
Revert a change made in r1150, in which the markup template used the
  'viewable' data to avoid displaying binary files.  We'll let custom
  template writers do that if they wish, but will maintain our prior
  behavior.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1168 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-15 16:43:52 +00:00
cmpilato
4782355970 * viewcvs-install
Fix some code width and formatting issues throughout.
  (install_tree): Add '.svn' to the list of ignorable paths.

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1167 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-15 16:42:18 +00:00
cmpilato
5ca85cbf4d * viewcvs.sourceforge.net/contact.html
* viewcvs.sourceforge.net/contributing.html
* viewcvs.sourceforge.net/download.html
* viewcvs.sourceforge.net/images
* viewcvs.sourceforge.net/index.html
* viewcvs.sourceforge.net/license-1.html
* viewcvs.sourceforge.net/styles.css
* viewcvs.sourceforge.net/template-authoring-guide.html
* viewcvs.sourceforge.net/upgrading.html
* viewcvs.sourceforge.net/who.html
  Replace the whole of the SourceForge site...

* viewcvs.sourceforge.net/.htaccess
  ...with a simple redirect.  :-)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1166 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-15 06:40:29 +00:00
cmpilato
c3614949e8 I like the Perl dig, but let's be kind enough to use it as a reminder
of what can go wrong, not a cheap claim of what we somehow did right.

* viewvc.org/index.html
  Move the Perl slam from here...

* viewvc.org/contributing.html
  ...to here.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1165 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-15 06:21:47 +00:00
cmpilato
a192534c92 * viewvc.org/contact.html
* viewvc.org/contributing.html
* viewvc.org/download.html
* viewvc.org/index.html
* viewvc.org/license-1.html
* viewvc.org/upgrading.html
* viewvc.org/who.html
  Remove SourceForge logo and linkage.

* viewvc.org/styles.css
  Minor stylation tweaks.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1164 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-15 06:14:05 +00:00
cmpilato
373041996d Copy the old SourceForge site so it can be cleaned up
for use at viewvc.[com|net|org].

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1163 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-15 04:56:12 +00:00
cmpilato
db63df565e * tools/make-release
Update the release tool to work with the Subversion repsitory.

* viewcvs.sourceforge.net/contributing.html
  Update whole sections of this page (including the part that tells
  how to make use of the release tool) with post-migration information.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1162 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-12 07:06:54 +00:00
cmpilato
3c9b6d1869 Tigris.org likes to use '/trunk/www' for the project htdocs stuff.
This gives me a chance to finally rename the 'www' directory to
something more in line with other CGI programs I've seen.  And while
I'm here, and while we have Subversion, I might as well do many of the
reorgs I've been wanting to do for some time.

* www
  Renamed to...

* bin
  ...this.

* standalone.py,
* tools/make-database,
* tools/svndbadmin,
* tools/loginfo-handler,
* tools/cvsdbadmin
  Moved from here...

* bin/standalone.py,
* bin/make-database,
* bin/svndbadmin,
* bin/loginfo-handler,
* bin/cvsdbadmin
  ...to here.

* viewcvs-install
  Update locations of moved files.

* viewcvs.sourceforge.net/upgrading.html
  Tweak relevant documentation.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1161 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-12 06:15:20 +00:00
cmpilato
fc5ec817e5 Website tweaks to track project rename and relocation.
* viewcvs.sourceforge.net
  Renamed from...

* website
  ...here.

* viewcvs.sourceforge.net/who.html
* viewcvs.sourceforge.net/license-1.html
* viewcvs.sourceforge.net/upgrading.html
* viewcvs.sourceforge.net/download.html
* viewcvs.sourceforge.net/contributing.html
* viewcvs.sourceforge.net/index.html
* viewcvs.sourceforge.net/contact.html
  Update text to indicate new project name and location.  Historical
  and legal references to ViewCVS were left untouched -- not sure what
  to do about the legal ones just yet.

* viewcvs.sourceforge.net/images/title.xcf
  New Gimp multi-layer file, created from...

* viewcvs.sourceforge.net/images/title.psd
  ...the old PhotoShop file.  I didn't know Gimp could do that!!
  
* viewcvs.sourceforge.net/images/title.jpg
  Re-rasterize the title graphic with new "ViewVC"-bearing text.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1160 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-12 05:15:30 +00:00
cmpilato
4896268450 Re-add Russ Yanofsky's "last_rev" support, fine-tuned for performance
by myself.

NOTE: There are still some pool usage fixes to be made here.  Boy am I
looking forward to Subversion 1.3.0's (almost-)pool-free bindings...

* viewcvs/website/template-authoring-guide.html
  Restore definition of lastrev template item.

* viewcvs/templates/include/pathrev_form.ezt
  Expose the lastrev dictionary item.

* viewcvs/lib/vclib/svn/__init__.py
  (last_rev): New.

* viewcvs/lib/vclib/svn_ra/__init__.py
  (last_rev): New.

* viewcvs/lib/viewcvs.py
  (_last_rev): New wrapper around the svn provider's last_rev() functions.
  (pathrev_form, redirect_pathrev, view_log, view_directory): Use _last_rev().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1159 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-10 22:08:48 +00:00
cmpilato
6d792a94a9 * viewcvs/lib/vclib/svn/__init__.py
(get_revision_info): Pull the revision props directly instead of using
    the (buggy) ChangeCollector.get_root_props() interface.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1158 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-10 16:01:15 +00:00
cmpilato
41975fa847 * viewcvs/templates/revision.ezt
Move the log message into the metadata table (this has been bugging
  me for some time), and don't force the table to 100% width.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1157 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-10 15:52:11 +00:00
rey4
af70f41740 * templates/docroot/help_rootview.html:
fix HTML error caught by Greg Stein


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1156 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-09 16:06:09 +00:00
rey4
8aa47a94e9 More documentation updates
* templates/docroot/help_rootview.html
* templates/docroot/help_dirview.html
* templates/docroot/help_log.html
    updated

* templates/docroot/help_logtable.html
    removed


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1155 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-09 15:34:25 +00:00
rey4
8bba165888 Get diffs to work in the ccvs module (used when use_rcsparse is enabled),
using the system "diff" command like the svn and svn_ra modules. Factor
the diff code out of the svn and svn_ra modules so they can share
functionality with each other and ccvs. Thanks to C. Mike for getting me
to work on this.

* lib/vclib/__init__.py:
  (_diff_fp):
    new class, based on svn_ra.FileDiff, used by ccvs, svn, and svn_ra
    modules

* lib/vclib/ccvs/__init__.py
  (CCVSRepository.rawdiff):
    implement in terms of openfile, itemlog, and _diff_fp

* lib/vclib/svn_ra/__init__.py
  (FileDiff, do_diff, _escape_msvcrt_shell_command, _escape_msvcrt_shell_arg):
    removed

  (temp_checkout)
    new function

  (SubversionRepository.rawdiff):
    change implementation to use temp_checkout and _diff_fp

* lib/vclib/svn/__init__.py
  (do_diff):
    removed

  (temp_checkout):
    new function, based on code from subversion's fs.py

  (SubversionRepository.rawdiff
    change implementation to use temp_checkout and _diff_fp


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1154 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-09 15:29:56 +00:00
cmpilato
e5f784525f Built-in help touch-ups.
* viewcvs/templates/docroot/help.css
  Added (a file from a recent patch by Marten Thavenius <martent@gmail.com>
  which I inadvertently failed to version when applying the patch).

* viewcvs/templates/docroot/help_rootview.html
  Update names of Fogel's CVS book and my (et al) Subversion book.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1153 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-08 14:33:04 +00:00
rey4
78c66dff21 Documentation updates.
* CHANGES
    add changes since last time we were going to release 1.0

* templates/docroot/help_rootview.html
    add better overview of ViewCVS. a little dry but more useful than
    "Directory entries end in slashes" and other stuff that shouldn't have
    to be pointed out.

    also remove outdated information about ViewCVS Project and
    replace it with a link to viewcvs.sourceforge.net


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1152 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-08 12:21:15 +00:00
rey4
b0d6bf328e Restore the sometimes checkout, sometimes markup behavior for
file links in the directory listing templates. Also make other
minor cleanups.

* templates/directory.ezt
    restore the file links and make the alt attribute for the
    parent direcotry icon the same as for the other icons

* templates/dir_alt.ezt
    restore the file links and add title attributes to all links

* website/upgrading.html
    update documentation for 0.9's rows.rev_href variable

----------------------------------------------------------------------


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1151 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-07 08:51:48 +00:00
cmpilato
0eab479ca0 Make the various file-related views available from the directory and
log views on a per-entry/revision basis.  Template authors can choose
to ignore the 'viewable'-ness of an item if they choose.  In the
process, this makes the directory view always link to the markup view
for files (instead of sometimes doing markup, sometimes checkout).
Consistent, predictable UI, folks ...

* viewcvs/lib/viewcvs.py
  (get_file_view_info): New.
  (nav_header_data, view_directory, view_log): Use new get_file_view_info to
    populate file navigation links.

* viewcvs/templates/markup.ezt
  If a file isn't viewable, show a warning instead of the markup.

* viewcvs/website/upgrading.html
  Track changes in the data dictionary.

* viewcvs/website/template-authoring-guide.html
  Track changes in the data dictionary, and fill in a few blanks here
  and there.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1150 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-04 19:20:55 +00:00
cmpilato
811b660e86 Restore performance by removing extremely expensive Subversion history
crawl.  Also, gracefully redirect old non-HEAD directory views.

* viewcvs/lib/viewcvs.py
  (Request.run_viewcvs): Redirect old DIRECTORY?rev=REV URLs to
    DIRECTORY?pathrev=REV ones.
  (_last_rev): Removed.
  (pathrev_form, redirect_pathrev, view_log): Lose the "lastrev" stuff.

* viewcvs/templates/include/pathrev_form.ezt,
* viewcvs/website/template-authoring-guide.html
  Track the loss of "lastrev".


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1149 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-04 13:16:24 +00:00
rey4
7080f2c083 Fix error in CVS log view when file has default branch set.
* lib/viewcvs.py
  (view_log):
    fix call to prep_tags


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1148 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-04 05:46:08 +00:00
rey4
92057a3380 Reorganize and update template information in upgrade guide.
* website/upgrading.html
    put all information about 0.9 template variables in a big
    table sorted alphabetically by variable name. Table was
    generated from a little script which parsed the 0.9
    templates and extracted the names of all variables that
    they referenced, so the list is complete and accurate.
    The color scheme was generated by me, so the table is
    garish and maybe even ugly. Feel free to modify.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1147 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-03 13:36:14 +00:00
rey4
c002889dad Take some rough edges off the new sticky revision interface. Instead of
showing 404 errors when users try to jump to revisions where the path
being viewed doesn't exist, just redirect to the closest revision where
the path does exist.

Also, italicize the links which change the current 'pathrev' value
to make them stand out from links that stay within the current revision.

* lib/viewcvs.py
  (redirect_pathrev):
    new view that validates input from the pathrev form and redirects to
    the right revision

  (pathrev_form):
    new function that generates fields for pathrev form

  (_last_rev):
    new function for tracking subversion revisions

  (Request.run_viewcvs, Request.get_link, _legal_params, _views):
    add handling for redirect_pathrev view

  (Request.get_form):
    new function that wraps around get_link

  (view_directory, view_log):
    make use of new pathform_form and get_form functions

  (common_template_data, view_revision, view_queryform):
    make use of get_form function

  (view_directory, view_log):
    make use of pathrev_form

* templates/include/pathrev_form.ezt
    only show the "Clear" button when clearing won't cause a 404

* templates/annotate.ezt
* templates/log.ezt
* templates/log_table.ezt
* templates/markup.ezt
    italicize revision jumping links

* website/template-authoring-guide.html
    update


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1146 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-03 13:33:56 +00:00
rey4
01437d5937 New URL scheme for Subversion. The problem with the old scheme is it
doesn't have a concept of a "sticky" revision. So if you are looking
at version 10 of a directory, and click to view a file inside which
was last modified in version 6, the fact you were looking at version 10
of the parent directory is not recorded anywhere, and the "Parent Directory"
links on the markup page will take you to a version 6 directory listing
instead of the listing you came from. This problem exists all over
ViewCVS, not just in directory listings, and the result of it is that when
you browse a repository by following the provided links you get sent further
and further back into the history, all the while seeing incomplete log pages
and outdated directory listings which you never asked for.

The new URL scheme works by introducing a new 'pathrev' sticky variable and
is described in detail in a comment in the _orig_path function in
lib/viewcvs.py. The scheme is not backwards compatabile with all (or
maybe even most) old subversion URLs. Specifically, any old URL referring
to a path that no longer exists in the HEAD will not work. Other subversion
URLs will still work.

It is still possible to add backwards compatibility. We'd have to rename
the rev parameter to something else, so we could know that all URLs with
'rev' in them are old style URLs which need to be redirected. I don't know
if it's worth doing this though.

This is not an isolated change. I've tried to unite the Subversion "sticky
revision" with the present "only_with_tag" logic for CVS. And since I had
to go over viewcvs.py with a fine-toothed comb implementing these things,
there are also some miscellaneous cleanups there.

* lib/vclib/bincvs/__init__.py
  (_file_log):
    change filtering so when matching revisions to tag, includes all
    preceding revisions, not just tag revision itself

* lib/viewcvs.py
  (_sticky_vars):
    'only_with_tag' is gone, so change this back into a list with no
    span-roots values

  (request.run_viewcvs):
    read new 'pathrev' parameter and use it when calling repos.itemtype

  (request.get_link):
    add 'pathrev' parameter to urls, restore update _sticky_vars loop

  (_legal_params, prep_tags, build_commit):
    replace 'only_with_tag' with 'pathrev'

  (_orig_path):
    new function

  (nav_path, common_template_data):
    stop adding 'rev' parameters to links
    removed unused 'roots_href' template variable

  (nav_header_data):
    add new 'revision_href', 'orig_path', 'orig_href' template variables
    for use in markup and annotate views

  (view_markup, view_checkout, view_annotate, setup_diff, generate_tarball,
   download_tarball):
    use 'pathrev' when looking up file revision

  (view_directory):
    use 'pathrev' when looking up directory revisions instead of 'rev'.
    stop adding 'rev' to links.
    add template variables: pathrev, pathrev_action, pathrev_hidden_values.
    remove unused template variables: num_files, rev, view_tag, has_tags,
    main_href, jump_rev_action, jump_rev_hidden_values, row.show_log.

  (view_log):
    use 'pathrev' to retrieve log information instead of 'rev'.
    stop linking to original paths of copied files.
    add template variables: entry.orig_path, entry.orig_href, default_branch,
    pathrev, pathrev_action, pathrev_hidden_values, branch_tags, plain_tags.
    remove template variables: entry.filename, entry.prev_path,
    branch, path_selected, view_tag, branch_names, branch_select_action,
    branch_select_hidden_values.

  (view_cvsgraph):
    use common_template_data instead of nav_header_data, 'pathrev' instead
    of 'only_with tag'

  (view_diff):
    use common_template_data instead of nav_header_data
    add template variables: path_left, path_right

  (view_revision):
    use 'pathrev' instead of 'rev' in links

* templates/include/dir_header.ezt
    rearrange header and add sticky tag/revision row

* templates/include/dir_footer.ezt
    remove tag selector

* templates/include/pathrev_form.ezt
    new, sticky tag/revision selector form based on code from
    dir_footer.ezt

* templates/include/branch.ezt
* templates/include/branch_form.ezt
* templates/include/view_tag.ezt
    removed

* templates/include/log_header.ezt
    new, based on branch.ezt and view_tag.ezt

* templates/include/log_footer.ezt
    new

* templates/include/log.ezt
* templates/include/log_table.ezt
    include log_header.ezt and log_footer.ezt

* templates/include/annotate.ezt
* templates/include/diff.ezt
* templates/include/markup.ezt
    show original paths and add view_revision links

* cvsgraph.conf.dist
    replace only_with_tag parameter with pathrev

* website/template-authoring-guide.html
    update template variable information


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1145 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-03 13:31:02 +00:00
rey4
5204e26666 Change vclib interface to accept 'rev' parameters wherever it accepts
path parameters so it is possible to use a single Repository object
to request information about any path at any revision.

Note: I wasn't able to test the svn_ra.get_location function because
I only have subversion 1.2.3.

* lib/vclib/__init__.py
  (Repository.itemtype, Repository.openfile, Repository.listdir,
   Repository.dirlogs, Repository.itemlog, Repository.annotate):
    add rev arguments, update docstrings

* lib/vclib/bincvs/__init__.py
  (CVSRepository.itemtype, CVSRepository.listdir, BinCVSRepository.openfile,
   BinCVSRepository.dirlogs, BinCVSRepository.itemlog):
    same

* lib/vclib/ccvs/__init__.py
  (CCVSRepository.dirlogs, CCVSRepository.itemlog):
    same

* lib/vclib/svn/__init__.py
  (SubversionRepository.__init__):
    remove rev argument

  (get_location, created_rev, _get_history, get_revision_info, _fetch_log,
   _get_last_history_rev, get_logs, do_diff,
   SubversionRepository.itemtype, SubversionRepository.openfile,
   SubversionRepository.listdir, SubversionRepository.dirlogs,
   SubversionRepository.itemlog, SubversionRepository.annotate):
    add rev arguments, use new _getrev and _getroot functions to handle
    all revision string parsing and revision_root creation

  (SubversionRepository._getrev, SubversionRepository._getroot):
    new functions

* lib/vclib/svn_ra/__init__.py
  (_rev2optrev):
    accept integers instead of strings, and eliminate head/unspecified
    revision handling which is already taken care of by _getrev

  (SubversionRepository.__init__):
    remove rev argument

  (get_location, created_rev, get_revision_info, get_logs,
   SubversionRepository.itemtype, SubversionRepository.openfile,
   SubversionRepository.listdir, SubversionRepository.dirlogs,
   SubversionRepository.itemlog, SubversionRepository.annotate,
   SubversionRepository.rawdiff, SubversionRepository._get_dirents):
    add rev arguments, use new _getrev function to handle all revision
    string parsing

  (SubversionRepository._getrev):
    new function

* lib/blame.py
  (link_includes):
    update call to repos.itemtype

* tools/cvsdbadmin
  (RecurseUpdate):
    update call to repos.listdir

* lib/viewcvs.py
  (Request.run_viewcvs):
    update calls to SubversionRepository constructors and _strip_suffix

  (_strip_suffix):
    add rev parameter, remove redundant where parameter

  (_repos_pathtype, view_markup, search_files, _get_diff_path_parts,
   generate_tarball):
    update calls to vclib methods

  (nav_path, view_directory, view_log, setup_diff, download_tarball,
   view_revision):
    explicitly read 'rev' query param instead of relying on
    SubversionRepository.rev, and update vclib calls


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1144 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-03 13:23:42 +00:00
cmpilato
7787585540 * viewcvs/lib/viewcvs.py
(Request.get_link): Just some whitespace/formatting cleanups.  No
    logic changes.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1143 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-02 19:15:52 +00:00
cmpilato
9213450bc0 Some revision view cleanups.
* viewcvs/lib/viewcvs.py
  (view_revision): Fix the links generated for deleted items.

* viewcvs/lib/vclib/svn/__init__.py
  (_cleanup_path): New.
  (_trim_path): Remove.
  (_log_helper, NodeHistory.add_history): Use new _cleanup_path().
  (ChangedPathSet.add_change): Fix the detection of replaces-with-history.
    Also, use new _cleanup_path().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1142 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-02 19:13:07 +00:00
cmpilato
b6b1146a1c * viewcvs/lib/viewcvs.py
(view_directory): Oops!  Use make_time_string() to set entries.date
    to a string date representation, not "number of seconds since
    Epoch".


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1141 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-28 13:53:36 +00:00
cmpilato
721b99609b More data dictionary consistency tweaks.
* viewcvs/lib/viewcvs.py
  (view_directory): Lose the initialization of the unused entries.href
    (accidentally overlooked a previous purge).  Rename entries.type
    to entries.pathtype.
  (view_revision): Recycle changes.pathtype (which just happens to
    work because the vclib file/dir constants are the same as those
    used for our EZT exposure) instead of setting a second
    changes.type variable.

* templates/directory.ezt,
* templates/dir_alternate.ezt,
* viewcvs/website/upgrading.html
  Track renamed and dropped variables.

* viewcvs/website/template-authoring-guide.html
  Fill in more of the directory view stuff, tracking the renamed and
  dropped variables.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1140 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-26 21:00:24 +00:00
cmpilato
203faae2d0 Consistify the datestamp variables to just 'date' (the timestamp) and
'ago' (the string describing how long ago that timestamp was from
"now").

* viewcvs/lib/viewcvs.py
  (view_directory): Expose entries.date variable, and rename
    entries.time to entries.ago.

* viewcvs/templates/dir_alternate.ezt,
* viewcvs/templates/directory.ezt
  Track renamed entries.time variable.

* viewcvs/website/upgrading.html,
* viewcvs/website/template-authoring-guide.html
  Track changes to the data dictionary.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1139 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-26 19:40:42 +00:00
cmpilato
d36d230e75 * website/download.html
Add link to nightly snapshots.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1138 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-21 12:23:57 +00:00
cmpilato
010b3be03c Fix Bug #1332969 - small fix of markup warning on Repository Listing page
* viewcvs/templates/include/header.ezt
  Fix a markup warning which occurs when there's no nav_path.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1137 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-20 13:19:19 +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
8f79165d0c Move some logic that really UI-ish from the core code into the
templates.

* viewcvs/lib/viewcvs.py
  (view_log): Lose 'tr1' and 'tr2' dictionary items.

* viewcvs/templates/log.ezt,
* viewcvs/templates/log_table.ezt
  Calculate first and last revisions using EZT magic.

* viewcvs/templates/include/diff_form.ezt
  Choose default diff form values based on the 'rev_selected'
  dictionary item as well as the EZT-calculated first and last
  revisions.

* viewcvs/website/upgrading.html,
* viewcvs/website/template-authoring-guide.html
  Track removed variables, and add some missing punctuation.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1135 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-17 20:31:11 +00:00
cmpilato
2d37af8286 More template authoring guide; more dictionary tweaks as this exercise
points out more ugliness (which was its secondary goal, after all).

* viewcvs/lib/viewcvs.py
  (view_revision, view_markup, view_log): Use 'date' instead of
    'date_str' in data dictionary items.
  (view_directory): Use 'entries' instead of 'rows' in the data
    dictionary.  Remove redundant 'has_tags' dictionary init.

* viewcvs/templates/markup.ezt,
* viewcvs/templates/log.ezt,
* viewcvs/templates/revision.ezt,
* viewcvs/templates/log_table.ezt,
* templates/dir_alternate.ezt
* templates/directory.ezt
* viewcvs/website/upgrading.html
  Track variable renames.

* viewcvs/website/template-authoring-guide.html
  Track variable renames, and begin working on the directory view section.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1134 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-17 19:50:20 +00:00
cmpilato
1a7a0c0a77 * viewcvs/lib/viewcvs.py
(view_patch): Fix a little logic bug in the patch diff_format
    selector.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1133 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-14 21:51:07 +00:00
cmpilato
99da769f25 Lose the poorly thunk 'makepatch' checkbox on the diff form. There
are probably whole volumes written about similar UI decisions and how
unintuitive they are.  Instead, abstract that work in a new patch
view.

NOTE:  While the new patch view supports the diff_format input
parameter, no template links or forms make use of it.  The code will
default to unified diff unless told to use context diff via the CGI
params or runtime config.

* viewcvs/lib/viewcvs.py
  (_legal_params): Lose 'makepatch'.  It was a good idea with a poor
    implementation choice.
  (_views): Add new 'patch' view, and tweak the alignment of this
    definition a bit.
  (get_link): Always copy the params dictionary instead of tainting
    the input dictionary.
  (view_patch): New.  Was the "if makepatch" section of view_diff().
  (view_diff): Abstract some setup stuff into setup_diff(), and the
    makepatch stuff into view_patch().

* viewcvs/templates/diff.ezt
* viewcvs/templates/include/diff_form.ezt
  Lose the 'makepatch' form checkbox.

* viewcvs/templates/include/file_header.ezt
  Add a patch view link.

* viewcvs/templates/docroot/images/diff.png
  New.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1132 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-14 21:35:58 +00:00
cmpilato
46a3ee4888 * viewcvs/templates/templates/docroot/images/broken.png,
* viewcvs/templates/templates/docroot/images/text.png
  Fix some transparency-related oddities in these images.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1131 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-14 21:32:41 +00:00
cmpilato
043995ce16 Tweak the diff view data dictionary for consistency.
* viewcvs/lib/viewcvs.py
  (DiffSource._flush_row): Make the 'have_left' and 'have_right'
    members of the change object be EZT booleans.
  (DiffSource._get_row): Rename 'extra' member to 'line_info_extra'.
  (view_diff): Rename some data dictionary variables:
    'rev1' => 'rev_left'
    'rev2' => 'rev_right'
    'tag1' => 'tag_left'
    'tag2' => 'tag_right'
    'date1' => 'date_left'
    'date2' => 'date_right'

* viewcvs/templates/diff.ezt
  Track renamed variables.

* viewcvs/website/upgrading.html
  Note the slight tweak to the way 'have_left' and 'have_right' work,
  not that I expect anyone to have really been testing for "yes".
  Also, note the renamed variables.

* viewcvs/website/template-authoring-guide.html
  Populate the annotate, graph, and diff sections, tracking the
  tweaked variables.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1130 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-14 20:29:16 +00:00
cmpilato
2777f41d32 * website/template-authoring-guide.html
Add some left/right padding in table cells.  Also, populate the NAVDATA
  section.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1129 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-14 16:13:51 +00:00
cmpilato
f5ddba9443 Lose the unnecessary 'jump_rev' data dictionary item. It was used in
two views (directory and revision).  In the directory case, it was
renamed to just 'rev'; in the revision case, it was dropped as
redundant with with existing 'rev' variable.  Also, don't assume that
"is not a directory" implies "is a file" when looking at the common
'pathtype' variable.

* viewcvs/lib/viewcvs.py
  (common_template_data): Allow 'pathtype' to be None instead of
    'file' when the pathtype is neither a file nor a directory.
  (view_revision): Lose 'jump_rev'.
  (view_directory): Rename 'jump_rev' to just 'rev'.

* viewcvs/templates/revision.ezt
  Use 'rev' instead of 'jump_rev' throughout.

* viewcvs/templates/include/dir_header.ezt
  Stop using 'jump_rev' -- make 'youngest_rev' the default jump-to
  location.

* viewcvs/website/upgrading.html,
* viewcvs/website/template-authoring-guide.html
  Track the demise of 'jump_rev'.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1128 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-14 15:33:35 +00:00
cmpilato
9d39c14082 * website/template-authoring-guide.html
Populate the COMMON section.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1127 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-14 15:28:51 +00:00
cmpilato
1cf2b31004 * website/template-authoring-guide.html
Begin work on a template authoring guide.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1126 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-12 17:40:10 +00:00
cmpilato
df37902e41 * viewcvs/lib/vclib/svn/__init__.py
(get_revision_info): Wrap reads from the revision property hash with
    str() to ensure conversion from "buffer" type.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1125 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-11 16:59:34 +00:00
cmpilato
30f1537eb7 * viewcvs/templates/revision.ezt
Add a trailing slash to directory paths.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1124 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-11 16:58:11 +00:00
cmpilato
d9f6360681 Fix some bugs introduced yesterday that show up when using the
'svn_ra' module with the 'revision' view.

* viewcvs/lib/viewcvs.py
  (view_revision): Collapse some similar URL generation calls, but
    also trap the AssertionError thrown when using the 'svn_ra' backend
    (as it can't determine path types yet).

* viewcvs/lib/vclib/svn_ra/__init__.py
  (LastHistoryCollector.add_history): It's a long way from correct,
    but at least pass along copyfrom information correctly from this
    log handler.

* viewcvs/templates/revision.ezt
  Make the file/dir icons part of the filename links, too.  But don't
  make links where no valid hrefs exist.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1123 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-11 14:35:21 +00:00
cmpilato
997d65e926 Make some tweaks to the 'revision' view to differentiate between
'added' and 'replaced' items, and to make the fact that something was
or wasn't copied from elsewhere a first-class piece of data.

* viewcvs/lib/vclib/svn/__init__.py
  (_compare_paths): Move from the svn_ra module.
  (ChangedPath.__init__): Add 'is_copy' param, and stow it away.
  (ChangedPathSet): New.
  (get_revision_info): Use newer svn.repos.ChangeCollector() interface
    so we can hook the notification callback (using the new
    ChangedPathSet class) and get replacement information.

* viewcvs/lib/viewcvs.py
  (view_revision): Boolean-ify the new is_copy ChangedPath member.
    Expose change.log_href links to log views.
  (common_template_data): Expose log_href for Subversion directories.

* viewcvs/templates/docroot/styles.css
  (td, th, tr): Set vertical-align to 'top'.

* viewcvs/templates/revision.ezt
  Re-work this template into a different layout (still not happy it,
  but...)

* viewcvs/lib/vclib/svn_ra/__init__.py
  Import _compare_paths from the 'svn' module.
  (LastHistoryCollector.add_history): Tweak to recognize replaced
    items, and to pass the new 'is_copy' param to ChangedPath().
  (_compare_paths): Move to the 'svn' module.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1122 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-10 20:22:59 +00:00
cmpilato
ef9e91dd20 * viewcvs/lib/viewcvs.py
(DiffSource._get_row): Rename 'line1' and 'line2' 'change' members to
    'line_info_left' and 'line_info_right', respectively.

* viewcvs/templates/diff.ezt
  Track renamed template variables.

* viewcvs/website/upgrading.html
  Document renamed variables.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1121 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-10 14:10:48 +00:00
cmpilato
0be0bf1e9d * viewcvs/lib/viewcvs.py
(view_revision_svn): Remove.
  (view_revision): Eat up view_revision_svn's little bit o' work.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1120 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-10 13:38:58 +00:00
cmpilato
2e9593eff0 * viewcvs/lib/vclib/bincvs/__init__.py
(BinCVSRepository.rawdiff): Ignore warnings from rcsdiff.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1119 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-05 12:51:50 +00:00
cmpilato
2e13e6fd4c Expose regular-expression-based search to Subversion repositories, too.
* viewcvs/lib/viewcvs.py
  (view_directory): Set 'selection_form' and friends for 'svn'
    roottypes, too.

* viewcvs/lib/vclib/svn/__init__.py
  (FileContentsPipe.readline): Fix usage of core.svn_stream_readline().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1118 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-04 15:05:39 +00:00
cmpilato
8bdfd374a2 Sticky variables are cool and all (despite being less elegant than a
cookies-based implementation...), but there are some that simply
should stick when switching to a view of a different repository root
(such as only_with_tag).

* viewcvs/lib/viewcvs.py
  (_sticky_vars): Convert to a dictionary, and let the values
    associated with the sticky variables indicate whether that
    stickiness spans repository roots.
  (Request.get_link): Pay attention to the spanrootsedness of the
    sticky variables.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1117 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-04 15:01:08 +00:00
cmpilato
0506513760 Expose "tip o' the branch" links from the log view.
* viewcvs/lib/viewcvs.py
  (view_log): Add new template variables: 'tag_view_href',
    'tag_download_href', 'tag_download_text_href', 'tag_annotate_href',

* viewcvs/templates/include/view_tag.ezt
  Expose links to the tip of a currently selected branch.

* viewcvs/website/upgrading.html
  Document new variables.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1116 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-03 22:23:35 +00:00
cmpilato
54c1b4f760 Finish Bug #1309545 ("tip of the branch" URLs don't work with 'bincvs' module)
* viewcvs/lib/vclib/bincvs/__init__.py
  (COMalformedOutput, COMissingRevision): New exception classes.
  (BinCVSRepository._get_tip_revision): New helper.
  (BinCVSRepository.openfile): If a COMissingRevision exception is
    raised, use rlog to try to resolve to a real (existing) revision.
  (_parse_co_header): Stop writing HTML error messages, and use the
    new exceptions.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1115 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-03 20:57:12 +00:00
cmpilato
0881ded7c0 * templates/directory.ezt,
* templates/dir_alternate.ezt
  Lose unnecessary P tags which tend to oversize errorful rows.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1114 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-10-03 15:31:27 +00:00
cmpilato
73b347ee5d Finish Bug #1097695 - Exception on CVS revisions with 2-digit year
* viewcvs/lib/vclib/bincvs/__init__.py
  (_parse_log_entry): Ensure that revision years > 1970, as rlog seems
    only to assume they are > 1900.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1113 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-30 15:10:49 +00:00
cmpilato
a16f40e0ac * viewcvs/templates/directory.ezt
Lose the alt-text on the row icons, and restore View/download distinction
  in title attributes.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1112 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-29 13:42:32 +00:00
cmpilato
2a93244acb * viewcvs/lib/viewcvs.py
(view_query): Query on subdirectories of the request directories,
    too.  This is a followup to the changes made in revision 1.367.
    Thanks to Russell Yanofsky for noticing the mistake.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1111 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-29 13:28:38 +00:00
cmpilato
c85732a907 * viewcvs/lib/viewcvs.py
(nav_header_data, view_log): Expose annotation links for Subversion
    in a couple more places.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1110 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-28 19:27:55 +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
b629620cf6 Lose 'row.href' and 'row.rev_href' for the more meaningful
'row.log_href' and 'row.view_href'.

* viewcvs/lib/viewcvs.py
  (view_directory): For files, rename 'row.href' to 'row.log_href',
    and 'row.rev_href' to 'row.view_href'.  For directories, do the
    renames, but swap the mappings.

* viewcvs/templates/dir_alternate.ezt
* viewcvs/templates/directory.ezt
  Track the changes to these data dictionary items.

* viewcvs/website/upgrading.html
  Note the changed variables.  Also, add svn_path as a configuration
  parameter recently added.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1108 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-27 18:08:47 +00:00
cmpilato
4a24ab0c36 * viewcvs/lib/viewcvs.py
(common_template_data): Show a non-empty root listing when there is
    a non-empty list of roots, regardless of the size of that list.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1107 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-26 19:34:41 +00:00
cmpilato
701452a3fb Fix Bug #1177407: CVS tags with a slash cause an exception
* viewcvs/lib/viewcvs.py
  (_re_validate_number): Allow '/' in tag names.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1106 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-26 18:57:32 +00:00
cmpilato
577728db86 Fix Bug 1271136: Query results wrong for directories with similar
names

* viewcvs/lib/viewcvs.py
  (view_query): Use "exact" matches for the query directory, instead
    of "like" ones.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1105 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-26 17:14:42 +00:00
cmpilato
1b967b1a09 * viewcvs/lib/vclib/__init__.py (Repository.rawdiff),
* viewcvs/lib/vclib/svn/__init__.py (SubversionRepository.rawdiff),
* viewcvs/lib/vclib/svn_ra/__init__.py (SubversionRepository.rawdiff),
* viewcvs/lib/vclib/ccvs/__init__.py (CCVSRepository.rawdiff),
* viewcvs/lib/vclib/bincvs/__init__.py (BinCVSRepository.rawdiff):
  For clarity, replace uses of the term 'path' with 'path_parts' in the
  Repository.rawdiff() stub and implementations.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1104 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-26 16:07:17 +00:00
cmpilato
d7429e31ae Add Subversion blame support to the 'svn_ra' module, and re-enable the
'svn' module's blame support with a non-streamy kludge.

* viewcvs/lib/vclib/svn_ra/__init__.py
  (SubversionRepository.annotate): Implement (for real).
  (_item): New, copied from one of a thousand places...

* viewcvs/lib/vclib/svn/__init__.py
  (BlameSourceKludge): New, non-streamy form of the Subversion blame factory.
  (SubversionRepository.annotate): Use BlameSourceKludge here.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1103 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-26 15:57:57 +00:00
cmpilato
30c3fbef04 * viewcvs/lib/vclib/svn/__init__.py
(BlameSource.__getitem__): Ensure initialization of prev_rev.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1102 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-24 20:05:30 +00:00
cmpilato
edd45cb153 * viewcvs/lib/vclib/svn/__init__.py
(SubversionRepository.annotate): Re-disable temporarily.  Something's
    wrong.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1101 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-23 21:08:56 +00:00
cmpilato
ac88e349ca Expose annotation support for local Subversion repositories. Patch
largely by Stefan Haller <haller@ableton.com>, at least in the
approach used.

* viewcvs/viewcvs.conf.dist
  (svn_path): New configuration variable.

* viewcvs/lib/config.py
  (Config.set_defaults): Populate a new svn_path config member.

* viewcvs/lib/viewcvs.py
  (Request.__init__): Tweak the way Subversion's vclib.Repository
    objects are opened to have different codepaths for the 'svn' and
    'svn_ra' modules, and pass the new cfg.general.svn_path option to
    the 'svn' module's SubversionRepository.

* viewcvs/lib/vclib/svn/__init__.py
  (BlameSource, BlameSequencingError, _item): New.
  (SubversionRepository.__init__): Add 'svn_path' parameter.
    Calculate and store a path for the 'svn' command-line client binary.
  (SubversionRepository.annotate): Really implement annotation.

* viewcvs/templates/log.ezt,
* viewcvs/templates/log_table.ezt
  Enable annotate links for Subversion, too!


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1100 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-23 20:15:08 +00:00
cmpilato
a5ad1e5f41 * viewcvs/lib/blame
(link_includes): Use the more generic itemtype() interface instead of
    the rcsfile() one.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1099 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-23 19:40:29 +00:00
cmpilato
828ee07077 Abstract the annotate interface by moving core functionality down
into the vclib providers.

* viewcvs/lib/vclib/__init__.py
  (Repository.annotate): New interface.

* viewcvs/lib/vclib/ccvs/blame.py
  New file, with contents cored from viewcvs/lib/blame.py, and
  reworked a little bit to avoid data tainting, and to be independent
  of the vclib implementation.

* viewcvs/lib/vclib/ccvs/__init__.py
  (CCVSRepository.annotate): Implement Repository.annotate() by returning
    a blame.BlameSource object.

* viewcvs/lib/vclib/bincvs/__init__.py
  (BinCVSRepository.annotate) Implement by returning a
    vclib.ccvs.blame.BlameSource object.

* viewcvs/lib/vclib/svn/__init__.py
* viewcvs/lib/vclib/svn_ra/__init__.py
  (SubversionRepository.annotate): New.  Return NotImplementedError.

* viewcvs/lib/viewcvs.py
  (view_annotate): Use new blame.blame() function.

* viewcvs/lib/blame.py
  Gut this sucker, moving most of the heavy lifting into the ccvs module.
  (HTMLBlameSource): New wrapper for BlameSource objects to handle
    HTML-izing and such.
  (blame): New function, thin wrapper around
  (make_html): Remove unused 'sticky' param.  Tweak to use new
    abstracted interface, but at the cost of diff_url support.  I'll
    probably come back to this (by adding a --diff-url option), but
    does anyone really care?


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1098 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-23 18:51:35 +00:00
cmpilato
034a661704 * viewcvs/INSTALL
Rework the list the required software-n-stuff.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1097 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-23 13:48:36 +00:00
cmpilato
dcf43ad7b8 Teach ViewCVS to obey the Subversion location tracing algorithm, which
identifies a line of history using a path and a "peg revision", and
then traces that line of history to figure out the object's current
path as of other revisions fed to the algorithm.

Previously, if I had a Subversion file that had been renamed a few
times (so, had multiple distinct paths over time), and I wanted to
diff between revisions at which the object's path was different, as
well as different from its path as of HEAD, the URL was this
monstrously long thing:

   http://.../viewcvs/path/to/file?p1=/old/path/of/file&r1=X&p2=/another/old/path/of/file&r2=Y

Now, it's simply:

   http://.../viewcvs/path/to/file?r1=X&r2=Y

Support for p1 and p2 are still present (so you can diff across
arbitrary paths in Subversion), but URLs generated by ViewCVS will no
longer use those query params.

* viewcvs/lib/viewcvs.py
  (view_log): Lose the use of p1 and p2 in diff URLs.
  (_get_diff_path_parts): New helper function.
  (view_diff): Teach ViewCVS to obey the Subversion location tracing
    algorithm by using the new _get_diff_path_parts() helper.

* viewcvs/lib/vclib/svn/__init__.py
  Require Subversion 1.1.0 or better.
  (_allow_all, get_location): New.

* viewcvs/lib/vclib/svn_ra/__init__.py
  Require Subversion 1.3.0 or better.
  (get_location): New.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1096 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-23 13:47:53 +00:00
cmpilato
70c4a29059 * viewcvs/lib/compat.py
Revert revision 1.18.  The Way of Russell is Enlightenment.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1095 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-23 11:22:30 +00:00
cmpilato
88ac9dd646 * viewcvs/lib/vclib/__init__.py
(InvalidRevision.__init__): Make the revision argument optional, and
    fix the exception strings up a bit.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1094 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-22 22:03:55 +00:00
cmpilato
0579698762 * viewcvs/lib/compat.py
(compare_versions): New.  (To be used in a future commit by
    Subversion vclib layers.)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1093 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-22 20:37:23 +00:00
cmpilato
d19322a7c5 * viewcvs/lib/vclib/svn_ra/__init__.py
(LogCollector.add_log): Fix a bug in the rename tracing algorithm which
    was triggered whenever a path's parent was copied, and the path's
    copied location was edited, in the same revision.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1092 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-21 19:53:29 +00:00
cmpilato
1b2dc4efa3 Consistify the output of the vclib diff engines, sticking with GNU
diff format.  This also has the effect of simplifying the wrapping
code (which wasn't working anyway) a little bit.  Also, restore
functionality lost in the last re-org of the diff functionality
(svn_ra).  Finally, make the vclib.ccvs module's lack of diff
functionality a little more apparent to those who attempt to use it.

* viewcvs/lib/vclib/__init__.py
  (Repository.rawdiff): Specify that returned diffs are expected to be
    in GNU diff format.

* viewcvs/lib/vclib/bincvs/__init__.py
  (BinCVSRepository.rawdiff): Eat up the rcsdiff header lines, not
    exposing them to the caller.  The goal is to expose consistent
    diff output across vclib providers, so we'll shoot for GNU diff
    compliance.

* viewcvs/lib/vclib/ccvs/__init__.py
  (CCVSRepository.rawdiff): Implement this interface, though only to
    raise an exception about how the functionality isn't implemented.

* viewcvs/lib/vclib/svn_ra/__init__.py
  (do_diff): Sync with vclib.svn.do_diff().
  (SubversionRepository.rawdiff): Implement this interface.

* viewcvs/lib/viewcvs.py
  (diff_parse_headers): Lose the 'rootpath' argument.  We've tuned the
    vclib providers to stop exposing that stuff.
  (view_diff): Update calls to diff_parse_headers().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1091 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-20 15:06:52 +00:00
pefu
adbaa3d909 Fixed SF-Bug # 1192503: Updated broken link to competing project cvsweb
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1090 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-13 22:04:24 +00:00
rey4
42955196e8 Pass strings and callbacks to EZT instead of so many pseudo file objects.
* lib/viewcvs.py
  (MarkupBuffer):
    remove, not used anymore and StringIO is always there if we need it

  (MarkupPipeWrapper):
    make into a one-shot callback instead of going though contortions to
    support repeated read() calls

  (MarkupEnscript.__init__):
    add unrelated comment

  (markup_stream_python, view_markup):
    no need to wrap strings in MarkupBuffers, ezt supports strings too


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1089 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-08-24 05:22:59 +00:00
rey4
f236e63a43 Various improvements to EZT
- make substitution pattern implementation to use current format instead
    of writing directly to output

  - make it possible to pass python functions to ezt templates as simple
    callbacks

  - update documentation with information about callbacks, file pointers,
    and the [format] directive

* lib/ezt.py
  (__doc__):
    update documentation

  (_write_value):
    add code to implement callbacks and substitution patterns

  (Template._parse, Template._cmd_print, Templte._cmd_print_html):
    update to work with changed _write_value function

  (Template._cmd_subst):
    removed, functionality moved into _write_value


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1088 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-08-24 05:10:45 +00:00
rey4
883e9a98bb Simplify diff code somewhat
* lib/viewcvs.py
  (diff_parse_headers, human_readable_diff, raw_diff):
    merge raw_diff and human_readable_diff into new
    diff_parse_headers function

  (view_diff):
    call diff_parse_headers


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1087 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-08-24 05:01:56 +00:00
rey4
7cdebbaf24 Move some diff functionality into vclib
* lib/vclib/__init__.py
  (Repository.rawdiff, UNIFIED, CONTEXT, SIDE_BY_SIDE, _diff_args):
    new

* lib/vclib/bincvs/__init__.py
  (Repository.rawdiff):
    new

* lib/vclib/svn/__init__.py
  (Repository.rawdiff):
    new

  (do_diff):
    move code that fixes diff headers here

* lib/viewcvs.py
  (_path_parts):
    new function to break a repository path into parts

  (Request.run_viewcvs):
    use _path_parts function

  (view_diff):
    use new Repository.rawdiff methods and _path_parts


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1086 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-08-22 20:07:02 +00:00
rey4
cbc95d7617 Fix check for forbidden paths on tarball download and simplify
generate_tarball function.

* lib/viewcvs.py
  (download_tarball):
    get rid of overly broad check for forbidden paths which would 404 on
    tarballs of all directories with forbidden names instead of just top
    level directories with forbidden names.

  (generate_tarball):
    get rid of tar_top and rep_top arguments

    get rid of default value for stack argument, which is likely to cause
    problems in multithreaded environments like mod_python

    reorganize and add comments


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1085 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-08-22 19:33:18 +00:00
cmpilato
12d28a5509 Sooth pain felt by Daniel Berlin <dberlin@dberlin.org>, who complained
that navigation to a Subversion resource no longer in HEAD (or in a
directory no longer in HEAD) caused generated parent directory links
which 404'ed.

* viewcvs/lib/viewcvs.py
  (nav_path, common_template_data): When generating navigational links
    for Subversion repositories, if the current page was a request
    with an associated explicit revision number, use that revision
    number in references to parent directory views and "other" views
    of the file.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1084 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-08-22 18:52:06 +00:00
rey4
c2c60e243d Fix exception when cvsdbadmin is passed only one argument
* tools/cvsdbadmin
  (global code)
    make sure script has 2 arguments


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1083 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-08-22 18:51:54 +00:00
rey4
6c90233f4e Tighten up some logic in cvs revision number functions. I think the first
change might fix an rare exeception someplace, but these changes been sitting
in my working copy for a couple of months and I don't remember.

* lib/vclib/bincvs/__init__.py
  (_match_revs_tags):
    when iterating over trunk revisions, don't assume that a non-empty history
    array means there is a valid previous revision, always check the "prev"
    value explicity. It could be None now that _match_revs_tags accepts
    incomplete lists of revisions (as of rev 1.47)

  (_add_tag):
    remove redundant check for None revisions


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1082 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-08-22 18:49:47 +00:00
rey4
5d0396e4c7 Restore viewcvs's ability to run under python 1.5
* lib/vclib/bincvs/__init__.py
  (BinCVSRepository.rcs_popen):
    convert tuples to lists before passing to list.extend

* lib/compat.py
  (formatdate):
    cut n' paste of rfc822.formatdate()

* lib/popen.py
  (popen):
    don't use string "find" method

* lib/viewcvs.py
  (Request.get_link):
    don't use dictionary "setdefault" method

  (check_freshness):
    don't use rfc822.formatdate()

* lib/win32popen.py
  (CommandLine, MakePrivateHandle, MakeInheritedHandle):
    don't use +=, |= operators

  (File2FileObject):
    don't use string "find" methods

  (SpoolWorker):
    don't use print >> syntax


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1081 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-08-22 18:41:59 +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
26d6fdb439 * viewcvs/CHANGES
Forward port entries from the 0.9.x branch.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1079 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-08-17 21:20:51 +00:00
cmpilato
bf4e37d54e * viewcvs/website/download.html
Update links to downloadable versions.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1078 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-08-17 21:17:14 +00:00
cmpilato
5df9a282b0 Make svndbadmin run to completion on the Subversion source code
repository, which it previously failed to do because of poor change
handling.  Also, stop it from Aborting at the end of every run due to
double-freeing of memory.

* viewcvs/tools/svndbadmin
  (SvnRepo.__init__): No longer keep self.pool around, and certainly
    don't close it on __del__() -- that's what the svn.core.run_app()
    wrapper framework is for.
  (_get_diff_counts): Just accept a diff file pointer object as input,
    and let the caller generate such a thing and pass it in.
  (SvnRev.__init__): Make use of the change item's base_path and
    base_rev to get accurate locations against which to diff.  Update
    calls to _get_diff_counts(), and make use of a new revision root
    cache.
  (SvnRev._get_root_for_rev): New revision root caching helper.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1074 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-08-09 03:22:50 +00:00
cmpilato
d1b71817d7 * viewcvs/lib/viewcvs.py
(generate_tarball, Request.run_viewcvs): Use '404 Not Found' instead
    of '403 Forbidden' for forbidden paths.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1073 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-05-17 16:08:34 +00:00
cmpilato
f1657e2c34 Fix copy-n-pasto in CHANGES file.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1071 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-05-17 07:58:52 +00:00
cmpilato
2c0181d625 Merge in CHANGES from 0.9.3 release.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1070 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-05-17 07:28:32 +00:00
cmpilato
2a75e75d23 Tweak website to point to new 0.9.3 release.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1069 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-05-17 07:12:53 +00:00
cmpilato
27ad9a4f9d * lib/viewcvs.py
(download_tarball): Throw a 403 Forbidden area if a tarball request
    is for a forbidden module.  Patch by Olaf Hering <olh@suse.de>.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1065 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-05-17 05:30:27 +00:00
cmpilato
6eeaf2be2b * lib/vclib/svn/__init__.py
(SubversionRepository.__init__): Catch (and ignore) a ValueError
    exception thrown by signal.signal.  It's probably the situation
    described in this email:
    http://mailman.lyra.org/pipermail/viewcvs/2005q1/003357.html


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1064 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-05-08 04:46:58 +00:00
dionisos
cefd17b78e Stricter input checking: throw an exception when not expecting EOF yet.
* tparse/tparse.h, tparse/tparse.cpp: Add 'allow_eof' parameter to
  TokenStream::get() and adjust callers.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1063 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-05-01 16:05:26 +00:00
dionisos
c3a80705ba * tparse/tparse.cpp (parse_rcs_admin): Allow 'symbol<space>:<space>revnum'
as recently added to the python modules.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1062 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-05-01 15:00:26 +00:00
dionisos
a9f8e7a802 * tparse/tparse.h: Fix 2 warnings revealed by gcc -Wall.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1061 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-05-01 13:58:06 +00:00
dionisos
55889fd691 Exception usage cleanup. Use exceptions to terminate the parser in all cases.
Also protect pointers with auto_ptr to ensure cleanup.

Note: Before this change exceptions *could* occur, but all pointer-referenced
memory would be leaked.

* tparse/tparse.h: Change #include-s to C++ names.
  (RCSParseError):  Change to be a public descendant of exception. Use
  string datatype to ensure automatic cleanup. Implement a destructor
  as required by exception.
  (RCSExpected):  Use string datatype to ensure automatic cleanup. Add
  constructor for expected characters.
  (Branche): Removed.  Replaced with std::list<>.
  (Sink): Change method definition to reflect switch to exceptions.
  (TokenParser::match):  Add method for matching characters.
  (TokenParser::semicol, TokenParser::matchsemicol): Removed.
  Obsolete because we're now able to match single characters.
  (tparseParser):  Change method definition to reflect the switch
  to exceptions.
  (tparseParser::parse):  Adapt to changed method definitions.

* tparse/tparse.cpp: Change #include-s to C++ names.
  (TokenParser::get): Space changes and conversion to auto_ptr.
  (tparseParser::parse_rcs_admin,
   tparseParser::parse_rcs_description,
   tparseParser::parse_rcs_deltatext): Conversion to auto_ptr and exceptions.
  (tparseParser::parse_rcs_tree): Conversion to auto_ptr and exceptions. Also
  adjust for removal of Branche class.

* tparse/tparsemodule.h:  Include Python.h, since
  we,re actually using python types.

* tparse/tparsemodule.cpp (pyobject, pystring):
  New classes.  Used to anchor python objects ensuring their refcounts
  are decremented.
  (chkpy):  New.  Function to check python return value and act appropriately.
  (initparse):  Correctly anchor python strings.
  (rcstoken_to_pystring):  Removed.  Now integrated into the pystring class.
  (PythonSink):  Claim ownership for the duration of the instance lifetime.
  Also adjust all methods for the switch to exceptions.
  (tparse):  Adapt to the switch to exceptions.  Also prevent memory leakage
  when an exception occurs.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1060 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-05-01 13:56:23 +00:00
dionisos
cab7c9ae04 Fix problems parsing files with 0 (nul) characters in them (typically
binary files).

At the same time reduce processing time by ~50% (in my measurements).


* tparse/tparse.h: Remove deprecated (and now unused) strstream header.
  (rcstoken): New class. Used to hold parser output.
  (Branche, Sink, TokenParser): Use rcstoken class whereever char* was
  used for holding parser output.

* tparse/tparse.cpp (rcstoken::init, rcstoken::append,
  rcstoken::grow,rcstoken::copy_begin_end, rcstoken::copy_begin_len): New.
  (TokenParser::get): Change return type to rcstoken and adapt accordingly.
  (TokenParser::unget): Change argument type.
  (tparseParser::parse_rcs_admin,tparseParser::parse_rcs_tree,
   tparseParser::parse_rcs_description,
   tparseParser::parse_rcs_deltatext): Adjust to use rcstoken class.

* tparse/tparsemodule.cpp (rcstoken_to_pystring): New. Helper function
  to do token to python string transformation.
  (PythonSink): Adjust all methods to use the rcstoken class.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1059 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-04-30 19:09:19 +00:00
dionisos
700b9eb7ad Use 'const char *' type for exception arguments.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1058 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-04-30 13:23:42 +00:00
dionisos
4038b9fe96 Eliminate compile warning.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1057 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-04-30 12:06:31 +00:00
cmpilato
543de7e0f7 Fix Bug #1181208.
* lib/viewcvs.py
  (raw_diff): Rootpath only shows up in Subversion diffs, not CVS.  So
    look for headers in a slightly less demanding way, replacing the
    rootpath if it appears, but certainly not caching the whole diff
    in memory if it doesn't.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1056 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-04-18 23:35:37 +00:00
cmpilato
c6cef2c309 Remove this patch. mailer.py (in Subversion /trunk) can now do ViewCVS diff
URLs.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1055 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-04-15 16:03:22 +00:00
cmpilato
7e563d0746 Minor code cleanups.
* lib/viewcvs.py
  (view_diff): Little comment fix.

* lib/vclib/svn_ra/__init__.py
  (ChangedPath): Remove; use the one from vclib.svn.

* lib/ezt.py
  Update to latest upstream version, but reapply "the LongType fix".


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1054 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-04-12 17:00:56 +00:00
cmpilato
2ab8c50dd7 Lose some duplicated code.
* lib/vclib/svn_ra/__init__.py
  (_datestr_to_date): Remove, and pull in the one from vclib.svn instead.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1053 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-04-12 02:43:34 +00:00
cmpilato
949c6a196d Some fixes to the 'diff' view.
While this would appear to fix the problems Aaron Craven
<viewcvs@vickerscraven.net> has been seeing with respect to HTML
escaping levels of diff output, this is a fluke.  A real problem (not
addressed here) is that raw_diff() is that basically, any time
raw_diff() is called with 'parseheader' set, it is treating the whole
diff output as headers (the early outs aren't firing).  This is
broken, and rather defeats the point of attempting streamy diffs since
we're collecting the whole thing into an array in memory.

* lib/viewcvs.py
  (raw_diff): Don't forget to htmlize() headers if so requested.
  (view_diff): Use 'unidiff' as the diff format choice if asked to
    make a patch for 'side-by-side' mode.  'Unidiff' and 'context
    diff' are the only valid patch formats, as far as we are
    concerned.  Also, fix a little comment typo.  Finally, revert my
    previous change, where I added an extra MarkupPipeWrapper around
    the file object returned from raw_diff() -- this was bogus, as
    raw_diff() should have been htmlifying stuff anyway.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1052 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-04-12 01:37:28 +00:00
cmpilato
5fb004046a Fix a bug which caused context and unidiff output to not be properly
htmlize()'d.  Reported (with patience, thankfully) by Aaron Craven
<viewcvs@vickerscraven.net>

* lib/viewcvs.py
  (view_diff): Wrap the raw diff FP object with an htmlize()ing class.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1051 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-04-11 04:57:37 +00:00
cmpilato
4bfb7f1354 Rename Repository.filelog() to Repository.itemlog() (Subversion
supports logs on directories, too, ya know).  And make some other
little documentation changes.

* viewcvs/lib/vclib/__init__.py
  (Repository.itemlog): Was Repository.filelog().
  (Revision.__init__): Document the input parameters.

* viewcvs/lib/vclib/bincvs/__init__.py
  (BinCVSRepository.itemlog): Was BinCVSRepository.filelog().

* viewcvs/lib/vclib/ccvs/__init__.py
  (CCVSRepository.itemlog): Was CCVSRepository.filelog().

* viewcvs/lib/vclib/svn/__init__.py
  (SubversionRepository.itemlog): Was SubversionRepository.filelog().

* viewcvs/lib/vclib/svn_ra/__init__.py
  (SubversionRepository.itemlog): Was SubversionRepository.filelog().

* viewcvs/lib/viewcvs.py
  (view_markup, view_log): Update calls to Repository.itemlog() (from
    Repository.filelog()).

* viewcvs/lib/cvsdb.py
  (GetCommitListFromRCSFile): Update calls to Repository.itemlog()
    (from Repository.filelog()).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1050 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-04-08 22:57:02 +00:00
cmpilato
0738697d61 Fix an annotate bug reported by Amy Langenhorst <Amy.Langenhorst@noaa.gov>.
* lib/blame.py
  (CVSParser.is_branch): Tighten up regular expression with '^'/'$'.
    Revisions like "11.0.2.2.0.1" were matching not with groups
    "11.0.2.2" and "1", but with "11" and "2.2.0.1".


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1049 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-04-08 22:55:58 +00:00
cmpilato
f7e15a4b8e * lib/viewcvs.py
(view_log): Fix a bug where use of the diff form via branch
    selection resulted in a log view instead of a diff view.  Reported
    by Amy Langenhorst <arl@noaa.gov>.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1048 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-04-04 19:02:23 +00:00
cmpilato
874e0be23b Sorta kinda revert my changes from Feb. 1 2005, wherein I stopped
grouping directories in the directory view.  Now, make that behavior
optional (though, the default), but also fix it so that the directory
group itself is internally sorted by the current sort key.  This more
accurately mimics the likes of the Windows Explorer.

* viewcvs/viewcvs.conf.dist
  (sort_group_dirs): New option.

* viewcvs/lib/config.py
  (Config.set_defaults): Set default value for sort_group_dirs.

* viewcvs/lib/viewcvs.py
  (file_sort_cmp): If grouping directories, sorts dirs higher than
    files.  Otherwise, use normal sorting rules.

* viewcvs/website/upgrading.html
  Note the new option.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1047 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-03-07 15:13:23 +00:00
cmpilato
bbd4c762cb * templates/docroot/images/broken.png
* templates/docroot/images/cvsgraph_16x16.png
* templates/docroot/images/cvsgraph_32x32.png
  More PNG background fixes from Jordan Russell <jr-list-2005@quo.to>.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1046 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-03-01 20:25:52 +00:00
cmpilato
b1d10a7f96 Jordan Russell <jr-list-2005@quo.to> was kind enough to rework some of
PNG files to have white backgrounds so that wussie browsers that don't
support PNG transparency (like Internet Explorer) can deal with them.

* templates/docroot/images/back_small.png
* templates/docroot/images/logo.png
* templates/docroot/images/text.png
  Tweaked.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1045 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-28 15:54:15 +00:00
cmpilato
6355639d08 Provide the Subversion youngest revision, and a link to it, to the
directory view.  This is pretty common request, the most recent by
Sergio Rua <srua@plus.net>.

* viewcvs/lib/vclib/svn_ra/__init__.py
  (get_youngest_revision): New.

* viewcvs/lib/vclib/svn/__init__.py
  (get_youngest_revision): New.

* viewcvs/lib/viewcvs.py
  (view_directory): Re-organize some data dictionary stuffing (I
    really wish that *all* data dictionary parameters were initialized
    at the head of each view function so we can see a canonical list
    of those params, but maybe another day...).  Also, for 'svn'
    roottypes, populate a new 'youngest_rev' and 'youngest_rev_href'
    dictionary items.

* viewcvs/website/upgrading.html
  Document the new 'youngest_rev' and 'youngest_rev_href' template keys.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1044 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-28 15:40:08 +00:00
cmpilato
ad0bc5c421 * viewcvs/templates/markup.ezt
This template was on crack.  The absence of a revision log was
  enough to turn of the display of almost all of the other interesting
  data, and turn on the display of data that was in one half redundant,
  and in the other half non-existant.  Good Lord...


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1043 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-25 15:59:20 +00:00
cmpilato
329a9edab4 * viewcvs/lib/viewcvs.py
(enscript_extensions): Add '.cs', '.bas', and '.cls' extensions,
    mapping to 'csharp', 'vba', and 'vba', respectivelyly, at the
    request of Bo Berglund <bo.berglund@telia.com> and Hern��n Mart��nez
    Foffani <hernan@orgmf.com.ar>.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1042 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-22 15:09:09 +00:00
dionisos
81aaaab615 * tparse/tparse.cpp (parse_rcs_tree): Don't special case non-special case.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1041 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-20 13:15:25 +00:00
dionisos
ec41758e2e Stop passing ownership of parameters into the sink.
* tparse/tparsemodule.cpp: Stop freeing parameters passed into the sink.

* tparse/tparse.cpp: Dispose of allocated memory after use.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1040 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-20 13:03:02 +00:00
dionisos
0acab473b2 Add .cvsignore file to ignore 'build/' output directory.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1039 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-20 12:36:53 +00:00
cmpilato
f723597546 Now that Subversion's RA layer has a pleasant API (instead of a nasty
vtable structure), update the ViewCVS 'svn_ra' module to use it.  This
module now almost has total functional parity with the 'svn' module.

* viewcvs/lib/vclib/svn_ra/__init__.py
  Import the svn.ra module.
  (date_from_rev, created_rev): Actually flesh out these functions
    using the new RA capabilities.
  (LastHistoryCollector.add_history): Remove leading slashes from
    paths used to make ChangedPath items.
  (either_binary): Leave a TODO, with some optimization ideas.
  (SubversionRepository.__init__): Use the RA interface to fetch the
    youngest revision instead of a really kludgy (and more expensive)
    algorithm based on dirents.
  (FileDiff.get_files, SubversionRepository.openfile): Fixup the use
    of streams.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1038 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-17 19:01:46 +00:00
rey4
66cdbe31e7 Support relative images and links in checked out HTML pages when
checkout_magic is disabled by changing the default view for file URLs from
"log" to "checkout"

This causes some URL compatibility to be lost when checkout_magic is disabled.
Bookmarks which pointed to log pages but don't have explicit view=log
parameters will point to checkout pages instead.

* lib/viewcvs.py
  (Request.run_viewcvs):
    change default view for files from "log" to "checkout" when checkout_magic
    is disabled

  (Request.get_link):
    don't add explicit view=checkout parameters for checkout links when
    checkout_magic is disabled

    don't drop explicit view=log parameters for log links

* website/upgrading.html
    add note about URL compatibility

* INSTALL
    update section on access control

* viewcvs.conf.dist
    update documentation for "root_as_url_component" and "checkout_magic"

    move "checkout_magic" option directly underneath "root_as_url" component
    because the two options are related


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1037 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-13 16:48:12 +00:00
rey4
6b9207ab39 Add title attributes to directory links
* lib/viewcvs.py
  (view_directory):
    add new row.viewable attribute so it is possible to tell whether a file
    link goes to a checkout or markup page

* templates/directory.ezt:
    add title attributes


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1036 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-13 16:46:56 +00:00
maxb
08cf03dbd3 tparse: A few of the smaller changes from Erik's patch, slightly extended by me.
* tparse/tparse.h (tparseParser::tparseParser, tparseParser::parse):
    Split the actual parsing out of the constructor, into a parse() function.
* tparse/tparsemodule.cpp (PythonException): Move earlier in the file.
  (tparse): Call tparseParser::parse(). Do not INCREF and then DECREF the
    parameters - our caller must by definition be holding a reference in order
    to pass the objects in, and we are finished with them before we return.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1035 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-12 13:13:25 +00:00
maxb
b7482f30f5 tparse: A few cleanups. Some whitespace adjustments extracted from Erik's
big std::string-izing patch, and also toss some code I noticed was unused.

* tparse/tparse.cpp
  (Whitespace, Token_term, TokenParser::unget, tparseParser::parse_rcs_tree):
    Whitespace adjustments.
* tparse/tparsemodule.cpp (tparse): Whitespace adjustments.

* tparse/tparse.h (RCSParseError.getvalue, RCSExpected.getvalue):
    Remove some unused code, which includes one use case of the deprecated
    ostrstream class.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1034 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-12 01:50:11 +00:00
maxb
af6dbf5ecd tparse: Enable compilation on gcc 3.x, sacrificing compatibility with gcc 2.x.
* tparse/tparse.h: #include <strstream>, not <strstream.h>,
    and add "using namespace std;".

* tparse/tparsemodule.cpp: Do not #include <stdiostream.h>.
  If a version of GNU C++ with the stdio_filebuf extension to the STL is
  detected, then use it to allow the passing of a filehandle from Python
  to the parser. Otherwise, throw a NotImplementedError when a filehandle
  is passed.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1033 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-11 23:53:52 +00:00
cmpilato
fd5acb4930 * viewcvs/lib/viewcvs.py
(enscript_extensions): Add '.f90' as an extension mapping to
    'fortran'.  Suggestion by Ed Zaron <ezaron@coas.oregonstate.edu>.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1032 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-10 23:37:11 +00:00
cmpilato
5020756254 Add notation about the new 'template_dir' directive.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1031 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-08 16:58:47 +00:00
cmpilato
da38c84d9c Move the [options] section up to just below the [general] stuffs.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1030 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-08 02:48:14 +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
12d47495c3 Reorganize URL handling functions for clarity and to make it
easier to change the default view.

* lib/viewcvs.py
  (Request.run_viewcvs):
    move code that handles the magic markup mimetype.

    remove unneccessary special case code for log pages with revisions
    selected for diffs

  (Request.get_link):
    consolidate code that determines whether to skip sticky variables


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1028 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-06 19:55:49 +00:00
rey4
0b989145a7 Minor updates to documentation.
* INSTALL
    update cvsgraph revision number and cgi directory path

* CHANGES
    mention "root_as_url_component" and fix the way a date is formatted

* website/upgrading.html
    fix stutter


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1027 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-06 19:53:17 +00:00
rey4
605109cbfd Fix page title for repository listing page
* templates/include/header.ezt


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1026 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-06 19:49:30 +00:00
cmpilato
83af4b6b3d Move the magical 'Repository Listing' option to the top of the option set.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1025 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-05 16:52:12 +00:00
rey4
86a7feb403 Add unobtrusive link to repository listing view on the common page
headers.

* templates/include/header.ezt
    add "Repository Listing" option to the roots select box

* lib/viewcvs.py
  (Request.run_viewcvs):
    handle magic "roots" value submitted by the roots select box

  (common_template_data):
    add "view" template parameter


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1024 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-04 18:33:20 +00:00
rey4
56e7993f12 Add repository listing view. This change doesn't any links to the new
view because I'm not really sure where they would fit best in the UI.
So for now, the view is only visible when viewcvs.cgi is loaded
with no trailing path in the URL and either root_as_url mode is
enabled or default_root is not set.

* lib/viewcvs.py
  (Request.run_viewcvs, Request.get_link, nav_path, common_template_data,
   _views):
    add support for new view

  (view_roots):
    new function

* lib/config.py
  (Config.set_defaults):
    set default templates.roots option

* templates/roots.ezt
    new template

* viewcvs.conf.dist
  (templates/roots):
    new option

  (general/default_root, options/root_as_url_component):
    update documentation


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1023 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-04 18:32:32 +00:00
rey4
5d572bef92 Remove duplicate code
* lib/viewcvs.py
  (nav_header_data):
    get rid of duplicate template assignments


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1022 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-04 18:29:09 +00:00
rey4
21f89e87d5 Get revision numbers to display on annotate pages when viewing HEAD.
* lib/blame.py
  (BlameSource.__init__):
    set "revision" member to revision being annotated

* lib/viewcvs.py
  (view_annotate):
    use "revision" member


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1021 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-04 18:28:22 +00:00
rey4
37a8e3ee3c Document removed template variables
* website/upgrading.html


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1020 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-04 18:26:54 +00:00
rey4
d9fd8ee727 Replace dodgy os.dup calls with calls to os.dup2
* standalone.py
  (ViewCVS_Handler.run_viewcvs):
    don't duplicate file descriptors inside an assert, asserts shouldn't
    be used to handle runtime errors, only to detect logic errors, and
    anyway, the code needs to run with asserts disabled

    call dup2() instead of dup() to explicitly set the standard out,
    instead of just hoping that the standard out is the first available
    descriptor


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1019 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-03 13:08:59 +00:00
rey4
4504b5fc3d Make redirects work better with the standalone server
* lib/sapi.py
  (CgiServer.redirect):
    use addheader() method instead of printing headers literally


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1018 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-03 13:07:16 +00:00
rey4
72dbcf1fb7 Fix bug in copy_stream which broke docroot requests with the standalone
server on linux.

* lib/viewcvs.py
  (copy_stream):
    when copying to the sys.stdout, make sure to use the current
    sys.stdout file object instead of the file object cached by
    python as a default argument


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1017 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-03 13:05:40 +00:00
rey4
33e9c1db0c Make the blame module use get_url links
* lib/viewcvs.py
  (sticky_vars):
    removed

  (view_annotate):
    pass partial get_url links to blame module

* lib/blame.py
  (link_includes, BlameSource.__init__, BlameSource.__getitem__):
    use get_url links


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1016 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-03 13:04:03 +00:00
rey4
d0029c46d3 Add revision links to annotate view
* lib/viewcvs.py
  (view_markup, nav_header_data)
    move "view_href," "download_href," "annotate_href" assignments
    into nav_header_data

* templates/annotate.ezt
    add revision links here


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1015 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-03 13:03:19 +00:00
rey4
dc76b574a9 Clean up path handling in viewcvs views, eliminate unused template variables.
* lib/viewcvs.py
  (_path_join):
    new function

  (Request.run_viewcvs, nav_path, common_template_data, view_markup,
   view_log, view_cvsgraph, generate_tarball, view_query):
    use _path_join

  (nav_header_data):
    remove unused variables

* templates/graph.ezt
    don't use "path" variable


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1014 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-03 12:58:14 +00:00
cmpilato
4d1a7b09b3 Fix tarball generation bug noticed by Nicolas Benoit <nbenoit@tuxfamily.org>.
* viewcvs/lib/viewcvs.py
  (generate_tarball): rep_top is a list, so stop testing it against strings.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1013 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-02 15:07:29 +00:00
cmpilato
e58df06c55 * viewcvs/lib/vclib/svn/__init__.py
(_sigterm_handler): Make self available for compatibility with older
    Python versions.  (Thanks for catching this, Greg Stein.)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1012 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-02 15:02:55 +00:00
cmpilato
5ad97c13bb Ensure that Subversion repositories get a clean disconnect when
SIGTERM is sent to the process by registering a handler for that
signal which gracefully shuts down APR.

* viewcvs/lib/vclib/svn/__init__.py
  (SubversionRepository.__init__): Register a handler for SIGTERM that
    cleanly closes up shop.
  (SubversionRepository._close): New (with code copied and modified
    from __del__).
  (SubversionRepository.__del__): Cored out (see _close).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1011 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-01 20:37:00 +00:00
cmpilato
b5cf642f0e * viewcvs/lib/viewcvs.py
(file_sort_cmp): Only treat directories as special when sorting by name.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1010 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-02-01 16:40:15 +00:00
cmpilato
f85b7bb67e * viewcvs/lib/popen.py
(popen): Removed commented-out code.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1009 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-31 21:14:04 +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
27c4c62394 * viewcvs/lib/viewcvs.py
(_sticky_vars): Remove 'dir_pagestart' and 'log_pagestart' from the
    set of sticky parameters.  I simply can't see any utility in
    keeping those things around, as they muck up more URLs than they help.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1007 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-29 03:55:24 +00:00
rey4
ff5aa6d251 Fix handling of "tarball" parameter (for backwards compatibility
with ViewCVS 0.9.2

* lib/viewcvs.py
  (Request.run_viewcvs)
    look for tarball parameter on directory paths, not file paths
----------------------------------------------------------------------


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1006 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-14 19:35:14 +00:00
rey4
83d2817867 Fix subversion markup view
* lib/viewcvs.py
  (view_markup):
    set annotate_href value

----------------------------------------------------------------------


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1005 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-14 06:38:20 +00:00
rey4
c9ca3313c6 Remove "auto" view replacing auto links with direct checkout or
markup links.

* lib/viewcvs.py
  (is_viewable):
    new function

  (view_auto):
    removed

  (view_directory, view_cvsgraph, build_commit):
    change auto links into direct links


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1004 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-14 06:08:08 +00:00
rey4
99818c7cf0 Add a bunch of links between different views. Some of these links
were present in ViewCVS 0.9.2, but seem to have been inadvertently
removed since then.

* lib/viewcvs.py
  (common_template_data):
    set "up_href, "log_href," and "graph_href" template variables
    for files

  (view_markup):
    set "annotate_href"

  (view_directory):
    stop setting "up_href" here

  (view_log):
    stop setting "graph_href" and "back_url" here
    set "annotate_href" here

  (view_queryform):
    set "dir_href" here

* templates/annotate.ezt
* templates/diff.ezt
* templates/graph.ezt
* templates/log.ezt
* templates/log_table.ezt
* templates/markup.ezt
* templates/query_form.ezt
* templates/include/branch.ezt
    add links

* website/upgrading.html
    document changed variables


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1003 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-14 05:20:46 +00:00
cmpilato
ee9b309d4c Answer a FAQ about Subversion bindings.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1002 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-14 04:54:50 +00:00
rey4
0b8521ef61 Add viewcvs logo to the page across from the title.
* templates/include/header.ezt
    look at it go...


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1001 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-14 03:47:20 +00:00
rey4
c0110cacae Simplify page titles. Someone was getting a little - too crazy - with -
the: punctuation ;)

* templates/annotate.ezt
* templates/diff.ezt
* templates/graph.ezt
* templates/log.ezt
* templates/log_table.ezt
* templates/markup.ezt
* templates/query.ezt
* templates/query_form.ezt
* templates/query_results.ezt
* templates/revision.ezt
* templates/include/dir_header.ezt
* templates/include/header.ezt
  change titles

* lib/config.py
  (Config.set_defaults):
    remove "main_title" option

* viewcvs.dist.conf
    remove "main_title" option

* website/upgrading.html
    document removal of "main_title" option


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1000 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-14 03:40:55 +00:00
rey4
cbac6b920c Fix infinite redirect problem for tarball download links, and remove
trailing slashes on revision view links.

* lib/viewcvs.py
  (Request.run_viewcvs):
    don't require trailing slashes on tarball download or revision
    view URLs

  (Request.get_link):
    remove trailing slashes on revision view links


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@999 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-13 19:04:13 +00:00
rey4
aedd660e9a Fix infinite redirect problem for revision URLs.
C. Michael Pilato <cmpilato@collab.net> first reported this bug
on the dev list.

* lib/viewcvs.py
  (Request.get_link):
    add trailing slashes on revision view links


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@998 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-13 18:31:10 +00:00
cmpilato
d34e4f0594 * viewcvs/lib/viewcvs.py
(nav_path): Escape the root name.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@997 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-13 18:11:57 +00:00
cmpilato
9fdb38c5e5 * viewcvs/lib/viewcvs.py
(Request.run_viewcvs): If there is no rootname, set a default one so
    that further attempts to use it don't choke.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@996 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-13 17:37:59 +00:00
rey4
fdb5ced659 Templatize the clickable path in header.ezt.
* lib/viewcvs.py
  (clickable_path, _dir_url):
    removed

  (nav_path):
    new function, replaces clickable_path

  (common_template_data):
    set "nav_path" template variable with nav_path() instead of
    clickable_path()

  (view_directory, view_log, view_queryform, view_query):
    don't override 'nav_path' variable

* templates/include/header.ezt
    use changed 'nav_path' variable

* website/upgrading.html
    document changed 'nav_path' variable


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@995 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-13 17:30:45 +00:00
rey4
3d3554b07e Remove extra clickable paths from directory and markup pages.
* lib/viewcvs.py
  (view_markup):
    don't set 'nav_file' template variable

* templates/markup.ezt
    remove the clickable path right before the revision information

* templates/include/dir_header.ezt
    remove clickable path in "Current Directory" row of summary table

* website/upgrading.html
    add documentation on 'nav_file' template variable


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@994 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-13 16:55:48 +00:00
rey4
df3d83f843 Fix bug that prevented magic checkout URLs from working.
* lib/viewcvs.py
  (Request.run_viewcvs):
    fix use of nonexistent variable


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@993 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-13 16:17:53 +00:00
rey4
35c9d578f7 Add a promiment link to the log page on the markup page. ViewCVS 0.9.2
had one, but it got lost in the sauce.

* templates/markup.ezt
    add (log) link right before (download) and (as text) links


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@992 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-13 16:14:12 +00:00
rey4
8a6ffa0257 Fix a bug in redirection logic
* lib/viewcvs.py
  (Request.run_viewcvs):
    add trailing slash to all directory paths, not just paths
    for directory listing pages


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@991 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-13 07:20:33 +00:00
rey4
77e0fd633a Add "Parent Directory" link in directory listings
* templates/directory.ezt
* templates/dir_alternate.ezt
    add "Parent Directory" rows

* lib/viewcvs.py
  (view_directory):
    set "up_href" template value

* website/upgrading.html
    document "up_href" variable


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@990 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-13 05:57:01 +00:00
rey4
7e897b10df Fix UnmatchedEndError in dir_alternate template.
* templates/dir_alternate.ezt
    remove unmatched [end]


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@989 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-13 05:38:13 +00:00
rey4
5c42382511 Redirect on irregular URLs so it is easier to limit viewing parts of
the repository in apache based on the URL.

Thanks to Jonathan <voigtjr@gmail.com> for bringing this issue to my
attention on the users' list.

* lib/viewcvs.py
  (Request.run_viewcvs):
    add redirects for weird urls

  (view_directory):
    don't redirect here when there's no trailing slash; it's taken
    care of in run_viewcvs


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@988 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-13 02:16:09 +00:00
rey4
0b7be07a67 Fix cvs log view
* lib/viewcvs.py
  (view_log):
    set default value for entry.copy_path


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@987 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-13 01:34:20 +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
167311b79b * viewcvs/lib/viewcvs.py
(view_doc): Refer to "static files" instead of "help files", and to
    try to get all the exceptionful states to occur before we fire up
    the output process.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@985 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-06 20:38:47 +00:00
cmpilato
39d2eedd10 Fix Bugs item #1090934, reported by ahndee.
* lib/viewcvs.py
  (view_revision_svn): Convert 'text_mods' and 'prop_mods' members of
    each changed path item into EZT booleans.

* templates/revision.ezt
  Use if-any tests, instead of comparisons with "1", to determine if
  each changed path item has text or property mods.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@984 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-06 20:27:27 +00:00
cmpilato
38dc2d2521 * viewcvs-install
Add support for DESTDIR installs, and support for --prefix and
  --destdir command-line arguments (which override the defaults and
  prevent prompts from appearing).  DESTDIR install stuff from a
  patch by Olaf Hering <olh@suse.de>, command-line arg stuff by me.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@983 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-01-06 20:10:47 +00:00
rey4
ce2a896be2 Fix loginfo crashes on "cvs import" and "cvs add <directory>". Thanks to John
Beranek <john@redux.org.uk> for reporting the bug on the users' list.

* tools/loginfo-handler
  (HeuristicArgParse, CvsNtArgParse):
    fix return values


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@982 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-12-10 02:43:07 +00:00
rey4
1c703900bb Generate CvsGraph image map links with get_url function just like other
links instead of cobbling them together in cvsgraph.conf. This way
cvsgraph.conf doesn't have to change if we add new url schemes and we can
handle sticky variables and root parameters without special case code.

* lib/viewcvs.py
  (Request.get_url):
    accept new "partial" argument to append trailing ? or & to generated
    url

  (view_cvsgraph):
    pass get_url generated links to cvsgraph instead of url fragments

* cvsgraph.conf.dist
    use the new links passed by ViewCVS


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@981 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-12-10 02:09:46 +00:00
rey4
b6a4e521be Remove apache logo from default templates
* templates/include/footer.ezt
    Powered by... nothing :'(


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@980 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-12-06 01:45:59 +00:00
rey4
518573a350 Minor cleanups.
* lib/vclib/bincvs/__init__.py
  (_log_path):
    remove initialization of unused variable

  (_check_path):
    distinguish error messages that come from os.stat()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@979 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-12-04 01:57:13 +00:00
rey4
2529196782 Improve error messages in directory view for inaccessible CVS files.
* lib/vclib/__init__.py
  (DirEntry.__init__):
    set "errors" member instead of "verboten"

* lib/vclib/bincvs/__init__.py
  (CVSRepository.listdir):
    don't skip "Attic" and "CVS" entries if we're not sure if they are
    directories

    don't skip entries in Attic/ when we can't tell if they are files or
    directories

  (CVSDirEntry.__init__):
    use "errors" argument instead of "verboten"

  (_get_logs):
    don't set "DirEntry.log_errors" member, use "errors"

  (_log_path):
    don't return file access errors here, they are returned by _check_path

  (_check_path):
    return error strings on file access errors instead of simple booleans

* lib/vclib/ccvs/__init__.py
  (CCVSRepository.dirlogs):
    don't set "DirEntry.log_errors" member, use "errors"

* lib/vclib/svn/__init__.py
* lib/vclib/svn_ra/__init__.py
  (get_logs):
    don't set "DirEntry.log_errors" member

* lib/viewcvs.py
  (view_directory):
    use "DirEntry.errors" member instead of "log_errors"

  (generate_tarball):
    use "DirEntry.errors" member instead of "verboten"

* tools/cvsdbadmin
  (RecurseUpdate):
    use "DirEntry.errors" member instead of "verboten"


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@978 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-12-03 20:44:56 +00:00
rey4
dd140d8f59 Merge in changes from cvsgraph.conf in CvsGraph 1.5.1
* cvsgraph.conf.dist
    update

* lib/viewcvs.py
  (view_cvsgraph):
    pass query string as %8 custom parameter instead of %6


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@977 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-12-02 22:51:48 +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
cbf330498f Drop a TODO for later processing.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@975 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-11-19 06:37:39 +00:00
rey4
0986d26a6a Update enscript link
* website/index.html
    link to enscript home page instead of gnu.org entry


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@974 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-30 22:12:03 +00:00
rey4
496719d672 Tone down normalization of the script name. We just need to trim its
leading slashes, not put it through some hocus-pocus purification
ritual.

* lib/viewcvs.py
  (_normalize_path):
    just trim leading slashes


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@973 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-30 22:12:01 +00:00
cmpilato
bb591ca897 Remove some italics.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@972 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-30 05:19:53 +00:00
cmpilato
8164d4fd3f Fix Bug #983511 by normalizing the SCRIPT_NAME.
* lib/viewcvs.py
  (_normalize_path): New.
  (Request.__init__): Run _normalize_path() on self.script_name.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@971 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-30 05:19:52 +00:00
cmpilato
3ee18bdb13 (_get_logs): Fix a bug in determining imperfect-but-wanted entries.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@970 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-30 04:45:36 +00:00
cmpilato
514f573a6a Space text chunks a little more naturally.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@969 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-28 15:27:53 +00:00
cmpilato
b404bc2719 Website content edits.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@968 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-28 03:34:37 +00:00
cmpilato
c7e1eeb97d * tools/make-release
Fix the CVS root used, and remove the website before tarrin' up.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@967 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-26 06:36:30 +00:00
cmpilato
aa7d64fb28 Add the PhotoShop file I used to create the title image. Note that the cloud
photo is a public domain image taken from:
  http://pdphoto.org/PictureDetail.php?mat=pdef&pg=5173


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@966 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-26 06:32:39 +00:00
cmpilato
98046b15f5 Hope I'm not stepping on any toes here, but I couldn't bear the site
of the ViewCVS web pages any longer.  This begins a journey of
organization and updating that has been long past due.  And hey, if
folks hate it -- it's under version control.

* website/contact.html
* website/download.html
* website/images/bg-grad.jpg
* website/images/title.jpg
* website/styles.css
  New files.

* website/contributing.html
* website/index.html
* website/license-1.html
* website/upgrading.html
* website/who.html
  Heavily modified files.

* website/images/chalk.jpg
* website/images/logo.png
  Removed.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@965 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-26 06:22:13 +00:00
cmpilato
1a76505beb Minor docco fix. Patch by Juanma Barranquero <lektu@mi.madritel.es>.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@964 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-26 02:09:09 +00:00
cmpilato
e3abe288f6 Update mailing list information.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@963 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-25 17:46:27 +00:00
cmpilato
b26f6c0e09 * viewcvs/lib/viewcvs.py
(view_log): Only show download hrefs for files, and make view hrefs
    for directories show the directory view.

* viewcvs/templates/include/branch.ezt
  Only display the view_href if it exists.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@962 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-20 16:27:04 +00:00
cmpilato
0540dd9c0a * lib/viewcvs.py
(view_log): Always expose the view_href and download_href.

* templates/log.ezt
* templates/log_table.ezt
  Lose the "if CVS" condition I added for some includes a while ago.

* templates/include/branch.ezt
  Always show bookmarkable links to HEAD/download.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@961 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-19 14:46:35 +00:00
cmpilato
6fbdc57c44 Fix issue #1035766.
* lib/viewcvs.py
  (_re_rewrite_url): Look for the HTML-encoded version of ampersands
    in URLs ("&amp;").


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@960 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-18 16:39:26 +00:00
cmpilato
4884f8f5c6 Address issue #1049046.
* lib/viewcvs.py
  (_re_rewrite_email): Allow plus signs in email addresses.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@959 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-18 16:03:44 +00:00
rey4
68ebc10d44 Minor fix in svndbadmin
* tools/svndbadmin
  (usage):
    fix call to os.path.basename()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@958 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-16 03:08:04 +00:00
rey4
eaa2136cf6 Minor cleanups in loginfo script
* tools/loginfo-handler
  (HeuristicArgParse):
    fix spelling error in docstring

  (HeuristicArgParseDirectory, FindLongestDirectory)
    rename function

  (NextFile):
    fix return value

  (ProcessLoginfo):
    update inaccurate comment

  (module code):
    update inaccurate debug message


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@957 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-16 03:04:30 +00:00
rey4
325e79d4dc Minor cleanup in viewcvs module
* lib/viewcvs.py
  (view_query)
    shorten call to get_url


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@956 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-16 02:46:30 +00:00
rey4
5687f191f3 Minor cleanup in cvsdb module
* lib/cvsdb.py
  (Commit.SetBranch)
    shorten this code

  (CheckinDatabaseQuery.AddCommit, CheckinDatabaseQuery.SetCommitCB):
    remove unused callback functionality


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@955 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-16 02:40:10 +00:00
rey4
31410c3272 Minor cleanup in bincvs module
* lib/vclib/bincvs/__init__.py
  (_log_path)
    no need to deal with Attic paths here, they are filtered out in
    listdir


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@954 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-16 02:32:32 +00:00
rey4
173a8a7290 Get rid of rlog module, make CVSdb use bincvs instead.
* lib/rlog.py
    deleted

* lib/cvsdb.py
  (RLogDataToCommitList):
    removed

  (GetCommitListFromRCSFile):
    change to use vclib instead of rlog module

  (GetCommitListFromRCSFile, GetUnrecordedCommitList):
    update to accept vclib-style path_parts arguments

* lib/vclib/bincvs/__init__.py
  (BinCVSRepository.filelog):
    accept "cvs_pass_rev" option for passing -r arguments to rlog

  (_match_revs_tags):
    make this function work with an incomplete list of revisions
    instead of crashing. This is neccessary when an -r argument
    is passed to rlog.

  (_add_tag):
    make this function work when we need to create a tag with no
    revision object. We need this to create a HEAD tag when an -r
    argument is passed to rlog and we don't know what the HEAD
    revision is.

  (fetch_log):
    removed

* tools/cvsdbadmin
  (RebuildFile):
    removed, merged into UpdateFile

  (UpdateFile)
    accept new argument to reinsert all commits

  (RecurseRebuild):
    removed, merged into RecurseUpdate

  (RecurseUpdate):
    update to use vclib's listdir instead of os.listdir

  (CommandRebuild, CommandUpdate):
    removed, code moved into __main__ section

* tools/loginfo-handler
  (FileData, CommitFromFileData, GetUnrecordedCommitList):
    removed, these were just wrappers over the cvsdb interface

  (HeuristicArgParse, CvsNtArgParse)
    return tuples describing file data instead of file data objects

  (ProcessLoginfo):
    update to use cvsdb interface


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@953 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-16 02:23:23 +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
0547748716 Remove site-specific kludge from cvsdb (originally added by Jay Painter for
RealNetworks repositories)

* lib/cvsdb.py
  (CheckinDatabase.CreateSQLQueryString):
    remove code that excludes ".ver" files from all queries


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@951 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-14 02:07:07 +00:00
rey4
1095284f7f Fix case-sensitive path comparison in bincvs that causes problems on
windows when lowercase drive letters are used in cvs paths in
viewcvs.conf.

* lib/vclib/bincvs/__init__.py
  (_paths_eq):
    new function for comparing paths that works on case-insensitive
    filesystems

  (BinCVSRepository.openfile, _get_logs):
    use new path comparison function

  (_parse_co_header, _parse_log_header):
    stop cleaning up returned filenames, it's no longer neccessary
    with new path comparison function


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@950 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-14 02:00:34 +00:00
rey4
673b15f3aa Update windows README
* windows/README
  - add troubleshooting info for CreateProcess exception
  - consolidate information about old CVSNT bugs


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@949 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-14 01:48:30 +00:00
rey4
fb0a3cb754 Remove workaround for really old CVSNT bug in loginfo-handler
* tools/loginfo-handler
  (BrokenCvsNtArgParse):
    remove

  (global scope)
    no longer accept "brokencvsnt" argument


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@948 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-14 01:44:53 +00:00
cmpilato
f570dd8bd6 Don't include the branch and view_tag templates for non-CVS log displays.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@947 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-13 18:19:14 +00:00
cmpilato
d417cc000b * viewcvs/lib/viewcvs.py
(view_log): Dictate the 'where' and 'pathtype' values to the
    URL-generating function when making download links.  Patch by
    Stefan Haller <haller@ableton.com>.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@946 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-13 17:39:55 +00:00
rey4
fd665fd18e Swap sorting arrows in directory view following a discussion on the
dev list that ended at

http://mailman.lyra.org/pipermail/viewcvs-dev/2004-September/001769.html

* templates/docroot/images/ascending.png
* templates/docroot/images/descending.png
* templates/docroot/images/down.png
* templates/docroot/images/up.png
    rename ascending and descending images to down and up based on the
    direction of the arrows

* templates/directory.ezt
* templates/dir_alternate.ezt
    update to use new image names


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@945 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-09 02:59:27 +00:00
rey4
b0ebdbed63 Fix escaping of directory paths in query pages so searching within
directories works on windows.

* lib/cvsdb.py
  (EscapeLike):
    new function

* lib/viewcvs.py
  (view_query):
    escape directory paths before using them in LIKE comparisons


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@944 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-09 02:32:15 +00:00
rey4
32ad18a7ad Remove unused and undocumented 'filename' template variable from log
pages. It was was added in rev 1.158.

* lib/viewcvs.py
  (view_log):
    remove 'filename' template variable


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@943 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-09 01:40:58 +00:00
rey4
155c926b23 Update upgrading.html with information about some recently changed
template variables, also fix some existing entries in the file.

* website/upgrading.html
  (sortdir_up_href, sortdir_down_href, roots):
    add new documentation about these variables

  (roottype, rootname, pathtype, raw_diff):
    fix these entries up


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@942 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-09 01:17:17 +00:00
rey4
267d335899 Combine "Dead Files" and "Files Shown" counts in directory listing
* templates/include/dir_header.ezt


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@941 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-08 23:51:55 +00:00
rey4
162f650a9b Update windows README
* windows/README
    update CVSNT url
    add warning about using old versions of CVSNT


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@940 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-08 23:30:41 +00:00
rey4
0366e98834 Remove unused loginfo module
* lib/vclib/ccvs/loginfo.py
    deleted


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@939 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-08 23:08:27 +00:00
rey4
e0a60537f7 Tweak handling of MIME types in ViewCVS pages
- Don't pass "text/plain" as a MIME type to templates when the real
  type is unknown, pass None instead

- Load MIME types file once after reading the ViewCVS configuration
  instead of reloading at each request.

* lib/viewcvs.py
  (Request.run_viewcvs):
    set Request.mime_type member here

  (Request.setup_mime_type_info):
    removed

  (guess_mime, is_plain_text):
    new

  (is_text, is_viewable_image, view_checkout):
    change to cope with None MIME types, treating them like text

  (view_markup):
    use new is_plain_text function

  (view_directory, search_files):
    use new guess_mime function

  (view_log):
    make use of Request.mime_type member and the new is_plain_text
    function


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@938 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-08 22:35:43 +00:00
rey4
1f561d48eb Fix some silliness in link generating code
* lib/viewcvs.py
  (Request.get_link):
    where implies where != ''


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@937 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-08 21:02:26 +00:00
rey4
f8bf3f132f Fix time conversion bug that prevented queries from working on
Python 2.3 installations without mxDateTime.

Thanks to paul@times-interactive.com for bringing the bug and fix
to my attention on the users' list.

* lib/dbi.py
  (TicksFromDateTime):
    handle case where MySQLdb returns datetime objects


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@936 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-08 20:53:31 +00:00
rey4
55aa1e3d12 Update the documentation so it's no longer an impediment to a 1.0
release. There's still a lot of room for improvement, but there
should be no gaping holes or inaccuracies.

* INSTALL
    update old paths

    remove mention of svn_parent_path

    remove advice about trailing slashes in the Troubleshooting
    section. They're nice, but optional now that we don't use
    relative links.

* README
    add pointer to windows/README

* templates/docroot/help_logtable.html
    document the missing columns

* website/upgrading.html
    document the configuration options

    add a word of advice about upgrading with custom templates


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@935 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-08 17:57:14 +00:00
rey4
38e39154ac Update the list of developers
* website/who.html
    add James Henstridge and Lucas Bruand and list the various
    peoples' contributions


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@934 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-08 04:01:18 +00:00
rey4
ebba161285 Update the CHANGES file
* CHANGES
  (Version 1.0):
    add new features and bugfixes. I came up with the list by scanning
    the CVS logs since 0.9.2 for user-visible changes, so it should
    be pretty complete.

  (Version 0.9.2):
    correct release date


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@933 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-08 02:23:16 +00:00
rey4
50e1e87f71 Edit a comment in viewcvs.conf.dist
* viewcvs.conf.dist
  (docroot):
    edit comment


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@932 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-28 16:33:44 +00:00
rey4
f74b149949 Don't copy website on install
* viewcvs-install
  (TREE_LIST):
    remove website directory from list


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@931 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-28 16:30:22 +00:00
rey4
22965539ff Make the navigation bar easier to read
* templates/docroot/styles.css
  (.vc_navheader):
    switch to gray background because blue links on purple background
    are hard to read

* header.ezt
  (nav_path):
    make it bold


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@930 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-27 21:01:06 +00:00
rey4
b062a30d76 Simplify handling of roots in root_as_url mode.
* lib/viewcvs.py
  (Request.run_viewcvs):
    don't do blind redirects when we have a "root" parameter in
    root_as_url mode because it can lead to multiple redirects
    and redirects to invalid urls

    don't even try to interpret non-root_as_url url's in
    root_as_url mode when they don't specify an explicit
    root. It can't be done reliably and there's little
    value in it anyway


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@929 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-25 03:45:20 +00:00
rey4
38321990ae Get rid of unused "viewable" and "is_text" template variables on log
page. They weren't terribly useful or accurate.

* lib/viewcvs.py
  (Request.setup_mime_type_info):
    stop setting "default_viewable" member

  (view_auto):
    stop using request's "default_viewable" member, just compute value
    on the fly

  (view_log):
    stop setting "viewable" and "is_text" template variables

* website/upgrading.html
    update documentation


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@928 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-25 03:06:28 +00:00
rey4
c0300fcc2c Fix bug in clickable_path (from lib/viewcvs.py 1.167) that makes
navigation on markup, diff, and annotate pages a pain.

* lib/viewcvs.py
  (clickable_path):
    interpret leaf_is_link argument correctly


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@927 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-25 02:39:19 +00:00
rey4
7886133d91 Tweaks to code that generates links in ViewCVS pages. The only
externally visible difference is that in root_as_url mode,
links with "root" parameters no longer get a redundant path
component pointing at the current root.

* lib/viewcvs.py
  (_sticky_vars):
    don't make root a sticky var, it gets special treatment anyway
    and having it sticky just makes things more complicated

  (Request.get_link):
    remove redundant and never-used rootname argument

    make logic that suppresses sticky variables on checkout and
    tarball links more explicit

    change code for merging sticky variables to operate on the
    dictionary of parameters instead of building a new dictionary

    make code that handles the "root" parameter generate minimal
    URLs in all circumstances

  (Request.get_options):
    removed, logic moved into Request.get_link

  (Request.sticky_vars):
    new method that returns a dictionary of stick variables

  (view_annotate, view_cvsgraph):
    call Request.sticky_vars instead of Request.get_options


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@926 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-25 02:23:27 +00:00
rey4
24041aeb9a Use new-style viewcvs links in CvsGraph images
* cvsgraph.conf.dist
    update path strings


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@925 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-25 00:55:30 +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
rey4
e80dfb1aa9 Now that we're using our own icons instead of the icons provided by Apache,
we can get rid of the alternative icons we provided for the standalone web
server and IIS. We can also get rid of the "icons" configuration option.

* lib/apache_icons.py
* tools/bin2inline_py.py
    removed, icons for the standalone server

* windows/icons/apache_pb.gif
* windows/icons/small/back.gif
* windows/icons/small/dir.gif
* windows/icons/small/text.gif
    removed, icons for IIS

* templates/include/footer.ezt
    point "Powered by Apache" image at /icons/apache_pb.gif instead of
    [icons]/apache_pb.gif

* standalone.py
  (apache_icons, icons_last_modified):
     removed

  (ViewCVS_Handler.do_GET):
    remove handling of /icons/ paths

  (serve):
    stop setting options.icons config value

* viewcvs.conf.dist
  (icons):
    removed

* lib/config.py
  (Config.set_defaults):
    stop setting default options.icons config value

* lib/viewcvs.py
  (common_template_data):
    don't set "icons" template variable

* windows/README
  (ICONS FOR IIS):
    removed

  (DOCROOT OPTIMIZATION):
    new section about the docroot parameter

* website/upgrading.html
    remove documentation for "icons" template variable, update
    documentation for "docroot"


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@923 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-25 00:00:31 +00:00
jhenstridge
0e9248f2a7 Remove the moved files to finish off the reorganisation.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@922 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-22 06:40:53 +00:00
jhenstridge
d027efa883 Copy online documentation, stylesheet and required images to
templates/docroot/

* templates/docroot/help_*.html, templates/docroot/styles.css: copied
  from website/
* templates/docroot/images/*: copied from website/images/ or from Apache.
  fix up the transparency on some of the PNGs (just 1-bit transparency
  though, so they work with IE).
* lib/viewcvs.py (view_doc): update to the new location for documentation.
  We can use the same location in the "installed" and "uninstalled" modes.
* viewcvs.conf.dist: update the comment about the docroot config value.
* templates/*.ezt: update for new icon locations.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@921 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-22 06:22:42 +00:00
cmpilato
3c236331e1 Some error-related cleanups.
* viewcvs/lib/viewcvs.py
  Update all uses of "ViewcvsException" to "ViewCVSException".
  (_RCSDIFF_IS_BINARY): Make this value match the one used in templates.
  (human_readable_diff): If rcsdiff comes back with the wrong version
    information, raise an exception that error.ezt can handle.  Also,
    simplify the handling of rcsdiff_eflag.
  (download_tarball, view_cvsgraph_image, view_cvsgraph_image): Raise
    403 Forbidden's for disable features.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@920 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-14 18:16:58 +00:00
jhenstridge
b68ec0fda5 Fix some validity errors on the query_form.ezt template.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@919 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-14 08:56:18 +00:00
jhenstridge
7cce726069 Fix up validity errors due to non-escaped ampersands in URLs.
* lib/viewcvs.py: add an optional escape parameter to the get_url()
   method, that will entity escape the URL.
   Pass escape=1 to each call to get_url() that is used to construct a
   URL for display in a template.
 * lib/blame.py: fix up a small entity escaping problem here too.
 * templates/revision.ezt: fix up a few HTML validity errors in this
   template that were a lot more obvious after clearing up the other
   errors.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@918 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-14 08:49:32 +00:00
cmpilato
2481c9a5c9 Normalize configured paths at a different time so that we don't
destroy URLs used by the svn_ra module.

* viewcvs/lib/config.py
  (_parse_roots): Don't normalize the paths for roots here -- it will
    destroy URLs.

* viewcvs/lib/viewcvs.py
  (Request.run_viewcvs): Normalize them here, *after* we know what's a
    URL and what's a normal path.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@917 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-09 22:10:57 +00:00
jhenstridge
302fa88601 * templates/include/dir_footer.ezt: get rid of validity error due to
misnesting of <form> and <table> tags.
* templates/include/diff_form.ezt: get rid of a similar problem in the
  diff form.
  Also simplify the form a bit for the case when there are no tags (ie.
  subversion).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@916 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-03 12:31:59 +00:00
jhenstridge
c969184313 * templates/directory.ezt, dir_alternate.ezt: make the sort order arrow
part of the header hyperlink.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@915 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-09-03 11:48:38 +00:00
cmpilato
f857dad099 Learn these here RCS parsers about the fact that that "branch" keyword
over yonder is right optional.  Patch by Max Bowsher <maxb@ukf.net>.
Faux cowboy by cmpilato.

* lib/vclib/ccvs/rcsparse/common.py (_Parser.parse_rcs_admin)
* lib/vclib/ccvs/rcsparse/default.py (Parser.parse_rcs_admin)
* tparse/tparse.cpp (parse_rcs_admin)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@914 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-08-17 23:08:54 +00:00
cmpilato
e58b5f67aa * lib/viewcvs.py
(_re_validate_number): Allow brackets in tag names.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@913 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-08-17 19:17:55 +00:00
cmpilato
e376b03b6d * website/styles.css
Make the annotate data "smaller", and increase the padding between
  columns.

* viewcvs/templates/annotate.ezt
  Remove superfluous spaces in table cells.  Mozilla is rendering
  wrongly, presumably because the cells are using "nowrap" or "pre"
  whitespace handling.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@912 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-08-14 16:50:57 +00:00
cmpilato
2f0a5efaf1 Cleanup the new dead file handling code to be more template-friendly
(and honest).

* lib/viewcvs.py
  (view_directory): Always calculate the num_dead variable with
    truth.  Just because we aren't showing dead files doesn't mean they
    don't exist.

* templates/include/dir_header.ezt
  Provide a single place for reporting the number of, and toggling the
  display of, dead files.

* templates/directory.ezt
* templates/dir_alternate.ezt
  Stop handling dead file display toggling on what appears (and yet
  isn't) a per-item basis.  Also, use Apache's broken.gif as the icon
  for dead files.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@911 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-08-11 14:35:44 +00:00
rey4
4f1e9a7ce7 Update alternate template.
* templates/dir_alternate.ezt
    fix handling of attic directories as in templates/directory.ezt, rev 1.47


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@910 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-08-01 14:41:39 +00:00
rey4
72f060b3ad Get the query view working on windows. The backslashes in repository paths
weren't being escaped before being embedded in sql strings.

Also do some cleanup in dbi.py

* lib/cvsdb.py
  (CheckinDatabase.SQLQueryListString):
    escape string values using Connection.escape() method

  (CheckinDatabase.CreateSQLQueryString):
    update calls to SQLQueryListString()

* lib/dbi.py
  (Cursor, Connection):
    remove these proxy objects, they don't do anything

  (connect):
    return MySQLdb.Connection object instead of proxy object


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@909 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-08-01 14:33:00 +00:00
rey4
f3ca45b9a0 Handle CVS Attic paths transparently in the bincvs module
instead of exposing them to users.

* templates/include/dir_footer.ezt
    add link to show dead files

* templates/directory.ezt
    remove code for detecting Attic entries,
    change (in the attic) caption to (dead)

* lib/viewcvs.py
  (Request.run_viewcvs):
    handle old Attic URL's by redirecting,
    remove unused request.full_name member

  (get_up_path, _re_up_attic_path, nav_header_data, generate_tarball,
   download_tarball):
    remove code for handling Attic directories

  (view_markup):
    remove unused "full_name" variable

  (view_directory):
    remove code for handling Attic directories,
    replace "no_match" template variable with "num_dead"

  (view_log):
    update call to get_up_path

  (view_annotate, view_cvsgraph_image, view_cvsgraph, view_diff):
    use CVSRepository.rcsfile to get path to rcs file

* lib/vclib/bincvs/__init__.py
  (CVSRepository.itemtype):
    look in Attic for repository files

  (CVSRepository.listdir):
    remove "cvs_list_attic" option, now always list attic files.
    leave "Attic" and "CVS" directories out of returned listing.

   (CVSRepository.rcsfile, CVSRepository._atticpath):
     new methods

   (BinCVSRepository.openfile, BinCVSRepository.filelog):
     use CVSRepository.rcsfile to get path to rcs file

   (_get_logs):
     don't mark directories as dead

* lib/vclib/ccvs/__init__.py
   (CCVSRepository.filelog, CCVSRepository.openfile):
     use CVSRepository.rcsfile to get path to rcs file

* website/upgrading.html
    document "no_match" and "num_dead" template variables


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@908 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-31 22:34:51 +00:00
rey4
98b799adbf Improve error handling in directory view.
* lib/vclib/bincvs/__init__.py
  (BinCVSRepository.openfile, BinCVSRepository.filelog, fetch_log):
    update calls to _parse_log_header

  (_re_log_error, _re_cvsnt_error, _re_lineno):
    update regular expressions for parsing rlog error messages

  (_parse_log_header):
    do a better job of parsing rlog error messages and return messages
    to callers

  (_get_logs):
    set new DirEntry.log_errors property and deal with multiple rlog error
    messages about the same file and cases where error messages precede
    file information

  (_log_path):
     return error info

* lib/vclib/ccvs/__init__.py
  (CCVSRepository.dirlogs):
    set new DirEntry.log_errors property

* lib/vclib/svn/__init__.py
  (get_logs):
    set new DirEntry.log_errors property

* lib/vclib/svn_ra/__init__.py
  (get_logs):
    set new DirEntry.log_errors property

* lib/vclib/__init__.py
  (Repository.dirlogs):
    document new DirEntry.log_errors property

* lib/viewcvs.py
  (view_directory):
    set new template variables

* website/upgrading.html
    document new template variables

* templates/include/dir_footer.ezt
    get rid of confusing "One or more files were unreadable" message.
    We display more specific error messages in the directory list.

    add links to set selection criteria at the bottom of "There are
    [num_files] files, but none match the current selection criteria"
    message

* templates/directory.ezt
* templates/dir_alternate.ezt
    simplify the way error messages are displayed


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@907 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-31 14:38:03 +00:00
jhenstridge
73a344bb15 * lib/viewcvs.py (view_diff): also use entry.filename as the location for
the view_href in the case where the path type is a directory.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@906 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-29 02:37:47 +00:00
jhenstridge
32b741f259 * lib/viewcvs.py (view_log): when constructing the view and download URLs,
use entry.filename as the location.  This fixes the view/download links
  when the log crosses a copy boundary.  Fixes bug #999355.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@905 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-29 02:33:04 +00:00
jhenstridge
ea19338677 * lib/viewcvs.py (htmlify): when htmlifying email addresses, encode the
@ symbol as a character reference.  This can trip up some email address
  spiders, while being transparent to web browsers.
  The idea came from Bugzilla.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@904 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-29 02:04:16 +00:00
jhenstridge
7a0284214c * templates/include/header.ezt: remove stray </h1> tag.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@903 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-28 02:51:40 +00:00
jhenstridge
997d4f85d1 * lib/viewcvs.py (view_directory): If it is a subversion repository,
use the directory revision number as a weak etag.
 (view_revision_svn): use the revision number as a weak etag.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@902 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-26 09:00:42 +00:00
jhenstridge
85d9d50631 * diff_form.ezt: wrap the text associated with the "makepatch" checkbox
in a <label> element, so that users can click on the text to toggle
  the value.
  Quote a few unquoted attribute values.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@901 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-26 08:17:15 +00:00
jhenstridge
d906319a8e * viewcvs-install (install_tree): don't install files ending in '~', since
this is the suffix many unix editors use for backups (and there aren't
  any files with that suffix in viewcvs).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@900 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-26 05:20:39 +00:00
jhenstridge
c3aff09497 * lib/viewcvs.py, templates/log.ezt, templates/log_table.ezt: revert
change that moved generation of human readable diff URLs from the
  templates to the Python code.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@899 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-24 16:34:04 +00:00
rey4
db74810b91 Normalize user-specified paths in cvs_roots, svn_roots, and root_parents.
The bincvs module doesn't take kindly to paths with alternate directory
seperators or trailing slashes.

* lib/config.py
  (_parse_roots):
    call os.path.normpath for cvs_roots and svn_roots paths

* lib/viewcvs.py
  (handle_config):
    call os.path.normpath for root_parents paths


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@898 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-23 23:47:00 +00:00
jhenstridge
4e573ace1d Fix up the diff links when diff_format is set to a non-default value on
the log pages.

* templates/include/diff_form.ezt: if no tags exist for the file, don't
  show the drop down tag selection box.  This gets rid of some unneeded
  UI when browsing Subversion repositories.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@897 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-23 12:43:11 +00:00
jhenstridge
198923b18a * viewcvs.py: add code to calculate various diff URLs used in the log
view.  For Subversion repositories, these URLs are usually shorter
  (only include p1/p2 when paths differ) and handle a few corner
  cases w.r.t. moves that the old code didn't.

* log.ezt, log_table.ezt: use the diff URLs passed in from viewcvs.py
  rather than constructing them in the template.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@896 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-23 11:28:30 +00:00
jhenstridge
4f348926fe Add thead/tbody tags to log_table.ezt, query.ezt and revision.ezt
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@895 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-23 09:55:50 +00:00
jhenstridge
09165074cf set size of sort arrow images, so that they don't cause reflows while
loading.  Wrap the column headers in a <thead> tag, and the rest of
the elements in a <tbody> tag.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@894 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-23 08:43:04 +00:00
jhenstridge
0f89aa8265 Add vc_log CSS class to log message on revision.ezt template. Fix from
Simon Lieschke (patch #995667)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@893 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-22 10:08:29 +00:00
jhenstridge
768233a590 fix up typo in comment.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@892 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-22 08:58:18 +00:00
jhenstridge
80e621dc0d Sort the tags attached to a revision in the log view. Fix came from
bug #994522.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@891 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-22 02:19:07 +00:00
jhenstridge
247234ff03 Add support for generating backout scripts from query results like Bonsai
can.  Suggested in Bug #777122.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@890 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-22 02:10:51 +00:00
jhenstridge
af221adef2 Use a different parameter name for the query sort key so that it doesn't
get mixed up with the directory view sort (similar to how the log view
uses logsort as a parameter name).

Don't display the branch column in results for a subversion repo query.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@889 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-21 16:01:09 +00:00
jhenstridge
f2d02f282b Update get_link() to add a rev parameter for diff links on subversion
repositories (sets rev to the same value as r2).

Update run_viewcvs() so that if no view is selected, handle requests
that specify r1,r2,rev as diffs rather than checkouts, and requests
that specify r1,rev as logs.

Update log.ezt and log_table.ezt to set the rev parameter in the diff
links when browsing subversion repositories.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@888 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-21 15:46:47 +00:00
jhenstridge
69d586a5d8 Since you don't need to click on the sort arrow to change sort direction,
don't make the arrows look like buttons.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@887 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-21 15:11:48 +00:00
jhenstridge
cc970525ac Simplify column sort code, so that clicking the sort column header
reverses the sort order, while clicking on other headers sorts by
that column in ascending order.  This matches how most GUIs handle
sorting in columned lists.

Also port the sort handling from dir_alternate.ezt to directory.ezt
to reduce differences between the two templates.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@886 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-21 14:58:30 +00:00
jhenstridge
57c58fde9b Fix up dir_alternate.ezt template to fix bug #995121 (switch the
pathname and revision links for directories).

Previously dir_alternate.ezt was broken for CVS repositories, resulting
in a traceback since it was trying to show the log href which doesn't
exist.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@885 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-21 12:17:50 +00:00
jhenstridge
55bdd8cb45 Convert double dashes in comment to single dashes, since the double dash
ends the comment.  Mentioned in a Debian bug report:
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=245550

Add a <meta name="generator"> tag to the top listing the version of
viewcvs used to generate the page.  This is less likely to be removed
from custom templates, and should be helpful when tracking bugs.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@884 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-20 07:26:52 +00:00
jhenstridge
fcdcd96359 Remove the italics from the log message CSS rules, since regular type
was more common for rendering log messages.

Before, non-italic was used in the markup, log and query templates,
while italic was used in log_template and query_results (which I copied
off of log_template).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@883 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-20 07:16:50 +00:00
jhenstridge
31ac07eb78 render all revision log messages as <pre class="vc_log">...</pre>
Add CSS for vc_log to set it italic (as it was already shown in most places),
and set some proprietary properties to turn on word wrapping for Mozilla,
Opera and IE, and the equivalent standard CSS3 property (for when browsers
support it).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@882 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-19 08:49:39 +00:00
jhenstridge
8a3030d4cf use CSS classes for the different columns in annotate mode. In particular,
set "white-space: pre" for the text column, so that white space isn't
collapsed.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@881 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-18 11:11:56 +00:00
jhenstridge
236668b628 Expose glob matching and notregex matching in query_form.ezt.
Loosen some of the parameter validation to _validate_regex for
branch, file and who query parameters.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@880 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-18 06:37:31 +00:00
jhenstridge
f3cbf1e629 Add two new match types: notregex and glob. The "glob" match type is
implemented using fnmatch to translate it into a regular expression.

Refactor CreateSQLQueryString a little bit to split out join conditions.
Previously if you wanted to query files names A or B, it would generate
SQL like this:
  ((checkins.fileid=files.id AND files.file='A') OR
   (checkins.fileid.files.id AND files.file='B'))
Now it generates the shorter (and hopefully easier to optimise):
  (checkins.fileid=files.id) AND (files.file='A' OR files.file='B')
I'd change it to do INNER JOIN's, but apparently MySQL 3.22 doesn't
support them fully.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@879 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-18 05:41:53 +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
d8cc63ee4e Add simple querying support directly to the viewcvs script. This is
closer to the Bonsai query interface, and provides better integration
with the rest of viewcvs.

Fixed two bugs in cvsdb.py:
 - when loading up query results, set the checkin type on the Commit object
 - When sorting on file name or author, order by the name rather than ID.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@877 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-17 06:03:33 +00:00
jhenstridge
41c06a258e Fix file descriptor leak in standalone.py
Reported as http://sourceforge.net/tracker/?func=detail&aid=735455&group_id=18760&atid=318760


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@876 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-17 01:50:20 +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
4a479b303b Add copyright info to SVN mailer patch.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@874 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-16 16:31:21 +00:00
cmpilato
39beba2aa9 New patch for integration with Subversion's mailer.py script.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@873 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-16 16:25:59 +00:00
jhenstridge
4d6369388e Remove the svn_parent_path config value, and replace it with a root_parents
config value, which can handle CVS repositories as well as Subversion ones.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@872 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-16 15:43:01 +00:00
cmpilato
648ac31eb3 * viewcvs/lib/viewcvs.py
(list_roots): Make the roots hash values into tuples, adding the roottype.
  (common_template_data): Make the 'roots' list items into hashes that
    carry the root names and types.

* viewcvs/templates/include/header.ezt
  Split the list of repositories up into CVS ones and Subversion ones
  using optgroups.  Note the super-cool single pass over the roots,
  appending options to variables created on-the-fly.  Have I mentioned
  how much I love James Henstridge today?


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@871 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-16 14:11:55 +00:00
jhenstridge
59f7ac841a Fix the same issue in view_log(). Was mentioned in the same bug report
as the view_directory() one.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@870 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-16 14:05:14 +00:00
jhenstridge
fc86389a25 s/query_dict/request.query_dict/ in view_directory() to fix traceback
when using pages.  Reported in the bug tracker as:
  http://sourceforge.net/tracker/index.php?func=detail&aid=953892&group_id=18760&atid=118760


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@869 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-16 14:03:10 +00:00
jhenstridge
d428e9fa2e - Add svndbadmin script, which can be used to add Subversion revision
information to the Bonsai checkin database.
- Get viewcvs-install to install the new script.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@868 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-16 11:53:48 +00:00
rey4
19866deb18 Update windows README file
* windows/README
    add link for downloading subversion python bindings binaries

    remove mention of cvsnt bugs. they've all been either fixed or
    worked around, and the cvsnt bugzilla database is now deleted

    fix a spelling


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@867 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-01 23:51:45 +00:00
cmpilato
1b68297aff Makin' things purtier. Patch by James Henstridge <james@jamesh.id.au>.
* viewcvs/templates/log_table.ezt
  Set the HTML class attribute to vc_header_sort for the header of the
  sort column.  Change the tags around the log message from
  <i><pre>...</pre></i> to <pre><i>...</i></pre>.  Since <pre> is a
  block level element and <i> is an inline element, the old nesting
  results in an extra block after the message in the table cell.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@866 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-07-01 20:56:38 +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
7b8eb7639e Instead of sending colored diffs to the diff.ezt template, and raw
diffs to their own text/plain output, templatize all diffs.  By
default now, all diffs will go through diff.ezt (which has been
updated to handle it).  Only if the new 'makepatch' boolean CGI flag
is set will diffs be sent directly as text/plain, non-templatized
output.

* viewcvs/lib/viewcvs.py
  (_legal_params): Add new 'makepatch' boolean parameter.
  (check_freshness): Fix a speeling eror.
  (MarkupPipeWrapper.__init__): Add 'htmlize' parameter, and use it.
  (human_readable_diff): Lose the 'request', 'sym1', and 'sym2'
    parameters.  Now return the parsed dates and DiffSource object
    instead of populating a data dictionary and completely generating
    the page.
  (spaced_html_text): Use an intermediate variable for readability.
  (raw_diff): New.
  (view_diff): Honor the new 'makepatch'.  Update calls to
    human_readable_diff(), and make use of raw_diff().  Do all page
    generation for diffs here now.  Adds a new 'raw_diff' data
    dictionary item, useful for testing raw vs. colored, as well as
    for positioning that raw diff output in the template.

* templates/diff.ezt
  Use the new 'raw_diff' data dictionary item to position raw diff
  output in the template.  Update the diff form to allow for the
  generation of traditional "patch-ish" raw diff output.

* templates/include/diff_form.ezt
  Allow for the generation of traditional "patch-ish" raw diff output.

* website/styles.css
  (vc_raw_diff): New style class.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@864 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-06-22 14:37:11 +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
e8dc91b483 Fix the description of http_expiration_time.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@862 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-06-21 19:34:38 +00:00
cmpilato
4d8b46e2c8 Bang out a 'revision' view for the svn_ra module. Soooo incomplete,
sooo hard a problem to solve efficiently.

* viewcvs/lib/vclib/svn_ra/__init__.py
  (_rev2optrev): Fix use of 'if foo' when I mean 'if foo is not None'.
  (ChangedPath): New class.
  (LastHistoryCollector.__init__): Remove uninteresting 'pass'.
  (LastHistoryCollector.add_history): Add 'paths' and 'pool'
    arguments, and now at least do some semblance of support for
    dealing with those paths.
  (LastHistoryCollector.get_history):
  (_get_rev_details): Was _get_revision_info().  Now uses the
    LastHistoryCollector.add_history callback directly.  Callers changed.
  (get_revision_info): New.
  (SubversionRepository.get_dirents): Fix a dirent caching bug.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@861 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-06-14 16:14:45 +00:00
cmpilato
ac8c9d303c Add cache expiry support to ViewCVS. Patch by James Henstridge
<james@daa.com.au>.

* standalone.py
  (StandaloneServer.header): Fix some status handling stuff.

* viewcvs.conf.dist
  Add default value for new http_expiration_time option.

* lib/config.py
  (Config.set_defaults): Set default value for new
  http_expiration_time

* lib/viewcvs.py
  (check_freshness): Add cache control headers using the configured
    expiration times.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@860 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-06-14 15:52:41 +00:00
rey4
8b85373685 Remove workaround for CVSNT bug 188, which was fixed in version 2.0.12
* lib/vclib/bincvs/__init__.py:
  (_get_logs):
    simplify filename checking

  (_path_ends_in):
    removed


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@859 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-06-06 03:08:16 +00:00
rey4
ea73dfb7a3 Fix bugs #911437 and #922679 caused by newer versions of cvsnt using forward
slashes instead of backslashes in outputted paths.

(_parse_log_header, _parse_co_header):
  deal with forward slashes in paths outputted by cvsnt rcs utilities

(BinCVSRepository.openfile):
  fix uninitialized variable error in raise statement


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@858 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-06-06 02:46:49 +00:00
cmpilato
8f9c8de036 Make ViewCVS more cache-friendly. Patch by James Henstridge
<james@daa.com.au>.

* lib/viewcvs.py
  (check_freshness): New.
  (MarkupBuffer.close): New.
  (MarkupPipeWrapper.close): New.
  (MarkupPipeWrapper.__del__): Call own close() function now.
  (MarkupEnscript.close): New.
  (MarkupEnscript.__del__): Call own close() function now.
  (view_markup, view_log, view_diff): Call new check_freshness() function.
  (view_doc): Gut caching code and use check_freshness() instead.

* lib/sapi.py
  (CgiServer): Fix handling of 304's in IIS.

* standalone.py
  Now purge the environment of HTTP_* variables before setting our
  own.  Also, perhaps set the 'HTTP_IF_MODIFIED_SINCE' and
  'HTTP_IF_NONE_MATCH' variables.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@857 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-06-03 15:42:04 +00:00
cmpilato
f0b96a1617 Fix a bunch of pool usage problems with ViewCVS/Subversion.
* viewcvs/lib/vclib/svn/__init__.py
  (_fetch_log): Now accept a 'pool' parameter.
  (FileContentsPipe): Was StreamPipe().
  (FileContentsPipe.__init__): Instead of taking a stream, accept the
    root, path, and a pool.  Use a subpool of the pool for the stream
    creation.
  (FileContentsPipe.__del__): New.
  (SubversionRepository.__init__): Make a scratch subpool that
    operations can safely use and clear.
  (SubversionRepository._scratch_clear): New convenience function.
  (SubversionRepository.itemtype, SubversionRepository.listdir): Use
    and clear the scratch pool.
  (SubversionRepository.filelog): Update call to _fetch_logs().  Use
    and clear the scratch pool.
  (SubversionRepository.openfile): Update call to FileContentsPipe().
    Use and clear the scratch pool for the call to _get_last_history_rev().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@856 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-06-01 19:43:51 +00:00
cmpilato
da2822ecf0 Sending caching headers back to the browser for static content to
reduce roundtrips.  Patch by James Henstridge <james@daa.com.au>.

* viewcvs/lib/viewcvs.py
  (copy_stream): Use a slightly different mechanism for falling back
    to sys.stdout (for standalone.py).
  (view_doc): Send Last-modified headers for static content.

* viewcvs/standalone.py
  Calculate the modification time of the Apache icons module.
  (StandaloneServer.do_GET): Send that modification time.
  (StandaloneServer.header): Send custom headers.

* viewcvs/lib/sapi.py
  (CgiServer.addheader, AspServer.addheader, ModPythonServer.addheader): New.
  (CgiServer.header): Fix the way statuses are returned.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@855 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-05-24 22:57:30 +00:00
cmpilato
0ccadb2681 Fix a typ-o in yon copyright block.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@854 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-05-18 20:15:30 +00:00
cmpilato
6e6c604a94 Update the upgrade docs.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@853 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-05-14 15:32:49 +00:00
cmpilato
6af773b46b * viewcvs/lib/viewcvs.py
(view_directory): Do mime_type detection of files.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@852 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-05-14 15:21:10 +00:00
cmpilato
db610d9a21 * viewcvs/lib/viewcvs.py
(view_directory): Expose file sizes (when available) in the
    directory view.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@851 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-05-13 04:29:08 +00:00
cmpilato
9d63323c24 Oops. Forgot to actually add the stylesheet.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@850 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-05-12 14:58:57 +00:00
cmpilato
71b16e1321 *** empty log message ***
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@849 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-05-12 01:46:43 +00:00
cmpilato
af1f78ba83 * viewcvs/templates/include/dir_footer.ezt
Use <optgroup> tags to group branches and tags.  Patch by James
  Henstridge <james@daa.com.au>.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@848 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-05-11 06:53:52 +00:00
cmpilato
a0bc4d071b * viewcvs/lib/viewcvs.py
(common_template_data): Expose request.pathtype as a generally
    available template variable.  (Have I mentioned today how much I
    dislike per-template data dictionary items?)

* viewcvs/templates/log_table.ezt
* viewcvs/templates/log.ezt
  Use the pathtype variable to determine whether or not to show
  file-only stuff like diff and download options.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@847 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-05-10 15:37:11 +00:00
cmpilato
cfe3d1ea29 Fix a brain-O. "filter_path" is the *opposite* of "show_all_logs".
Duh.  Stop using filter_path and (failing at) translating between the
senses here.

* viewcvs/lib/vclib/svn_ra/__init__.py
  (LogCollector.__init__): Drop the 'options', take explicit 'show_all_logs'.
  (LogCollector.add_log): Update for new variables.  Also, fix some
    logic so this works when we aren't showing all logs, too.
  (SubversionRepository.filelog): Parse the options here, and pass to
    the LogCollector().

* viewcvs/lib/vclib/svn/__init__.py
  (NodeHistory.__init__, NodeHistory.add_history, _get_history): Stop
    using 'filter_path'; use 'show_all_logs' instead.

* viewcvs/lib/viewcvs.py
  (view_log): Make showing all directory logs default to 0.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@846 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-05-10 14:56:09 +00:00
cmpilato
e075e20fa7 More directory log view fixes.
* viewcvs/lib/vclib/svn/__init__.py
  (NodeHistory.add_history): Use subpools in this loop.

* viewcvs/lib/vclib/svn_ra/__init__.py
  (LogCollector.add_log): Fix an off-by-one error.  The path for this
    revision is self.path *before* we find the previous path.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@845 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-05-10 14:08:50 +00:00
cmpilato
bcd7a406aa * viewcvs/lib/vclib/svn/__init__.py
(NodeHistory.add_history): Fixes for support for directory log
    filtering.  Don't filter out copy revisions.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@844 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-05-10 14:01:12 +00:00
cmpilato
d2a8e86357 Fix the root-change mechanism I broke recently.
* viewcvs/lib/viewcvs.py
  (Request.get_link): Allow where == '' as a way to indicate that you
    want to see the root directory (since None means "use self.where").
  (common_template_data): Generate the right URL for changing roots.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@843 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-05-07 15:40:22 +00:00
cmpilato
242b41d9c1 Fix Bug #949445 (premature <pre> tags in large files)
* viewcvs/lib/viewcvs.py
  (MarkupPipeWrapper): Rewrite this class so that it actually works.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@842 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-05-07 15:23:23 +00:00
cmpilato
459675943c Close Bug #847437.
* viewcvs/website/index.html
  Say that we require 1.5.2, not 1.5 (which eliminates the need to
  point out the MySQL dependency).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@841 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-05-06 21:38:35 +00:00
cmpilato
97d9b20adf Get support for the 'show_all_dir_logs' option (specifically, the
"don't show all dir logs") working the svn_ra layer.  In fact, this
sucker is now more accurate as far as revision choices go than the
'svn' module.

* viewcvs/lib/vclib/svn_ra/__init__.py
  (LogCollector.__init__): Deal with None paths, and ensure leading slashes.
  (LogCollector.add_log): Uncomment and fix path filtering code.
  (_fetch_log): Remove.
  (SubversionRepository.filelog): Move contents of _fetch_log into
    here, and then do something that in unheard of -- CALL
    SVN_CLIENT_LOG WITH THE PARAMS IN THE RIGHT ORDER!


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@840 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-05-06 17:00:28 +00:00
cmpilato
c20560b1fc Add basic support for Subversion directory log viewing in ViewCVS.
NOTE: This work is not yet finished for the 'svn_ra' vclib module.

* viewcvs/lib/vclib/svn/__init__.py
  (NodeHistory.__init__): Add fs_ptr and filter_path arguments.
  (NodeHistory.add_history): If filtering, only add the history item
    if the path truly change in that revision.
  (_get_history): Add 'options' argument, and use it to decide if we
    need to filter out bubble-up-only directory logs, as well as
    whether or not to cross copies.
  (_fetch_log): Was fetch_log.  Add 'options' argument, passed to
    _get_history.
  (SubversionRepository.filelog): Update call to _fetch_log.

* viewcvs/lib/vclib/svn_ra/__init__.py
  (_compare_paths): New path comparison function (ported from
    Subversion's C-composed svn_path_compare_paths)
  (LogCollector): New class for doing what the old inline _log_cb
    function did.
  (_fetch_log): Was fetch_log.  Add 'options' argument.  Now use the
    new LogCollector class.
  (SubversionRepository.filelog): Update call to _fetch_log.

* viewcvs/lib/viewcvs.py
  (Request.run_viewcvs): Don't set 'cross_copies' as an attribute of
    the repository any more.  We use the vclib interface options
    params.
  (view_log): Re-work this sucker to handle requests for directory
    logs in Subversion.  Also, pass the cross_copy option here.
  (view_directory): Set the rev_href for Subversion directories to the
    log view href.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@839 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-28 16:21:51 +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
cmpilato
1d6743ab98 * viewcvs/templates/revision.ezt
Re-add the "previous" and "next" buttons on the revision view.
  Patch (mostly) by Guy Maor <guy@extreme-da.com>.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@837 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-28 14:53:22 +00:00
cmpilato
5995f83c4c Some more ViewCVS fixes and tweaks.
* viewcvs/templates/diff.ezt
  Setup template defines before include header.ezt.

* viewcvs/lib/viewcvs.py
  (view_revision_svn): Add 'rev' to the diff_href.

* viewcvs/templates/dir_alternate.ezt
  Fix the filename links to go to the log view again (apparently I
  accidentally clobbered these recently, though I must say, the
  navigation seems entirely unintuitive to me this way...).

* viewcvs/templates/revision.ezt
  Tweak the display of the log message a little big.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@836 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-24 17:38:31 +00:00
cmpilato
da21434ef0 Some bug fixes as suggested (in great detail, just short of a patch)
by Dirk Lemstra <dirk.lemstra@atosorigin.com>.  Also, add some stuff
to the generally-available-to-all-templates dataset.  And finally,
re-work all the templates for consistent look and feel.

I can die now.

* viewcvs/lib/viewcvs.py
  (common_template_data): Expose the 'where', 'roottype', and
    'rootname' Request members, and the 'nav_path', to all views.
    Also, do the root selection stuffs ('roots', 'change_root_action',
    'change_root_hidden_values').
  (nav_header_data): No longer explicitly add 'nav_path' to the data
    dictionary.
  (_dir_url): For Subversion, supply the revision number to the
    generated links.
  (view_directory): Include the revision when generating log view
    URLs.  Also, expose a 'tree_rev_href' data item for linking to the
    revision view.  No longer explicitly add 'roottype', 'where', and
    'current_root' to the data dictionary.  No longer do the root
    selection stuff here, either.
  (view_log): No longer explicitly add 'roottype', 'where', and
    'current_root' to the data dictionary.
  (human_readable_diff): No longer explicitly add 'where' to the data
    dictionary.
  (view_markup, view_revision): No longer explicitly add 'roottype' to
    the data dictionary.

* viewcvs/website/upgrading.html
  Document the changes.

* viewcvs/website/help_rootview.html
  Add a missing "<br>".

* viewcvs/templates/annotate.ezt
* viewcvs/templates/graph.ezt
* viewcvs/templates/log.ezt
* viewcvs/templates/log_table.ezt
* viewcvs/templates/markup.ezt
* viewcvs/templates/query.ezt
* viewcvs/templates/revision.ezt
* viewcvs/templates/include/dir_header.ezt
* viewcvs/templates/include/footer.ezt
* viewcvs/templates/include/header.ezt
  Beat the heck outta these templates until they all reference
  header.ezt and footer.ezt (except for error.ezt), and they all
  present a basically consistent interface across all views.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@835 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-22 15:40:01 +00:00
cmpilato
c94bb1347f * viewcvs/tparse/tparsemodule.cpp
Fix all instances of "if(!rv) { Py_DECREF(rv); }" mishap.  We should
  decrement the reference count for the value only if it is *not*
  NULL.  Erik Huelsmann oopsed.  I oopsed more for not reviewing the
  patch before application.  James Henstridge <james@daa.com.au> wins
  for paying attention.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@834 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-21 15:48:48 +00:00
cmpilato
0f09f6c241 Templatize the annotate view!
* viewcvs/lib/viewcvs.py
  (view_annotate): Now use blame.BlameSource() class for doing annotations.

* viewcvs/lib/blame.py
  (BlameSource, BlameSequencingError): New classes.
  (make_html): Re-work to use the use BlameSource code.

* viewcvs/lib/config.py
  (Config.set_defaults): No longer set self.templates.footer.

* viewcvs/viewcvs.conf.dist
  (templates.footer): Removed.

* viewcvs/templates/annotate.ezt
  Re-work this template to make use of the newly exposed blame data,
  and the fabulous new EZT assignment commands!

* viewcvs/website/upgrading.html
  Document this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@833 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-21 05:08:12 +00:00
cmpilato
9c5c43b625 Implement an assignment mechanism in EZT, a new [define variable][end]
construct.  Patch by James Henstridge <james@daa.com.au>, tweaked to
conform with Greg Stein's review, and stripped of the template changes
that made use of the new functionality by C. Michael Pilato (that's me).

* viewcvs/lib/ezt.py
  import cStringIO, and failing that, import StringIO.
  (_block_cmd_specs): Add 'define' to the list of block specs.
  (Template.generate): Init defines member.
  (Template._parse): Don't prepare references for 'define' commands.
  (Template._cmd_define): New.
  (_get_value): Look for items in the defines dictionary before
    falling back to the data dictionary.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@832 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-21 03:41:34 +00:00
cmpilato
5bd3435a05 Fix the default value for the footer template location. Patch by James
Henstridge <james@daa.com.au>.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@831 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-21 03:11:03 +00:00
cmpilato
a8c5db6248 Templatize the markup view.
* viewcvs/lib/viewcvs.py
  (html_footer): Remove.
  (view_annotate): Generate the footer data -- the only remaining
    place where template usage is impure...
  (retry_read): New.
  (copy_stream): Rename 'fp' to 'src', and add an optional 'dst'
    parameter.  Move reading code into retry_read().
  (markup_stream_default, markup_stream_enscript): Remove.
  (markup_stream_python): Return a MarkupBuffer instance.
  (markup_stream_python): Return a MarkupPHP instance.
  (MarkupBuffer, MarkupPipeWrapper, MarkupEnscript, MarkupPHP): New
    classes for implementing file-like markup objects.
  (view_markup): Use new Markup classes.
  (generate_tarball): Don't trap an unused status code.

* viewcvs/templates/markup.ezt
  Reference the new [markup] dictionary object, and include the footer.ezt.

* viewcvs/templates/include/header.ezt
  White background, please.

* viewcvs/website/upgrading.html
  Note the new [markup] variable.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@830 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-20 16:40:12 +00:00
cmpilato
d103342f27 * viewcvs/viewcvs.conf.dist
(options.cross_copies): Make this default to 1 now.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@829 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-20 14:41:35 +00:00
cmpilato
fed9fcc893 Extend Sink and parsers to pass more of rcs admin data. Patch by
Erik Huelsmann <e.huelsmann@gmx.net>.

* viewcvs/lib/vclib/ccvs/rcsparse/common.py
  (Sink.set_expansion): New member function. Called to pass
   default expansion mode.
  (Sink.set_locking): New member function. Function is called
   to signal strict locking.
  (Sink.set_locker): New member function. Set locker for a given revision.
  (_Parser.parse_rcs_admin): parse 'access', 'expand', 'locks' and
   'strict' token values passing the result(s) into the sink.

* viewcvs/lib/vclib/ccvs/rcsparse/default.py
  (Parser.parse_rcs_admin): parse 'access', 'expand', 'locks' and
   'strict' token values passing the result(s) into the sink.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@828 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-20 14:32:54 +00:00
cmpilato
a1aa2423d3 Stop potential memory leak by DECREF-ing the return value from
PyObject_CallMethod.  Patch by Erik Huelsmann <wiskid@gmx.net>.

* viewcvs/tparse/tparsemodule.cpp
  Catch return value from PyObject_CallMethod and DECREF when appropriate.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@827 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-20 14:28:15 +00:00
cmpilato
f2c4a87740 * viewcvs/viewcvs.conf.dist
(footer): Update the default location for footer.ezt (now in the
    include/ subdir).

* viewcvs/website/upgrading.html
  Add a note about rearranged template locations.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@826 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-15 21:23:02 +00:00
cmpilato
cf04879462 Oops! Missed an update of a relocated template.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@825 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-15 20:37:59 +00:00
cmpilato
ba43e61754 Re-arrange the templates directory a bit.
* viewcvs/templates/dir_footer.ezt
* viewcvs/templates/dir_header.ezt
* viewcvs/templates/footer.ezt
* viewcvs/templates/header.ezt
  Move all of these...

* viewcvs/templates/include/dir_footer.ezt
* viewcvs/templates/include/dir_header.ezt
* viewcvs/templates/include/footer.ezt
* viewcvs/templates/include/header.ezt
  ...to here.

* viewcvs/templates/annotate.ezt
* viewcvs/templates/diff.ezt
* viewcvs/templates/dir_alternate.ezt
* viewcvs/templates/directory.ezt
* viewcvs/templates/graph.ezt
* viewcvs/templates/log.ezt
* viewcvs/templates/log_table.ezt
* viewcvs/templates/markup.ezt
* viewcvs/templates/query.ezt
  And then update the [include] items in these files to note the new
  locations of the aforementioned relocated templates.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@824 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-15 05:57:57 +00:00
cmpilato
1b8e7c9aa5 Do some work to expose Subversion directory commit info (logs,
revision, authors), cleanup some unnecessary data dictionary cruft,
and rework the default directory templates a bit.

* viewcvs/lib/viewcvs.py
  (view_directory): Do the Right Thing for Subversion directory log
    messages.  Merge the 'cvs' and 'state' data fields for CVS.
    Populate rev_href for Subversion directories.

* viewcvs/templates/directory.ezt
* viewcvs/templates/dir_alternate.ezt
  Track data dictionary changes, and tweak the templates to always
  show name, rev, author, date -- now only log is conditional on
  show_logs (go figure).  Also, core the common header and footer
  parts of these files into...

* viewcvs/templates/dir_header.ezt
* viewcvs/templates/dir_footer.ezt
  ...these new include files.

* viewcvs/website/upgrading.html
  Update with notations about these changes.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@823 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-15 05:27:55 +00:00
cmpilato
f9b6bd3f05 Some tarball-generation fixes. Thanks to Ulrich Goertz <debian@g0ertz.de>
for whipping me into action.

* viewcvs/lib/viewcvs.py
  (_strip_suffix): If the "suffix" is the whole last path component,
    remove that component altogether (rather than leaving an
    empty-string component after the strip)
  (generate_tarball): Include timestamps for directories now.  For
    CVS, directory timestamps will be the youngest of the dates for
    files in that directory.  For Subversion, same routine except that
    files and subdirs datestamps count.
  (download_tarball): Don't include in a tarball all the empty
    directories between the root of the repository at the directory
    being tarballed.  Just stick the tarballed directory into the top
    of the tarball, either by its own name (if we know it) or by the
    configured name of that repository root (if the top-most directory
    is the to-be-tarballed directory).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@822 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-13 21:59:52 +00:00
cmpilato
f0ae4c61f9 Fix some line-length > 80 columnsness.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@821 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-13 21:59:24 +00:00
cmpilato
04426fdf30 * viewcvs/tparse/tparse.cpp
* viewcvs/tparse/tparse.h
* viewcvs/tparse/tparsemodule.cpp
* viewcvs/tparse/tparsemodule.h
  Massive tparse reindenting, reformatting, and spacing /
  capitalization fixes in messages.  Patch by Max Bowsher
  <maxb@ukf.net> (tweaked a little by cmpilato to ensure lines < 80
  characters).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@820 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-04-06 02:52:08 +00:00
cmpilato
aa65061e43 * viewcvs/lib/viewcvs.py
(Request.run_viewcvs): Look in the Attic/ for files in CVS URLs, and
    redirect on a 'hit'.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@819 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-03-31 21:56:22 +00:00
cmpilato
8b230d035a Patch by Max Bowsher <maxb@ukf.net> and Erik Huelsmann <e.huelsmann@gmx.net>.
* tparse/tparse.cpp
  (TokenParser::get): Write one less byte in case of
    @-sign-is-last-byte-in-buffer: the byte will be transferred to the
    start of the newly filled buffer.
  (tparseParser::parse_rcs_tree): Use correct pointer when
    constructing linked list.

* tparse/tparsemodule.cpp
  (PythonSink::define_revision): Don't leak PyString objects.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@818 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-03-30 14:21:25 +00:00
cmpilato
e2e32dcc0d Fix some memory leaks in the TParse code. Patch by Erik Huelsmann
<e.huelsmann@gmx.net>.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@817 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-03-29 15:59:17 +00:00
cmpilato
a5cf1fe9c9 * viewcvs/lib/viewcvs.py
(view_revision_svn): Fix a missing assignment that rendered a call
    to html_time() rather pointless.  Noticed by Lele Gaifax.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@816 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-03-27 20:25:54 +00:00
cmpilato
f948f2db3f Get 'forbidden' module support mostly working for Subversion.
* viewcvs/lib/viewcvs.py
  (Request.run_viewcvs): Move the forbidden path check until after a
    root-as-url-component redirect.
  (view_directory): Break out the forbidden path
    check so that Subversion and CVS paths get checked.
  (generate_tarball): Break out the forbidden path
    check so that Subversion and CVS paths get checked.  Also, fix
    usage of an uninstantiated variable.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@815 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-03-26 14:59:32 +00:00
cmpilato
56a4d4652b * lib/vclib/ccvs/rcsparse/common.py
(_Parser.parse_rcs_tree): Add notation about spec violation.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@814 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-03-18 20:45:33 +00:00
cmpilato
8a38080b25 * viewcvs/lib/vclib/svn/__init__.py
(_unparse_action): Remove this unused function.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@813 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-03-18 20:41:09 +00:00
cmpilato
1bfa20c8be * viewcvs/lib/vclib/ccvs/rcsparse/common.py
(_Parser.parse_rcs_tree): Support author which contain spaces.  It's
    a Windows CVS thing ... *shrug*.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@812 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-03-15 20:39:43 +00:00
cmpilato
8a8a587963 Subversion revisions might not have dates attached to them, and
ViewCVS assume otherwise.  Fix that (as best as can be expected).

Bug reported by Alejandro Ramirez <alejandro.ramirez@artmediacompany.com>.

* viewcvs/lib/vclib/svn/__init__.py
  (_datestr_to_date): Protect against None datestrings by return "now"
    when there's no valid to use.

* viewcvs/lib/vclib/svn_ra/__init__.py
  (_datestr_to_date): New (copied from the 'svn' module).
  (LastHistoryCollector._log_cb, get_logs): Use new _datestr_to_date()

* viewcvs/lib/viewcvs.py
  (view_markup, view_directory, view_log, view_revision_svn,
   view_diff, make_time_string): Watch out for missing dates.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@811 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-03-10 15:54:53 +00:00
cmpilato
b3e22e74e2 * viewcvs/lib/vclib/svn/__init__.py
(SubversionRepository.__init__): Carefully track how stuff is
    initialized so the __del__() method doesn't do bad stuff.
  (SubversionRepository.__del__): Only de-init stuff that got init-ed.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@810 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-03-09 16:26:16 +00:00
cmpilato
0b91db3a1b * viewcvs/lib/viewcvs.py
(view_log): Initialize the entry.branch_point and entry.next_main
    values to None, common to all VC systems.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@809 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-03-09 16:25:54 +00:00
cmpilato
ea1274a8b8 Fix markup-view <img> source URLs to contain the revision of the
resource.  Reported by Roland Schwingel <Roland.Schwingel@onevision.de>.

* viewcvs/lib/viewcvs.py
  (view_markup): Add the revision to the URL for image-type markup views.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@808 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-03-08 16:49:37 +00:00
cmpilato
fe97494fd0 Fix copyfrom links in the Subversion log view.
Patch mostly by Eike Bernhardt <eike-usenet@unorganized.net>.

* viewcvs/lib/viewcvs.py
  (Request.get_link): Don't lose the rev= parameter when building
    log-view URLs.
  (view_log): Include the copyfrom revision in the copyfrom URL.

* viewcvs/templates/log_table.ezt
* viewcvs/templates/log.ezt
  Don't tack on a revision bookmark to the copyfrom URL.  It's not
  likely to exist, and is now unnecessary anyway.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@807 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-03-08 16:41:37 +00:00
cmpilato
d57c96259e * viewcvs/lib/ezt.py
Import LongType from types, too.
  (_get_value): Handle conversion of LongType as well.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@806 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-02-20 18:20:59 +00:00
cmpilato
68bd35d7e1 * viewcvs/lib/viewcvs.py
(view_log): Populate the 'copy_rev' member.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@805 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-02-17 15:58:16 +00:00
cmpilato
1fc3dcf7a4 * lib/viewcvs.py
(_re_validate_number): Add '~' as an acceptable character in a CVS
    symbol.  CVS, after all, does allow such things.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@804 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-02-06 19:17:04 +00:00
cmpilato
5f5d0140de * viewcvs/lib/vclib/bincvs/__init__.py
(_parse_co_header): Stop using variables that don't exist.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@803 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-29 16:07:18 +00:00
rey4
3690e0b386 Fix problem with cvsdb and bincvs.fetch_log
* lib/vclib/bincvs/__init__.py
  (fetch_log):
    fix arg list

* lib/rlog.py
  (GetRLogData)
    take repository object as argument instead of cfg object

* lib/cvsdb.py
  (GetCommitListFromRCSFile):
    take repository object as argument instead of repository path

* tools/cvsdbadmin
  (CommandUpdate, CommandRebuild)
    create BinCVSRepository objects to pass to cvsdb functions

* tools/loginfo-handler
  (CommitFromFileData, GetUnrecordedCommitList)
    take repository object as arguments instead of repository path

  (ProcessLoginfo)
    create BinCVSRepository objects to pass to cvsdb functions


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@802 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-26 01:25:47 +00:00
rey4
f9cdf6b8ca Fix bug in svn_ra module
* lib/vclib/svn_ra/__init__.py
  (fetch_log):
    fix date conversion


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@801 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-25 23:09:59 +00:00
rey4
b5ffa5d06c Fix another bug in CVSNT workaround
* lib/vclib/bincvs/__init__.py
  (BinCVSRepository.openfile):
    fix _file_log call


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@800 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-25 22:58:41 +00:00
rey4
b01c037437 Get svn_ra module working again
* lib\vclib\svn_ra\__init__.py
  (created_rev):
    new function

  (LogEntry):
    removed

  (fetch_log):
    create Revision objects instead of LogEntries, and simplify return
    value

  (get_logs):
    set DirEntry.log_error property

  (SubversionRepository.listdir):
    add options argument to match rest of vclib library

  (SubversionRepository.dirlogs, filelog):
    add new vclib methods


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@799 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-25 19:29:00 +00:00
rey4
b826424b50 Get ccvs module in working state, and add "use_rcsparse" option to use
it instead of bincvs. It works for log pages, directory pages, markup
pages, checkouts, and tarball downloads, but not for diffs because vclib
doesn't currently have an interface for diffing.

* viewcvs.conf.dist
  (use_rcsparse):
    new option

* lib/config.py
  (Config.set_defaults):
    make use_rcsparse off by default

* lib/viewcvs.py
  (Request.run_viewcvs)
    import ccvs module instead of bincvs if use_rcsparse is enabled

  (markup_stream_enscript):
    check for eof() method on file objects before calling

* lib/vclib/bincvs/__init__.py
  (CVSRepository, BinCVSRepository):
    separate new base class CVSRepository out of BinCVSRepository.
    The new base class is shared with the ccvs module

  (BinCVSRepository.filelog, _file_log):
    move calls to rcs utilities out of _file_log() function and into the
    filelog() method. This way _file_log() can be shared with the ccvs
    module

  (Revision.__init__):
    add default argument values to simplify some calls in the ccvs module

  (_get_logs, _log_path):
    move some functionality out of _get_logs() into new _log_path()
    function, which is shared with ccvs

* lib/vclib/ccvs/__init__.py
  Lots of kludges added to this module to get it running again and taking
  advantage of functionality already implemented in bincvs. It's not
  pretty, but at least it works and is no longer out of date.

  (CCVSRepository, CVSRepository):
    delete old CVSRepository class, create new CCVSRepository class
    implementing the current vclib api

  (MatchingSink):
    new sink superclass

  (InfoSink):
    updated to work with tags and default branches instead of always
    finding latest trunk revisions. Also changed to work with DirEntry
    objects

  (TreeSink):
    updated to work with Revision objects

  (StreamText.next_revision, StreamText):
    remove "next_revision" debugging method and all references to it

  (COSink):
    reimplement with a simpler algorithm

* lib/vclib/ccvs/rcsparse/common.py
  (Sink.admin_completed):
    new callback

  (_Parser.parse):
    call new callback


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@798 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-25 19:25:30 +00:00
rey4
c78051dd63 Put underscores in names of internal bincvs functions
* lib/vclib/bincvs/__init__.py
  (lots of functions)
    rename


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@797 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-25 19:06:53 +00:00
rey4
0ed400de63 Tweak vclib DirEntry and Revision objects.
- Revision class is now defined in vclib
- DirEntry class has new log_error boolean member to replace use of
  bincvs._FILE_HAD_ERROR constant.
- In CVS, DirEntry.state string member is replaced by boolean DirEntry.dead

* lib/vclib/__init__.py
  (Repository.dirlogs):
    add documentation

  (Revision):
    new class

* lib/vclib/bincvs/__init__.py
  (Revision):
    inherit from new vclib.Revision class

  (get_logs, _FILE_HAD_ERROR):
    stop using _FILE_HAD_ERROR constant

  (parse_log_entry, get_logs):
    use "dead" properties instead of "state" properties on Revision and
    DirEntry objects

  (_newest_file):
    bugfix, call _check_path() to make sure returned file is accessible

* lib/rlog.py
  (GetRLogData):
    use Revision.dead member instead of Revision.state

* lib/vclib/svn/__init__.py
  (Revision, LogEntry):
    rename LogEntry class to Revision and inherit from vclib.Revision

  (NodeHistory.add_history):
    trim beginning slashes from subversion paths passed to this callback

  (_log_helper):
    call new Revision constructor

  (fetch_log):
    simplify return values

  (get_logs):
    set DirEntry.log_error member

  (SubversionRepository.filelog):
    update for changed fetch_log function, remove some kludges

* lib/viewcvs.py
  (Request.run_viewcvs, bincvs):
    import bincvs module as neccessary instead of importing globally

  (view_markup, sort_file_data, view_directory, view_log,
   generate_tarball):
    update to deal with changed DirEntry and Revision members


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@796 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-25 19:05:08 +00:00
rey4
3623c5476b Add new repository methods to vclib.
* lib/vclib/__init__.py
  (Repository):
    update docstrings

* lib/vclib/bincvs/__init__.py
  (BinCVSRepository.listdir):
    add options argument

  (BinCVSRepository.openfile):
    fix bug in cvsnt workaround

  (BinCVSRepository.dirlogs, BinCVSRepository.filelog):
    new methods

  (_sort_tags):
    removed

  (get_logs):
    simplify arguments and return value

* lib/vclib/svn/__init__.py
  (SubversionRepository.listdir):
    add options argument

  (SubversionRepository.dirlogs, SubversionRepository.filelog):
    new methods

* lib/viewcvs.py
  (view_markup, view_log):
    use new repos.filelog() method

  (icmp):
    new function

  (view_directory, generate_tarball):
    use new repos.dirlogs() method

  (read_log):
    removed

  (download_tarball):
    update call to generate_tarball


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@795 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-25 18:37:42 +00:00
rey4
b8f73030d6 Merge generate_tarball_cvs and generate_tarball_svn functions.
* lib/viewcvs.py
  (generate_tarball, generate_tarball_cvs, generate_tarball_svn):
    combine svn and cvs functions into a new function

  (download_tarball):
    call new generate_tarball function

* lib/vclib/svn/__init__.py
  (StreamPipe.read):
    support calls that don't specify length


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@794 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-22 04:53:09 +00:00
rey4
8b7b732983 Refactoring and rearranging in the bincvs module.
* lib/vclib/bincvs/__init__.py
  (BinCVSRepository, DirEntry):
    move these class definitions to top of file

  (rcs_popen, BinCVSRepository.rcs_popen):
    make standalone rcs_popen function into a repository method

  (BinCVSRepository._newest_file, _newest_file):
    make _newest_file method into standalone function

  (path_ends_in):
    move to bottom of file

  (BinCVSRepository.openfile, file_log, get_logs, fetch_log):
    update calls to rcs_popen, _newest_file

* lib/viewcvs.py
  (view_diff, generate_tarball_cvs(out):
    update calls to rcs_popen


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@793 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-22 03:46:30 +00:00
rey4
5154ff3d3e Some refactoring in BinCVS module.
* lib/vclib/bincvs/__init__.py
  (BinCVSRepository.openfile, parse_co_header):
    move co parsing code out of openfile and into new parse_co_header
    function

  (BinCVSRepository._getrcsname, BinCVSRepository.itemtype):
    remove _getrcsname() method, replace call in itemtype()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@792 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-22 02:49:44 +00:00
rey4
9ec0064115 Simplify CVSNT workaround in BinCVSRepository.openfile using new file_log
function.

* lib/vclib/bincvs/__init__.py
  (Revision.__init__):
    add new "dead" boolean member. it would be nice to start using this in
    the other parts of the code instead of the "state" string member

  (match_revs_tags):
    set new "undead" properties pointing to previous non-dead revisions

  (file_log):
    bugfix, had been using invalid exception type

  (BinCVSRepository.openfile):
    reimplement CVSNT workaround in terms of file_log()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@791 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-22 02:20:24 +00:00
rey4
3fa077ff75 Move bulk of read_log function out of viewcvs.py and into the bincvs
module.

* lib/vclib/bincvs/__init__.py
  (file_log):
    new function mostly made up of code cut from read_log

* lib/viewcvs.py
  (read_log):
    call file_log function

  (view_markup, view_log):
    update calls to read_log


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@790 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-22 01:48:59 +00:00
rey4
ac551b0fa9 fix broken link on subversion log page
* lib/viewcvs.py
  (view_log):
    fix links to revision pages


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@789 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-21 22:56:09 +00:00
rey4
05888638d0 Make view/download links on log and markup pages simpler and more uniform.
I didn't like a number of things about previous interface, like how it:
 - inconsistently made some links pop up and others open in the same window
 - used inconsistent terminology, "view" links lead to markup pages in some
   cases and direct downloads in others
 - omitted useful links, there were no direct download links for images and
   no markup or "as text" links for "nonviewable" files (like text files
   that ending in .doc)
 - inserted extraneous punctuation, in lines like
   "Revision 1.1 - , (view/download)"

There's some more information about this change posted on the dev list:
http://mailman.lyra.org/pipermail/viewcvs-dev/2004-January/001337.html


* lib/viewcvs.py:
  (view_markup, view_log):
    set new template variables that have the same names and functions on
    all pages: "view_href", "download_href", and "download_text_href"

* templates/log.ezt
* templates/log_table.ezt
* templates/include/branch.ezt
* templates/markup.ezt
    use new template variables and get rid of pop-up links

* templates/dir_alternate.ezt
* templates/directory.ezt
    get rid of pop-up links

* website/upgrading.html
    describe changed variables


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@788 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-21 22:50:26 +00:00
rey4
3d9843aba9 Remove duplicate code from CVS and Subversion implementations of view_log
* lib/viewcvs.py
  (augment_entry, view_log_cvs, view_log_svn):
    removed

  (view_log)
    add functionality from removed functions


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@787 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-21 05:25:31 +00:00
rey4
e5588cbba1 Move all the code that manipulates CVS revision numbers out of viewcvs.py
and into the bincvs module, unfortunately rewriting most of it in the
process. I thought I finished this before, but some code in view_markup and
augment_entry slipped below my radar.

The main difference between the new code and the old code is that the old
code used string representations of revision numbers and manipulated them
with string operations and regular expressions while the new code converts
all revision numbers into tuples of integers and manipulates them in that
form.

This change also restores some minor ViewCVS 0.9.2 behaviors that I
inadvertently changed before:

- "Branch" fields on log pages list "MAIN" tags instead of skipping them
- The "Default branch" field on the top of log pages lists all names for a
  default branch instead of picking one randomly
- Viewing a directory with "only_with_tag=HEAD" shows default branch
  revisions, not just trunk revisions

* lib/vclib/bincvs/__init__.py
  (LogEntry, LogHeader, LogError, TagInfo):
    removed classes

  (Revision):
    new class, replaces LogEntry

  (Tag):
    new class, replaces TagInfo

  (match_rev_tags, add_tag, remove_tag):
    new functions for manipulating revisions and tags

  (_revision_tuple, _tag_tuple, _dict_list_add):
    new internal functions

  (parse_log_header):
    return multiple values directly instead of packing them into a
    LogHeader object

  (parse_log_entry, _sort_tags, BinCVSRepository.openfile):
    use Revision and Tag classes instead of LogEntry and TagInfo classes

  (get_logs):
    fix handling of HEAD tag

  (fetch_log):
    stop returning "head" field from rlog, it's not useful for anything

* lib/viewcvs.py
  (prep_tags, logsort_date_cmp, logsort_rev_cmp)
    tweaked to work with bincvs.Tag and bincvs.Revision objects

  (find_first_rev):
    removed

  (view_markup, augment_entry):
    change to deal with Revision and Tag objects, remove some revision
    number computation

  (read_log):
    don't do revision/tag matching here, instead call match_revs_tags
    update filtering code and some comments

  (view_log_cvs):
    fix default branch code to display all known branch names

* lib/rlog.py
  (GetRLogData):
    update for changed bincvs.fetch_log


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@786 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-21 00:50:17 +00:00
cmpilato
b69d1b42fe * lib/viewcvs.py
(view_directory): Check "file.log is not None" instead of just
    "file.log".  This is one aspect of Python I find a bit stupid.
    Also, don't build cvsgraph href's for Subversion views.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@785 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-20 19:34:36 +00:00
cmpilato
fdafc736d1 * lib/vclib/svn/__init__.py
(created_rev): New.

* lib/viewcvs.py
  (view_directory): Set 'tree_rev' to the results of created_rev()
    called on the current directory.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@784 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-01-19 21:42:33 +00:00
cmpilato
403d5c8f73 * viewcvs/lib/viewcvs.py
(view_diff): Catch Subversion FS_NOT_FOUND errors from
    diffobj.get_pipe() so we can return a '400 Bad Request'.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@783 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-12-12 10:39:10 +00:00
rey4
fd97298424 Fix bug #858414 "ValueError: unconverted data remains: 'UTC'" reported
by Jordan Russell

* lib/compat.py
  (cvs_strptime):
    stop trying to pass time zone information to strptime. Apparently
    the glibc implementation of this function doesn't support it.
    Instead just replace the returned is_dst value with 0.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@782 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-12-12 00:22:35 +00:00
rey4
c4d2c8e0a8 Minor fix in link constructing function. Doesn't have any effects
currently visible to users

* lib/viewcvs.py
  (Request.get_link):
    prevent tarball links from having their 'only_with_tag' parameters
    overwritten with the current sticky value


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@781 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-12-11 00:38:39 +00:00
rey4
0d905fe2d0 Temporary workaround for another CVSNT bug. The problem was reported
in issue #829519 "Viewing removed file causes pyhton exception" by
Hartmut Honisch.

* lib/vclib/bincvs/__init__.py
  (BinCVSRepository.openfile):
    work around cvsnt's co not producing any output when we request
    a dead revision


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@780 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-12-11 00:18:20 +00:00
rey4
6fccdc0195 Fix bug #849834 "Download tarball doesn't respect tag selected"
reported by Aaron Linville.

* lib/viewcvs.py
  (Request.get_link):
    add "only_with_tag" parameters to tarball download links


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@779 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-12-10 12:21:53 +00:00
rey4
22a713c5d6 Fix bug #845957 "exception when viewing a revision without log"
reported by Hernan Martinez Foffani.

* lib/viewcvs.py
  (view_markup):
    set default value for "tag" template variable


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@778 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-12-10 12:12:20 +00:00
rey4
d7d0a03ecc Fixed bug #844810 reported by Jordan Russell. It was caused by my recent
tinkering in the get_logs() function. I made the incorrect assumption
that rcs files used branch numbers with 0's in them (like 1.2.0.3) when
no changes had yet been made on the branch, and branch numbers without
0's like (1.2.3) for branches that did contain changes. But this appears
to have been based on an optional convention that not all cvs versions
follow. The assumption was only used to avoid some unneccessary iterations
of a while loop and the code is actually a little simpler without it.

* lib/vclib/bincvs/__init__.py

  (TagInfo.__init__):
    remove _zero_branch member

  (TagInfo.matches_rev):
    stop using _zero_branch value. the behavior of the this method
    is now different than before

  (get_logs):
    fix to work with new matches_rev definition

* lib/viewcvs.py
  (read_log):
    simplify an if statement using tag.holds_rev()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@777 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-12-10 11:50:44 +00:00
rey4
e891a6f0ca Remove workaround for Mod_Python bug fixed in new version 3.0.4
* lib/sapi.py:
  (ModPythonServer.getenv):
    Farewell SCRIPT_NAME bug, we hardly knew ye.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@776 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-12-10 07:53:42 +00:00
rey4
99a59b5032 Ahhh, the joys of using an interpreted language...
* lib/vclib/bincvs/__init__.py
  (BinCVSRepository.openfile):
    Fix errors in a raise statement


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@775 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-12-10 07:48:11 +00:00
rey4
4ddb87c838 Fix DST issue, bug #800741. Thanks to James Conley for the bug report and to
Anthon van der Neut for the patch.

* lib/compat.py
  (cvs_strptime):
    explicitly specify UTC time zone in the strptime function call
    that parses timestamps produced by RCS utilities. This causes
    the "isdst" field of the returned time tuple to be set to "0"
    instead of "-1", meaning "no" instead of "maybe."


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@774 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-12-10 06:07:36 +00:00
cmpilato
f95418732a * viewcvs/lib/vclib/svn/__init__.py
(LogEntry.__init__, get_logs): Use string representations of
    Subversion revisions here (for consistency with CVS).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@773 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-12-02 00:47:29 +00:00
rey4
ed885369ff update windows readme
* windows/README:
    add some subversion information and update known issues section


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@772 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-11-04 04:54:28 +00:00
rey4
3255fef447 Improve rlog error handling
* lib/vclib/bincvs/__init__.py:
  (parse_log_header):
    separate line numbers from file names in rlog error messages, also
    try to deal with missing "rlog: " prefixes in rlog error messages

  (get_logs):
    recover gracefully when rlog has a fatal parsing error and skips
    remaining files


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@771 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-11-04 04:52:08 +00:00
cmpilato
dbe55837bb * viewcvs/lib/ezt.py
Remove HTML-speak throughout.  This module is quite useful for much
  more than just HTML.  Also:
  (Template.__init__): Add 'compress_whitespace' parameter (defaulting
    to 1) to control whether or not runs of whitespace are compressed.
  (Template._parse): Only compress whitespace if the
    compress_whitespace variable is non-zero.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@770 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-29 02:01:37 +00:00
rey4
b63ed80ac7 * viewcvs.conf.dist
(php_exe_path):
    add another example path


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@769 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-28 01:52:25 +00:00
rey4
755f7ac666 Update php colorizing code.
* viewcvs.conf.dist
  (use_php, php_exe_path):
    new options for php highlighting

* lib/config.py
  (Config.set_defaults):
    set defaults for new options

* lib/viewcvs.py
  (markup_stream_php):
    use new php option, and colorize using php's -s argument instead
    of invoking the php interpreter, building a big string and
    calling highlight_string()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@768 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-28 01:46:59 +00:00
rey4
c4f253f187 Check for execute permission on directories in _check_path. This is
another fix suggested by Anthon van der Neut in bug #817757

* lib/vclib/bincvs/__init__.py
  (_check_path):
    check for execute permission on directories when we fall back to
    os.access()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@767 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-27 19:46:31 +00:00
rey4
6f4440191e Fix bug #817757, "unaccessible directories displayed" submitted by
Anthon van der Neut using the fix that he suggested. This change
also seems to fix another bug, #509961

* lib/vclib/bincvs/__init__.py
  (_check_path):
    fix check of os.access() return value


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@766 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-27 19:30:52 +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
rey4
055799e9f9 another change to make query page work from source directory
without installation

* lib/cvsdb.py
    fix path to viewcvs.conf


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@764 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-27 17:34:34 +00:00
rey4
e27958e70a make query page work straight from the source directory without
installation

* www/cgi/query.cgi
    fix path to lib directory


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@763 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-27 17:28:30 +00:00
gstein
4c82431592 Simplify some boolean ezt data values.
* lib/viewcvs.py:
  (view_markup): replace ezt.boolean(0) with None
  (view_directory): replace some Python ternary idioms (yuck) with a call
    to ezt.boolean() which does the nifty magic for us anyways.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@762 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-27 06:40:46 +00:00
rey4
c611d05862 * lib/viewcvs.py
(sort_file_data):
    fix sorting by name for files with no revision info


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@761 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-27 04:24:37 +00:00
rey4
e4d2fd765d * lib/viewcvs.py
(Request.get_link):
    remove trailing slashes from revision page links


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@760 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-25 23:48:19 +00:00
rey4
3f2d834184 add forward.gif and back.gif to apache_icons.py. these icons are used
by the new subversion revision page

* tools/bin2inline_py.py:
   added two new icons

* lib/apache_icons.py:
    regenerated


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@759 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-25 23:44:49 +00:00
rey4
52a55617da Rearrange view_directory function, moving logic to the top and template
filling code to the bottom. Add a few comments too.

* lib/viewcvs.py
  (view_directory):
    move some code around


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@758 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-25 22:57:30 +00:00
rey4
8f92ee55ab Merge view_directory_cvs and view_directory_svn functions. Had to add
a lot of kludgy request.roottype == 'cvs' checks, but at least this
way there's a lot less duplicate code.

* viewcvs.py
  (view_directory_cvs, view_directory_svn):
    removed, code moved into view_directory

  (view_directory):
    no longer calls view_directory_cvs and view_directory_svn


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@757 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-25 22:08:47 +00:00
rey4
f1057adb51 * website/upgrading.html
update for new template changes


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@756 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-25 04:40:43 +00:00
rey4
a478890739 Restore "this entry is unreadable" error messages that got mistakenly
suppressed in revision 1.205 of viewcvs.py.

* lib/viewcvs.py:
  (view_directory_cvs):
    stop skipping unreadable rows. also simplify row.name initialization
    by omitting trailing slashes for directory names

  (view_directory_svn):
    omit trailing slashes from directory names

* templates/directory.ezt
* templates/dir_alternate.ezt
    add trailing slashes to directory names


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@755 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-25 04:17:06 +00:00
rey4
a34029940f Move cvs tag sorting code out of view_directory_cvs and into vclib.
* lib/vclib/bincvs/__init__.py
  (_sort_tags):
    new function to alltags dictionary

  (get_logs):
    assign found tags to repos object instead of returning
    alltags dictionary

* lib/vclib/svn/__init__.py
* lib/vclib/svn_ra/__init__.py
  (get_logs):
    stop returning alltags dictionary

* lib/viewcvs.py
  (view_directory_cvs, view_directory_svn):
    updated to work with changed get_logs functions


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@754 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-25 03:33:47 +00:00
rey4
d11e6490ba Simplify some logic in view_directory_cvs. Except for the num_files
count (which was incorrect before), the new code should be equivalent
to the old code.

* lib/viewcvs.py
  (view_directory_cvs):
    simplify some parts, mainly by grouping together assignments of
    row properties


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@753 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-25 02:54:48 +00:00
cmpilato
551a38195c * viewcvs/lib/viewcvs.py
(view_revision_svn): Calculate links to the previous and next
    revisions, as well as a jump-box for whatever revision you so
    desire.

* viewcvs/templates/revision.ezt
  Add UI for navigating to previous and next revisions, for jumping to
  any particular revision you like.

* viewcvs/lib/vclib/svn/__init__.py
  (date_from_rev, fetch_log): Stop recalculating the youngest rev.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@752 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-24 19:27:02 +00:00
rey4
6aab83621c * lib/vclib/bincvs/__init__.py
(BinCVSRepository.openfile):
    fix NameError that occurs when raising an exception


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@751 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-24 19:06:00 +00:00
cmpilato
1f61819995 Committing some highly experimental code for allowing ViewCVS on one
machine to communicate with Subversion repositories via the Subversion
client bindings -- meaning your Subversion repository can live on an
entirely different computer.  Because of the experimental nature, I'm
leaving this feature undocumented (no remarks about using URLs in
viewcvs.conf.dist, basically).

* viewcvs/lib/vclib/svn_ra/__init__.py
  The new module.

* viewcvs/lib/viewcvs.py
  (_re_rewrite_url): Add a bunch of URL schemas that Subversion
    supports to this regexp.
  (Request.run_viewcvs): If a Subversion repository URL is given as
    the root, use the 'svn_ra' module instead of the direct-access
    'svn' one.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@750 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-24 18:31:27 +00:00
cmpilato
d1f125f837 Rename some not-meant-for-public-consumption functions.
* viewcvs/lib/vclib/svn/__init__.py
  (_fs_path_join): Was fs_path_join.
  (_log_helper): Was log_helper.
  (_get_last_history_rev): Was get_last_history_rev.
  (_get_history): Was get_history.
  (fetch_log): Update calls to _log_helper and _get_history.
  (get_logs): Update calls to _fs_path_join and _get_last_history_rev.
  (SubversionRepository.openfile): Update call to _get_last_history_rev.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@749 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-24 09:48:32 +00:00
rey4
4b2021fa21 Add optional "list_attic" argument to the bincvs listdir function. Also
fix tarball generation (it was broken by the previous commit)

* lib/vclib/bincvs/__init__.py
  (BinCVSRepository.listdir):
    add ability include Attic in returned listing

  (CVSDirEntry):
    new DirEntry subclass with additional "in_attic" member

* lib/viewcvs.py
  (view_directory_cvs):
    update to take advantage of the new listdir functionality

  (generate_tarball_cvs, generate_tarball_svn):
    update for changed listdir() and get_logs() vclib functions


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@748 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-24 05:13:38 +00:00
rey4
6e00b5d388 Change get_logs functions to add their information directly to
DirEntry objects instead of returning dictionaries of LogEntry
objects. Also make some tweaks to the code that parses rlog output.

* lib/vclib/bincvs/__init__.py
  (parse_log_header):
    stop stripping ",v" suffixes off of filenames, fix error message
    parser to work with windows paths, assign more sensible default
    field values, and change a comment

  (path_ends_in):
    new function

  (get_logs):
    take list of DirEntries as argument and populate it with data
    instead of returning a separate dictionary, also add some
    extra error checking

* lib/vclib/svn/__init__.py
  (get_logs):
    take list of DirEntries as argument just like in bincvs. also
    remove another unneccessary svn_fs_is_file call

* lib/viewcvs.py:
  (sort_file_data):
    change to use the new DirEntry properties

  (view_directory_cvs, view_directory_svn):
    update to work with changed get_logs functions


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@747 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-24 02:52:05 +00:00
rey4
c575c4d821 Factor permissions-checking code out of BinCVSRepository.listdir and into
a new _check_path function. Also take the opportunity to write an alternate
implementation that works correctly on windows.

* lib/vclib/bincvs/__init__.py
  (_check_path):
    added

  (BinCVSRepository.listdir):
    shortened


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@746 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-24 00:03:48 +00:00
rey4
3fc688319f move get_last_modified() into vclib as BinCVSRepository._newest_file()
* lib/vclib/bincvs/__init__.py
  (BinCVSRepository._newest_file):
    new function, cut and paste of get_last_modified

* lib/viewcvs.py
  (get_last_modified):
    removed

  (view_directory_cvs):
    use repos._newest_file function


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@745 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-23 20:36:40 +00:00
uid99421
c0a6d838c6 * templates/revision.ezt:
add the standard page header to the new revision page


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@744 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-23 19:23:26 +00:00
uid99421
2bd228c4ee Moved all string processing of CVS revision numbers into a new class
called TagInfo in an attempt to make tag-matching code more readable.

* lib/vclib/bincvs/__init__.py
  (TagInfo):
    new class

  (get_logs):
    change to use TagInfo

* lib/viewcvs.py
  (find_first_rev):
    new function

  (read_log, view_directory_cvs, view_log_cvs):
    change to use Taginfo and find_first_rev

  (CVSBranch):
    died and reincarnated as TagInfo


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@743 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-23 18:59:06 +00:00
cmpilato
e7be5b1f0a * lib/vclib/svn/__init__.py
(get_revision_info): Update call to RevisionChangeCollector().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@742 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-22 19:46:28 +00:00
cmpilato
a33f547c1e * viewcvs/lib/viewcvs.py
(view_revision_svn): Oops.  Fix the prev and diff_href calculations.

* viewcvs/templates/revision.ezt
  Fix some logic to always populate the right number of cells.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@741 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-22 18:35:56 +00:00
cmpilato
9d5d4170f9 More work on the cool new revision view.
* viewcvs/lib/vclib/svn/__init__.py
  (LogEntry.__init__): Remove 'other_paths' parameter and support.
  (ChangedPathEntry): Remove.
  (ChangedPath, get_revision_info): New.
  (log_helper): Don't do changed-path or action stuffs.  Update call
    to LogEntry().
  (get_logs): Update call to LogEntry().

* viewcvs/lib/viewcvs.py
  (view_log_svn): Remove support for 'other_paths' support.
  (view_revision): Move svn-specific stuff to new view_revision_svn()
  (view_revision_svn): New.

* viewcvs/templates/revision.ezt
  Make this template actually do something useful.

* viewcvs/templates/log.ezt
* viewcvs/templates/log_table.ezt
  Remove display of "other_paths" from Subversion logs.  Make revision
  numbers into links to the revision view.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@740 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-22 18:23:01 +00:00
rey4
1e0d4e3cff combine get_logs() and process_rlog_output() functions, also trim
trailing whitespace

* lib/vclib/bincvs/__init__.py
  (process_rlog_output, get_logs):
    removed process_rlog_output, moved code into get_logs


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@739 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-22 03:40:07 +00:00
rey4
069265c023 * lib/viewcvs.py
(view_directory, view_directory_cvs, view_directory_svn):
    move some common code in view_directory_cvs and
    view_directory_svn into view_directory


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@738 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-21 21:17:29 +00:00
cmpilato
45629a7dde Begin implementing the new 'revision' view.
* viewcvs/lib/viewcvs.py
  (Request.get_link): Add code to generate the new revision info links.
  (view_revision): New.
  (_views): Alphabetically sort the views here, and add the new 'rev' view.

* viewcvs/viewcvs.conf.dist
  (templates.revision): New.

* viewcvs/templates/revision.ezt
  New.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@737 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-21 20:04:30 +00:00
rey4
c1785db585 Remove dead code from vclib.
* lib/vclib/__init__.py
  (Repository.getitem, Repository.getfiles, Repository.getsubdirs,
   Revision, Repository._getvf_files, Repository._getvf_subdirs,
   Versfile, Versdir, Versitem, Repository._getvf_info,
   Repository._getvf_tree, Repository._getvf_properties,
   Repository._getvf_cofile):
    removed

* lib/vclib/svn/__init__.py
  (SubversionRepository.getitem, SubversionRepository._getvf_files,
   SubversionRepository._getvf_subdirs,
   SubversionRepository._getvf_info,
   SubversionRepository._getvf_tree,
   SubversionRepository._getvf_properties,
   SubversionRepository._getvf_cofile):
    removed

* lib/vclib/bincvs/__init__.py
  (BinCVSRepository.getitem, BinCVSRepository._getvf_files,
   BinCVSRepository._getvf_subdirs,
   BinCVSRepository._getvf_info,
   BinCVSRepository._getvf_tree,
   BinCVSRepository._getvf_properties,
   BinCVSRepository._getvf_cofile):
    removed


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@736 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-21 19:54:27 +00:00
cmpilato
e367c87dfe * viewcvs/lib/vclib/bincvs/__init__.py
(get_logs): Copy the input 'files' array so we aren't deleting data
    from the passed-in thing.  Caller might want to keep using that
    stuff, ya know?


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@735 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-21 18:58:32 +00:00
rey4
ff2cf94151 * lib/vclib/svn/__init__.py
(SubversionRepository.listdir)
    implement using fs library functions instead of the vclib
    getitem() interface


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@734 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-21 18:54:23 +00:00
rey4
111a9b823b * lib/viewcvs.py
(generate_tarball_svn):
    use repos.listdir() interface instead of repos.getitem() interface


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@733 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-21 18:28:55 +00:00
rey4
1dc358fc1d Move get_file_data and get_file_data_svn functions into vclib.
* lib/viewcvs.py
  (DirEntry, get_file_data_svn, get_file_data):
    removed

  (view_directory_cvs, view_directory_svn, generate_tarball_cvs):
    call repos.listdir instead of get_file_data

* lib/vclib/bincvs/__init__.py
  (BinCVSRepository.listdir):
    added, cut and paste of get_file_data

* lib/vclib/svn/__init__.py
  (SubversionRepository.listdir)
    added, cut and paste of get_file_data_svn

* lib/vclib/__init__.py
  (DirEntry)
    added, cut and paste

  (Repository.listdir)
    added abstract member function


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@732 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-21 14:35:47 +00:00
rey4
f2cadab08a Store directory listing entries in objects instead of tuples
* lib/viewcvs.py
  (_UNREADABLE_MARKER):
    removed

  (DirEntry):
    new class to replace directory entry tuples

  (get_file_data_svn, get_file_data):
    take repository object and directory path as arguments instead of
    taking the entire Request object. And return DirEntry instances
    instead of tuples

  (get_file_tests):
    removed, code moved into get_file_data

  (get_last_modified, sort_file_data, view_directory_cvs,
   view_directory_svn, search_files, generate_tarball_cvs):
    work with DirEntry instances instead of tuples

  (search_files):
    change the way this is called and remove cvs-specific code so
    subversion listings could potentially have regular expression
    searching

  (download_tarball, generate_tarball_cvs, generate_tarball_svn):
    change the way two recursive parameters are used to make it
    easier to call vclib-style functions


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@731 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-21 05:42:12 +00:00
rey4
cfbf622b27 Move the process_checkout function into vclib.
* lib/viewcvs.py
  (process_checkout):
    removed, functionality moved into vclib

  (view_markup, view_checkout, search_files):
    call vclib.Repository.openfile instead of process_checkout

  (Request.run_viewcvs):
    pass rcs path option values to CVS repository constructor

* lib/vclib/__init__.py
  (Repository.openfile):
    new abstract function

* lib/vclib/bincvs/__init__.py
  (BinCVSRepository.openfile):
    added

  (BinCVSRepository.__init__):
    added rcs_paths member to hold rcs config values

* lib/vclib/svn/__init__.py
  (SubversionRepository.openfile):
    added

  (get_file_contents):
    removed


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@730 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-20 03:53:23 +00:00
rey4
131904872c Stop looking up "action" values for subversion log entries. C. Mike
pointed out that will ultimately allow us to get rid of an inefficient
call to svn_fs_paths_changed().

* lib/vclib/svn/__init__.py
  (LogEntry.__init__, log_helper, get_logs):
    no longer set LogEntry.action member

* templates/log.ezt
* templates/log_table.ezt
    stop trying to read LogEntry.action member


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@729 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-17 17:56:44 +00:00
cmpilato
4e5303978a Expose the actions for "other changed paths".
* viewcvs/lib/vclib/svn/__init__.py
  (ChangedPathEntry.__init__): Add 'action' parameter.
  (_unparse_action): New helper (with code previously in log_helper()).
  (log_helper): Now call _unparse_action() to get the action string
    for the path.  But now also call it for the other paths, passing
    the result to the updated ChangedPathEntry.__init__() function.

* viewcvs/templates/log.ezt
* viewcvs/templates/log_table.ezt
  Now show the type of change that happened for "the other paths", and
  don't make paths that were deleted into hyperlinks.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@728 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-16 14:41:10 +00:00
cmpilato
751b031192 Some pool usage fixes suggested by Greg Stein.
* viewcvs/lib/vclib/svn/__init__.py
  (get_last_history_rev): Add 'pool' argument; use it instead of the
    repository object's pool.
  (get_logs): Make this sucker us an iteration subpool.  Update call
    to get_last_history_rev().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@727 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-16 06:34:52 +00:00
rey4
c7c9807517 Removed show_changed_paths option. It was originally added as a way to
to disable a buggy and inefficient subversion feature. But it's no
longer neccessary with C. Mike's recent improvements to the subversion
module.

* viewcvs.conf.dist
  (show_changed_paths):
    removed option

* lib/config.py
  (Config.set_defaults)
    removed default assignment

* lib/viewcvs.py
  (run_viewcvs):
    stop passing option value to repository object

* lib/vclib/svn/__init__.py
  (log_helper, fetch_log):
    stop passing option value to log_helper function


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@726 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-15 20:33:04 +00:00
rey4
9970242b67 fix some links on log pages
* lib/vclib/svn/__init__.py
  (_trim_path):
    new function to take leading slashes off paths

  (log_helper):
    remove leading slashes from paths that get used by templates


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@725 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-15 20:12:29 +00:00
cmpilato
603181493b * viewcvs/lib/viewcvs.py
(view_markup): Ensure that the 'prev' data member always exists.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@724 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-15 19:29:40 +00:00
rey4
c1f7b71c81 get standalone server to work from development tree
* standalone.py
  (global code):
    remove os.chdir() call and set viewcvs.g_install_dir variable so
    the templates and configuration file can be found


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@723 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-15 17:39:43 +00:00
rey4
e159806814 * lib/viewcvs.py
(handle_config):
    when viewcvs is run without being installed first, look for a
    viewcvs.conf file in the root of tree instead of in the current
    directory


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@722 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-15 17:27:17 +00:00
cmpilato
c8bc2d4832 * viewcvs/lib/vclib/svn/__init__.py
(log_helper): Stop skipping over revisions in which the target path
    didn't actually change.  If we decide to re-add this feature, we
    need to do it in viewcvs.py itself (because other code, like
    view_markup(), is depending on getting real values for all
    relevant revisions.
  (get_last_history_rev): New.
  (get_logs): Move this function down in the file, and now call
    get_last_history_rev() instead of fs.node_created_rev().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@721 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-15 17:24:40 +00:00
cmpilato
9a8d5d115b Whip 'select for diffs', 'diff to previous', and 'diff to selected'
into shape for Subversion.

* viewcvs/lib/viewcvs.py
  (view_log): Grab the path of a version selected for diffs from the
    query data, and stash it in the data dictionary.

* viewcvs/templates/log_table.ezt
* viewcvs/templates/log.ezt
  Fix the 'diff to previous', 'diff to selected', and 'select for
  diff' links for Subversion.  Also, don't display the various "branch
  point" and "next main" diff links for Subversion.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@720 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-15 16:42:02 +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
cmpilato
e83cf53244 * viewcvs/lib/viewcvs.py
(read_log): Word-capitalize the "Tag Not Found" status line.
  (view_diff): Add 400 status to the exceptions.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@718 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-14 15:35:23 +00:00
cmpilato
078c625f09 * viewcvs/lib/viewcvs.py
(get_file_data_svn): Use request.full_name, not just full_name,
    since the latter doesn't exist in the scope.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@717 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-13 18:56:20 +00:00
cmpilato
ad3eade9ac * viewcvs/lib/viewcvs.py
(_validate_param): Return "400 Bad Request" when invalid parameters
    are passed.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@716 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-13 18:18:01 +00:00
cmpilato
fec722653e * lib/vclib/svn/__init__.py
(NodeHistory): New collector class.
  (get_history): Use svn_repos_history() now instead of directly using
    the fs.history interface.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@715 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-04 22:13:10 +00:00
rey4
22aeba1b38 * templates/log_table.ezt: sync up with log.ezt 1.26
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@714 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-10-03 22:10:19 +00:00
cmpilato
4f46a705e2 Some fix-em-ups to the new history-using ViewCVS code. Thanks to Greg
Stein and Russell Yanofsky for review and suggestions.

* lib/vclib/svn/__init__.py
  (log_helper): Add 'pool' argument, and use it instead of
    svnrepos.pool for allocations.  Also, calculate the action and
    copy_rev/copy_path fields in the log entries.
  (fetch_log): Use an iteration subpool when looping over history items.

* templates/log.ezt
  Eliminate an unnecessary "if-any" check (since "is" does this work
  for us in this case).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@713 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-09-30 13:58:44 +00:00
cmpilato
f808704efe * viewcvs/lib/vclib/svn/__init__.py
(log_helper): Populate the 'action' attribute of the LogEntry.

* viewcvs/templates/log.ezt
  Expect human-readable strings for the action type (instead of the
    single-character abbreviations).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@712 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-09-26 14:29:07 +00:00
cmpilato
594baf20b8 Mm... Steinian code review is good for the soul. And the project,
too.

* viewcvs/lib/vclib/svn/__init__.py
  (date_from_rev): Remove a semicolon (it's a Python no-no).
  (get_history): Remove an errant space, and take advantage of
    Python's kewl tuple support to avoid a temp variable and simplify
    the read.
  (log_helper): Promote to a "real" function, adding some params and
    returning a real value.
  (fetch_log): Move the sub-function log_helper out.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@711 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-09-26 14:13:57 +00:00
cmpilato
7eae388966 Make "diff to previous" for across Subversion copies work.
* viewcvs/lib/viewcvs.py
  (_legal_params): Allow 'p1' and 'p2' query args.
  (view_log_svn): Populate prev_path entry members.
  (view_diff): Handle the 'p1' and 'p2' query string items.  Update
    call to vclib.svn.do_diff().

* viewcvs/templates/log.ezt
  Update "diff to previous" links to include prev_path.

* viewcvs/lib/vclib/svn/__init__.py
  (do_diff): Add (and use) 'path2' argument.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@710 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-09-26 02:58:59 +00:00
cmpilato
9632aa3bfc Teach ViewCVS how to follow copy history in Subversion repositories
(optionally, turned off by default).  No diffs across paths yet, but
that's coming soon(ish)!

* viewcvs/lib/vclib/svn/__init__.py
  (LogReceiver): Buh-bye.
  (get_history): New.
  (fetch_log): Use get_history() instead of the svn_repos_get_logs interface.

* viewcvs/lib/config.py
  (Config.set_defaults): Add default for 'cross_copies' option.

* viewcvs/lib/viewcvs.py
  (Request.run_viewcvs): Set the 'cross_copies' SubversionRepository
    attribute based on the config option of the same name.

* viewcvs/viewcvs.conf.dist
  (cross_copies): New.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@709 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-09-26 01:34:33 +00:00
gstein
60fbba9322 re-add CGI scripts with exec permission
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@708 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-09-18 22:18:28 +00:00
gstein
d340b5bfc5 remove these CGI scripts temporarily
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@707 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-09-18 22:17:50 +00:00
gstein
7183660985 Restore ViewCVS' ability to work straight from the development tree.
* lib/viewcvs.py:
  (g_install_dir): from the CGI, the conf is a couple levels up (now)
    rather than just one.
  (view_directory_cvs): row.name must be set for all row types since it
    will be displayed as part of the error lines. move the assignment
    further up in the file.

* www/cgi/viewcvs.cgi:
  (__main__): the lib is a couple levels up from the CGI (now)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@706 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-09-18 22:16:04 +00:00
cmpilato
c77b65be9d * templates/dir_alternate.ezt
* templates/directory.ezt
* templates/markup.ezt
* templates/include/branch.ezt
  s/resizeable/resizable/.  This fixes Bug issue #756811.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@705 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-08-24 05:20:55 +00:00
cmpilato
5e834c47e7 Fix directory templates to properly handle missing graph_href's (like,
for example, which using Subversion).  This fixes #Bugs item #793866,
reported by Timothee Besset.

* templates/dir_alternate.ezt
* templates/directory.ezt


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@704 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-08-24 05:06:41 +00:00
rey4
f6b2ba3649 Fixed bug introduced in rcsdiff_date_reformat by previous commit which
was noticed by Greg Stein <gstein@lyra.org>.

* lib/viewcvs.py (rcs_date_reformat): restored call to make_time_string()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@703 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-08-22 21:56:31 +00:00
rey4
844a8c1269 fix ValueError exception on diff page
* lib/compat.py (cvs_strptime): make compatibility function throw a
    ValueError when time is not in expected format, so it is more
    like the native function

* lib/viewcvs.py (rcs_date_reformat): catch ValueError exception


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@702 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-08-22 17:55:39 +00:00
rey4
8e19ed6b2c fix exception when svn root not found
* lib/viewcvs.py: fix misspelled variable


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@701 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-08-21 01:45:50 +00:00
rey4
bdc40661f6 fixed mod_python bug reported by David Oxley
<David.Oxley@workplace-systems.plc.uk> on Subversion dev list

* lib/sapi.py (ModPythonServer.getenv): derive SCRIPT_NAME from apache
    request instead of using mod_python's value


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@700 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-08-18 15:01:36 +00:00
rey4
1ce3cc2174 Fixed bug in html form that was reported by John Hall
<john-news1@cambridgetechgroup.com>.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@699 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-08-10 01:25:44 +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
rey4
a06053167b fixes for python 1.5 compatibility
* lib/popen.py
    use string functions instead of methods

* lib/viewcvs.py
    use apply() function instead of **arg calling syntax


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@697 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-08-04 17:42:21 +00:00
rey4
1437a7e4fe prevent exception when use_localtime is set and rcsdiff produces wrongly
formatted dates. Bug reported by zindine <zindine at easynet.fr> who
encountered this using cvsnt's rcsdiff.

* lib/compat.py (cvs_strptime): changed to return None when the date
  doesn't match, instead of throwing an exception

* lib/viewcvs.py (rcsdiff_date_reformat, human_readable_diff): changed
  to display unaltered date string returned by rcsdiff when it can't
  be parsed.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@696 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-29 11:09:11 +00:00
rey4
59563e8dfe changed "Running Windows" logo to ViewCVS blimp as suggested by
Bo Berglund <bo.berglund@telia.com>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@695 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-29 02:59:32 +00:00
rey4
c9fbb0ec71 put cvs_roots and svn_roots on a single line as requested by
Bo Berglund <bo.berglund@telia.com> to help simplify his
windows installer


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@694 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-29 02:57:51 +00:00
rey4
79309e3025 fixed html error
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@693 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-28 23:47:04 +00:00
rey4
66bb812aeb * lib/viewcvs.py (common_template_data): new function to set a few variables
common to all templates

  (Request.__init__): moved icon and docroot initialization into
  common_template_data

  (html_footer, view_directory, view_log, view_markup, view_checkout,
   view_cvsgraph, human_readable_diff): changed to use common_template_data

* templates/dir_alternate.ezt:
  templates/directory.ezt:
  templates/graph.ezt:
  templates/header.ezt:
  templates/log.ezt:
  templates/log_table.ezt:
  templates/query.ezt: renamed docroot and icon variables

* website/upgrading.html: updated description of changed template variables


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@692 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-25 05:34:11 +00:00
rey4
25bb91db25 fix for bug #509705, Directory view of branch skips files
based on patch from Steve Lamm (slamm)

* lib/vclib/bincvs/__init__.py (parse_log_entry): fixed to work with
  versions of RCS that add extra dashed separator lines


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@691 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-24 21:53:20 +00:00
rey4
5d4c447dd4 added "icons" and "docroot" options to control the locations of
static files

* viewcvs.conf.dist, lib/config.py: added new options

* templates/dir_alternate.ezt:
* templates/directory.ezt:
* templates/header.ezt:
* templates/log.ezt:
* templates/log_table.ezt:
* templates/query.ezt:
* lib/viewcvs.py (Request.__init__):
  new "request.docroot" and "request.icons" template variables

* standalone.py (serve): standalone server must use default locations


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@690 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-24 20:37:39 +00:00
rey4
5cf473d5a1 enscript "couldn't open input filter" issue happens on windows xp too
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@689 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-24 19:56:07 +00:00
rey4
cf9aa07cdb fixed docstring
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@688 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-24 19:53:59 +00:00
rey4
0999369756 changed to exit silently on "cvs import" instead of crashing
* tools/loginfo-handler (HeuristicArgParse, CvsNtArgParse): added tests
  to detect command line parameters ending in "- Imported sources'"

  (debug, warning, error): changed these functions to write to standard out
  instead of standard error


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@687 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-24 08:48:40 +00:00
rey4
c9dbb2c933 fixed bug #488302, missing tag information
* lib/viewcvs.py (read_log, view_log_cvs, class CVSBranch): rewrote code
  that correlates CVS tags with revisions


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@686 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-24 08:03:25 +00:00
rey4
9009ce845a fixed bug #460835, "Too many connections in cvsdbadmin update"
* lib/cvsdb.py (ConnectDatabase): now returns an existing database
  connection instead of always creating a new one.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@685 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-24 00:26:33 +00:00
cmpilato
dc2b8063ee * viewcvs/lib/config.py
* viewcvs/viewcvs.conf.dist
  Make the 'show_changed_paths' option default to 0.  We should
  generally avoid a policy of checking in code that, by default,
  SEGFAULTs.  Further, showing changed paths in Subversion is a large
  deviation of the manner in which CVS behaves, and I'd like to keep
  the two displaying as similarly as possible in the default setup.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@684 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-22 14:17:38 +00:00
rey4
4c281fc21b Fixed log retrieving code to work correctly when get_changed_paths is
true and a directory containing the file being displayed has been copied

* vclib/svn/__init__.py (LogReceiver.__init__): added a new member
  called "node_id" and changed parameters passed to constructor

  (LogReceiver.receive): now compares each changed file in a revision
  with the file being displayed using file revision identifers rather
  than pathnames. Also removed some leftover debugging code

  (fetch_log): adjusted arguments passed to LogReceiver constructor


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@683 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-11 22:05:41 +00:00
rey4
456ece022a Documented template changes. Should be complete, but needs to be made
more readable.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@682 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-09 08:55:49 +00:00
cmpilato
69e5862d59 * viewcvs/lib/viewcvs.py
(markup_stream): Get log message and size display as part of the
    markup output working for Subversion.

* viewcvs/templates/markup.ezt
  Add display of file size for Subversion repositories, and make the
    'changes since' line CVS-only.

* viewcvs/lib/vclib/svn/__init__.py
  (StreamPipe.read, StreamPipe.readline): Don't try to read if EOF
    has been hit.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@681 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-07 14:43:50 +00:00
rey4
6800f02ab0 various minor fixes
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@680 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-05 17:13:21 +00:00
rey4
94102ae7ae updated alternate template files
* dir_alternate.ezt: updated with recent changes to directory.ezt

* log_table.ezt: updated with recent changes to log.ezt


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@679 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-05 16:52:31 +00:00
rey4
eb16ebf2ce removed empty column from directory information table and added missing
</tr> closing tag


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@678 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-05 16:51:08 +00:00
rey4
07a0d6e387 made standalone server work with cvsnt and rcs when it is run on windows
without a configuration file

* lib/config.py (Config.load_config): added conf_path member to hold the
  path to viewcvs.conf, or None if there is no configuration file

* standalone.py (serve): if there is no configuration file on windows, it
  will test for the presence of cvsnt and if the test fails, it will fall
  back to rcs


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@677 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-05 16:44:25 +00:00
rey4
a071956110 Added some new fields to the Subversion log view and fixed the
download/view/markup links for old revisions of copied files.

The new fields are "Other changed files" which is a list of links to other
files changed in the same revision, "Copied from" which is displayed for
file revisions that are the result of a copy operations, and "Filename"
which is displayed for older file revisions which precede a copy operation.

* viewcvs.conf.dist
* lib/config.py (set_defaults): added "show_changed_paths" option to determine
  whether or not to retrieve and display the new information

* lib/viewcvs.py (run_viewcvs): now passes show_changed_paths option to
  newly created subversion repository objects

  (view_log_svn): changed the way download/view/markup links are generated
  and added code to generate links for new fields

* templates/log.ezt: template additions

* lib/vclib/svn/__init__.py (LogEntry.__init__): added extra arguments for new
  fields

  (ChangedPathEntry): new class to hold information about the changed paths
  associated with a revision

  (LogReceiver.__init__): added some new members to hold more state for the
  callback function

  (LogReceiver.receive): added some code to crawl through the "paths" hash
  and save useful information

  (get_logs): changed to work with new LogReciever constructor

  (fetch_log): changed call to repos.svn_repos_get_logs() to pass true for the
  "discover_changed_paths" argument. moved fs.file_length() call into
  LogReceiver.__init__


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@676 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-03 06:27:52 +00:00
rey4
c6ddff38ef Added some new fields to the Subversion log view and fixed the
download/view/markup links for old revisions of copied files.

The new fields are "Other changed files" which is a list of links to other
files changed in the same revision, "Copied from" which is displayed for
file revisions that are the result of a copy operations, and "Filename"
which is displayed for older file revisions which precede a copy operation.

* viewcvs.conf.dist
* lib/config.py (set_defaults): added "show_changed_paths" option to determine
  whether or not to retrieve and display the new information

* lib/viewcvs.py (run_viewcvs): now passes show_changed_paths option to
  newly created subversion repository objects

  (view_log_svn): changed the way download/view/markup links are generated
  and added code to generate links for new fields

* templates/log.ezt: template additions

* lib/vclib/svn/__init__.py (LogEntry.__init__): added extra arguments for new
  fields

  (ChangedPathEntry): new class to hold information about the changed paths
  associated with a revision

  (LogReceiver.__init__): added some new members to hold more state for the
  callback function

  (LogReceiver.receive): added some code to crawl through the "paths" hash
  and save useful information

  (get_logs): changed to work with new LogReciever constructor

  (fetch_log): changed call to repos.svn_repos_get_logs() to pass true for the
  "discover_changed_paths" argument. moved fs.file_length() call into
  LogReceiver.__init__


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@675 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-03 06:20:24 +00:00
rey4
8d21b07bc2 removed some false advertising
* viewcvs.conf.dist: removed comment about CVSNT handling UTF-16 text
  better than the RCS utilities. This is irrelevant since CVSNT
  converts text to UTF-8 before storing it in the repository file.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@674 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-02 06:49:59 +00:00
rey4
0df99f1010 updated documentation to say that CVSNT can be used instead of RCS
* windows/README
* viewcvs.conf.dist


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@673 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-02 05:42:47 +00:00
rey4
d228ab0ce2 removed some lines of code that don't do anything...
* standalone.py (ViewCVS_Handler.run_viewcvs): ...from this function


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@672 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-02 05:23:52 +00:00
rey4
2e3d56772a standalone server had been setting the SCRIPT_NAME in a nonstandard way
which was incompatible with the url escaping changes I made in viewcvs.py
a little earlier today. now it is set correctly.

* standalone.py (ViewCVS_Handler.run_viewcvs): changed the way SCRIPT_NAME
  value is determined


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@671 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-02 05:16:06 +00:00
rey4
fe67803feb fixed some variable misspellings
* lib/viewcvs.py (Request.run_viewcvs): errors were in this function


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@670 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-02 04:56:48 +00:00
rey4
df7db58a04 changes to allow viewcvs to use CVSNT instead of the RCS utilities to
get information from CVS repositories

* viewcvs.conf.dist
* lib/config.py (Config.set_defaults): new "cvsnt_exe_path" option
  that can be set to the path of the cvsnt executable. If it is
  set, cvsnt gets invoked instead of the rcs utilities

* lib/vclib/bincvs/__init__.py (rcs_popen): new wrapper for popen that decides
  what program to execute based on the "rcs_paths" and "cvsnt_exe_path"
  options.

  (get_logs, fetch_logs): changed to use rcs_popen function instead of
  popen.popen

* lib/viewcvs.py (process_checkout, view_diff, generate_tarball_cvs): changed
  to use bincvs.rcs_popen instead of popen.popen

  (view_directory_cvs, generate_tarball_cvs): updated call to bincvs.get_logs

  (read_log): updated call to bincvs.fetch_log

* lib/rlog.py (GetRLogData): updated call to bincvs.fetch_log


general.cvsnt_exe_path


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@669 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-02 04:49:16 +00:00
rey4
8675e8cad0 some minor fixes
* lib/viewcvs.py (_URL_SAFE_CHARS, Request.get_url, prep_tags,
  view_directory, view_log, human_readable_diff): added
  URL escaping

* (Request.run_viewcvs, _strip_suffix): changed fake-suffix code to actually
  interpret the fake suffixes instead of just stripping them off


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@668 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-02 01:28:09 +00:00
rey4
61406314a9 Changes intended to simplify handling URLs in ViewCVS. Nearly all
links between ViewCVS pages are now constructed by a new Request
method called "get_link," and all URL parsing happens in another new
Request method called "run_viewcvs."

I also added support for a new optional parameter called "view." It
provides a more uniform way of linking to ViewCVS pages, so you can
say

  /viewcvs/dir/file.txt?view=log
  /viewcvs/dir/file.txt?view=co
  /viewcvs/dir/file.txt?view=annotate
  /viewcvs/dir/file.txt?view=markup

instead of

  /viewcvs/dir/file.txt
  /viewcvs/*checkout*/dir/file.txt
  /viewcvs/dir/file.txt?annotate=head
  /viewcvs/dir/file.txt?rev=HEAD&content-type=text/vnd.viewcvs-markup

Changes which are not backwards compatible had to be made to some
template files. Old templates will not work with the new code.


* templates/include/branch_form.ezt:
* templates/include/diff_form.ezt:
* templates/include/paging.ezt:
* templates/include/sort.ezt:
* templates/diff.ezt:
  changed to use form action and hidden fields provided by the script

* templates/directory.ezt: got rid of relative urls, changed to use
  form action and hidden fields provided by the script

* templates/graph.ezt: changed to take image path from the script

* templates/header.ezt: got rid of "qquery" variable

* templates/log.ezt: changed the way diff and annotate links get
  constructed

* lib/viewcvs.py (Request.__init__): moved out url parsing stuff into
  new "run_viewcvs" method.

  (Request.run_viewcvs): new Request method to hold all url parsing
  code and replace the global function with the same name.

  (Request.get_url, Request.get_link): new methods to construct urls
  for ViewCVS pages. Most of the hyperlinks that appear in generated
  pages are now made by these functions.

  (get_up_path): turned off special handling of attic directory for
  subversion, switched names of regular expressions

  (_legal_params, _validate_param, _validate_root): added new 'view'
  parameter, turned off separate validation for root parameter

  (_re_validate_revnum): allow empty string to be specified as a
  revision number. needed to prevent validation error when doing a
  regular expression search on the cvs trunk (which sets
  only_with_tag to "")

  (_strip_suffix, _repos_pathtype): added some new helper functions

  (sticky_query, toggle_query, download_url): removed these functions,
  Request.get_url() is now used instead.

  (clickable_path, prep_tags, augment_entry): changed signatures and
  implementations to use Request.get_url

  (is_viewable, is_viewable_image): changed is_viewable() to
  is_viewable_image() to avoid overlap in functionality with is_text()

  (nav_header_data): got rid of 'qquery' template parameter, changed
  'file_url' to use an absolute pathname instead of a relative one

  (view_auto): new function that marks up the current file if it is
  viewable, otherwise downloads it. called when a user clicks on the
  revision numbers in directory listings.

  (view_markup, markup_stream): renamed markup_stream to view_markup
  and changed signature

  (get_file_data_svn): no longer tries to generate physical pathnames
  for subversion files since the values it did generate were
  meaningless and were ignored anyway.

  (get_file_data): changed docstring

  (prepare_hidden_values): changed signature

  (view_directory, view_directory_cvs, view_directory_svn): factored
  out some of the common parts of view_directory_cvs and
  view_directory_svn functions into a new function called
  view_directory. implementations were also changed to use new get_url
  and get_link functions

  (view_log, view_log_cvs, view_log_svn): ditto

  (process_checkout): changed signature and moved in support for
  subversion

  (view_checkout, search_files): changed implementations to deal with
  new url handling, and the changes to process_checkout.

  (view_annotate, human_readable_diff, download_tarball): changed to
  use new url methods

  (view_cvsgraph): changed signature to be consistent with
  view_checkout, view_annotate, view_markup, etc. Added new template
  parameter 'imagesrc' so the graph url doesn't have to
  be hardcoded in the template.

  (cvsgraph_image, view_cvsgraph_image): renamed cvsgraph_image to
  view_cvsgraph_image and changed its signature (also for consistency
  with the other view_* functions).

  (_views, _view_codes): new dictionary objects mapping "view"
  parameter values to functions that produce various viewcvs pages.

  (handle_config): got rid of global "default_settings" dictionary

  (run_viewcvs): replaced by Request.run_viewcvs

  (main): now calls Request.run_viewcvs()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@667 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-07-01 08:35:28 +00:00
rey4
4a3ac177ee just changed tabs to spaces.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@666 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-06-27 22:45:03 +00:00
cmpilato
0a88d6f1a6 * viewcvs/lib/vclib/svn/__init__.py
(get_logs, fetch_log): Add file sizes to file LogEntry() items.

* viewcvs/templates/log.ezt
  Add file size display for Subversion repositories.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@665 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-06-26 19:54:13 +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
cmpilato
f6a150d62b Fix a template bug reported by Branden Robinson <branden@deadbeast.net>.
* templates/include/branch_form.ezt
* templates/include/diff_form.ezt
* templates/include/sort.ezt
  Use an action="" value in these forms that can deal with both states
    of the root_as_url_component option.

* lib/viewcvs.py
  (view_log_cvs, view_log_svn): Add 'current_root' to the data
    dictionary.  This is "just because", not really related to the bugfix.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@662 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-06-25 20:32:03 +00:00
cmpilato
fc69db201e * viewcvs-install
Fix the final instructions to point to the updated location of
    viewcvs.cgi (now in www/cgi/ instead of just cgi/)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@661 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-06-25 20:29:03 +00:00
cmpilato
1f7b439cb0 Fix the example used to demonstrate working Subversion bindings.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@660 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-06-16 18:19:04 +00:00
rey4
3b02f55c88 Changed windows implementation of popen() to call CreateProcess with a "nul"
file handle instead of no handle at all when discarding the child process's
standard error output. Without this change, some versions of RCS crash when
they try to print warning messages.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@659 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-06-09 23:20:00 +00:00
rey4
0626128b12 - changed recommended python distribution and rcs binaries
- got rid of references to binaries folder
- changed spacing in a few places


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@658 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-06-08 19:46:30 +00:00
rey4
b762466add * www/cgi/viewcvs.cgi, www/cgi/query.cgi, www/viewcvs-strace.sh,
cgi/viewcvs.cgi, cgi/query.cgi, cgi/viewcvs-strace.sh
  - moved stub scripts from cgi/ to www/cgi/

* cgi/granny.cgi
  - deleted since annotate functionality is already intergrated into
    viewcvs

* cvsgraph.conf.dist, viewcvs.conf.dist,
  cgi/cvsgraph.conf.dist, cgi/viewcvs.conf.dist
  - moved configuration files from cgi/ to project root

* www/mod_python/.htaccess, www/mod_python/query.py, www/mod_python/viewcvs.py,
  windows/htaccess.mod_python, windows/query.py windows/viewcvs.py
  - moved mod_python files from windows/ to www/mod_python/

* www/asp/query.asp, www/asp/viewcvs.asp,
  windows/query.asp, windows/viewcvs.asp
  - moved asp files from windows/ to www/asp/

* viewcvs-install
  - updated installer to deal with all the moved files

* INSTALL windows/README website/upgrading.html
  - updated documentation with new file locations and mod_python information


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@657 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-06-03 06:24:59 +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
76657fb8ad - fixed incorrect path in ASP installation instructions
- updated mod_python installation instructions (the new version has a
  windows installer)
- added a link for help troubleshooting mod_python
- deleted information about old enscript bugs, and added information about
  a new enscript problem.
- added URL for CvsGraph building instructions


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@655 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-06-02 05:14:50 +00:00
rey4
d35d170619 explicitly set mod_python's default content-type to text/html to prevent
it from automatically deducing different values


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@654 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-06-02 04:42:30 +00:00
rey4
f62fc9bd69 * lib/win32popen.py:
- removed nonblocking implementation of win32popen.MakeSpyPipe(). It added
    unnecessary complexity and had a flaw which made it inefficient to boot.

* lib/popen.py:
  - changes to work with new win32popen.CreatePipe() signature


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@653 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-06-02 04:40:44 +00:00
rey4
9c77b6eb7d fixed pipe_cmds() to work with mod_python on unix
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@652 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-06-02 04:05:00 +00:00
rey4
da232542ef Updated instructions for new versions of enscript and rcs tools. Also fixed
some typos and grammatical errors.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@651 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-05-27 02:47:33 +00:00
rey4
870580afb4 cvs ci standalone.py lib/sapi.py
* lib/sapi.py standalone.py
  changed sapi implementations of header() methods to accept status arguments
  set to None


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@650 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-05-27 02:46:53 +00:00
cmpilato
946a206b08 Add tarball support for Subversion repositories. Patch by Ben Collins
<bcollins@debian.org>, modified a little bit by cmpilato.

* lib/viewcvs.py
  (generate_tarball_cvs): Was generate_tarball().
  (view_directory_svn): Add linkage for tarball download().
  (generate_tarball_svn): New.
  (download_tarball): Now call either generate_tarball_svn and
    generate_tarball_cvs, depending on the root type.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@649 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-05-25 18:10:18 +00:00
cmpilato
d6806afe25 Track rename of Subversion binding module util->core.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@648 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-05-22 16:14:53 +00:00
cmpilato
38a02d75ea (view_log_svn): Protect against NULL log messages in Subversion
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@647 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-04-29 20:38:35 +00:00
cmpilato
5473b5d8d4 No longer display "Changes since" for non-CVS repositories
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@646 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-04-29 20:32:51 +00:00
cmpilato
aa32130d2e * lib/vclib/__init__.py
(InvalidRevision): New exception.

* lib/vclib/svn/__init__.py
  (date_from_rev, fetch_log, SubversionRepository.__init__): Raise new
    InvalidRevision exception where applicable.

* lib/viewcvs.py
  (Request.__init__, view_diff): Catch the new InvalidRevision
    exception from the vclib for Subversion actions.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@645 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-04-16 16:00:30 +00:00
cmpilato
1fbc1eeb13 Add myself and Russell to the Who list (with gstein's blessing).
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@644 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-20 17:23:03 +00:00
cmpilato
00de9ce28f Let the Subversion integration breathe the fresh air.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@643 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-20 16:29:38 +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
cmpilato
c74fa8eb35 * lib/vclib/svn/__init__.py
(itemtype): Make this more efficient (and more correct).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@641 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-11 23:42:03 +00:00
cmpilato
69383e0c33 Protect against silly user-entered data in the diff forms.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@640 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-11 23:38:01 +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
gstein
d51c87a71a Various fixes and improvements.
* lib/config.py:
  (_parse_roots): get rid of a string method usage.

* lib/popen.py:
  (pipe_cmds): stop using the += syntax (not compatible with 1.5.2)

* lib/sapi.py:
  (CgiServer.__init__): use os.environ, not os.getenv()
  (IIS_FixURL): stop using the += syntax

* lib/viewcvs.py:
  - note: these changes look big, but are small. use 'cvs diff -b' to
    see the real change without the reindentation.
  (markup_stream_python): record a note about some future work
  (run_viewcvs): new function which holds the guts of ViewCVS. this
    used to be main() a long while back before that got monkeyed. this
    is really just a reindent.
  (main): hold the exception handling logic. tweak then the t_start
    and t_end calls are made, relative to the try/finally.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@638 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-11 20:43:06 +00:00
gstein
14c0409e77 handy script for tracing ViewCVS's syscalls
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@637 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-11 20:35:23 +00:00
rey4
690e7b6e8f installation now prompts to delete .py or .pyc files that don't belong
in install folders


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@636 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-03 09:57:06 +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
cmpilato
b62f0bf4c5 Expose the filename to the log templates.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@634 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-27 23:03:21 +00:00
cmpilato
0c0999a9c7 Fix a little CVS/Subversion discrepency (and in the process, fix the
nav_path so that the Attic is optionally displayed based on the
hideattic CGI param).

* viewcvs/lib/viewcvs.py
  (_re_up_attic_path, get_up_path): New.  Change all other users of
    _re_up_path to call this function instead.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@633 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-27 22:44:47 +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
cmpilato
fa4ad62287 Just some 80-column formatting changes.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@631 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-27 21:26:11 +00:00
gstein
9c346b051f Ensure that we open ,v files in binary mode.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@630 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-26 02:31:31 +00:00
rey4
4e9a300681 fixed interpretation of win32file.ReadFile() return value
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@629 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-26 01:39:51 +00:00
timcera
e0f09153bb Changed the length of dir and file VARCHAR fields from 128 to 255. I felt
this was the best (and easiest) change compared to changing the type
because of the possible introduction of subtle differences in the treatment
of VARCHAR and TEXT.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@628 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-22 03:52:14 +00:00
rey4
c8d318c670 replaced += operation with call to list extend method for pre-2.0 python compatibility
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@627 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-20 10:43:11 +00:00
rey4
b85fb5485e fix enscript documentation
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@626 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-20 10:22:03 +00:00
rey4
a79f56d178 bugfix: enabled display of pipe_cmds error streams in debug mode
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@625 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-20 10:21:08 +00:00
rey4
4e2aa11281 changed installer to not install windows-only files on unix!
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@624 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-19 23:24:29 +00:00
rey4
74b01543ae Updated with new locations of asp and mod_python files
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@623 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-19 22:51:27 +00:00
rey4
82729d4181 simplified apache handler using execfile()
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@622 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-19 06:23:32 +00:00
rey4
e586a6785b Now adds "_page" suffix to module_name once instead of twice
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@621 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-19 05:39:00 +00:00
rey4
90c060be4c - moved global g_name_printed variable into server.pageGlobals
- fixed scoping problem in Request.__init__()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@620 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-19 05:35:41 +00:00
rey4
358a5c2aa5 got rid of unneccessary imports
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@619 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-19 05:33:07 +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
72c395bc35 moved ASP and mod_python folders out of "cgi" directory
and into the "windows" area. Updated windows readme with
the new locations


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@617 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-19 05:29:21 +00:00
rey4
69b548a1b3 important bugfix for loginfo handler, didn't handle multidigit version numbers
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@616 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-18 11:56: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
e6d529b874 renamed variable
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@614 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-18 11:55:42 +00:00
rey4
5786f0958c commited Ivo Roessling's bugfix
http://mailman.lyra.org/pipermail/viewcvs/2003q1/001622.html


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@613 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-18 11:55:26 +00:00
rey4
27be5778fc fix for mod_python
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@612 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-18 11:55:04 +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
1d1816cc8c added the new mod_python files
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@610 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-18 11:54:21 +00:00
rey4
c23a80b4fe removed bit about mxDateTime and updated information about loginfo handler
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@609 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-18 11:53:44 +00:00
rey4
6037eefa8c added a new 0.9 section with blurb about UTC times in database
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@608 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-18 11:53:00 +00:00
rey4
6ab242782a removed bit about mxDateTime
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@607 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-18 11:52:26 +00:00
rey4
c878d98e57 readme from third release
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@606 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-18 11:49:24 +00:00
rey4
3127bf9af6 readme from second release
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@605 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-18 11:48:11 +00:00
rey4
db8777345b There are a few significant changes to the loginfo handler script.
1) There's a new way to pass it parameters. You can write:

  ALL <VIEWCVS_INSTALLATION_DIRECTORY>/loginfo-handler %{sVv}

instead of:

  ALL (echo %{sVv}; cat) | <VIEWCVS_INSTALLATION_DIRECTORY>/loginfo-handler

although for backwards compatibility, the old invokation still works. The
reason for the change is to make life easier for windows users who do not
typically have cat and a unix-style echo command installed on their machines.

2) It now sort of supports spaces in file names. Current versions of CVS pass
loginfo parameters in a space-separated string without bothering to escape the
spaces that can occur in filenames within the string. This can make it
impossible to unambiguously parse, so a heuristic is used to guess which spaces
are meant to be separators and which are part of file names. (See the
documentation string for the HeuristicArgParse() function for a description of
how it works). The heuristic should be pretty reliable when spaces are used in
filenames AND directory names, extremely reliable when spaces are allowed in
EITHER filenames OR directory names, and completely reliable in the
unambiguous case when there are no spaces in path names.

There is a completely different situation with CVSNT. CVSNT does escape spaces
and special characters with backslashes so no heuristic is needed. A separate
parsing routine is used for this case.

3) By default the loginfo handler will run the CVSNT parsing routine on windows
and the heuristic parsing routine on all other platforms. But since CVSNT has
been backported to Unix, there may be some people who need to override the
default. This can be done by tacking on a second parameter:

  ALL <VIEWCVS_INSTALLATION_DIRECTORY>/loginfo-handler %{sVv} <arg2>

where <arg2> is either "cvs", "cvsnt", or "brokencvsnt". "brokencvsnt" is for
some semi-recent versions of CVSNT which mistakenly escaped filenames twice.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@604 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-11 03:09:17 +00:00
rey4
dea026e417 - changed some popen calls to discard warnings from RCS utilities that occur
when reading CVSNT RCS files with nonstandard fields


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@603 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-11 02:59:58 +00:00
rey4
2f8d06bd7c - added C++ formatting for .hpp extension
- changed some popen calls to discard warnings from RCS utilities that occur
  when reading CVSNT RCS files with nonstandard fields
- caused exit after tarball generation to prevent html from being appended
  to the end of the tarball


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@602 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-11 02:59:25 +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
8ad4c2657e - now converts path names to a canonical format with the os.path.normcase()
function before sending them to the database to avoid the problems with
  multiple path spellings on windows


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@600 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-11 02:57:21 +00:00
rey4
6659847cb7 - removed unneccesary cvsroot path manipulation
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@599 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-11 02:56:33 +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
561a2074d3 - removed hardcoded links in query page
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@597 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-11 02:55:40 +00:00
rey4
0ecbd1d45d - added sapi.server.pageGlobals dictionary to hold values and objects that
need to be kept for the duration of a page load


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@596 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-11 02:54:53 +00:00
rey4
6b47a6c80f - explicitly set text and binary modes on calls to popen
- replaced some convoluted time converting code with a call to compat.timegm()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@595 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-09 10:10:43 +00:00
rey4
bed66c3ea8 now replaces forward slashes in windows paths with backslashes before
passing them to the database. also changed loginfo-handler to print
errors to the standard error stream instead of the standard out so
messages can get forwarded to the CVS client.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@594 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-09 10:05:00 +00:00
rey4
458cfb4785 removed this unused copy of popen.py (more recent version is lib/popen.py)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@593 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-09 10:00:13 +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
rey4
99b5381080 - updated to use new sapi module
- added support for php colorizing (using the colorizing capabilities of the
  php interpreter)
- replaced error() function with a ViewCVS exception class
- added explicit text 't' and binary 'b' mode flags to popen calls


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@591 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-09 09:50:44 +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
rey4
e7cb800f6d added new sapi module which abstracts away differences between the different
server environments that ViewCVS runs on (CGI, ASP, standalone)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@589 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-09 09:48:05 +00:00
rey4
007ea0d99d - got rid of mxDateTime dependency
- made database store times in UTC by default instead of using
  the local timezone of the machine running ViewCVS. For backwards
  compatibility a global variable dbi.dbi_utc_time can be set to
  zero to use old behavior
- fixed use of some nonexistent constants in cvsdb.py
- allow forward slashes in directory and repository conditions
  of database searches regardless of the default path separator
  used by the underlying os


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@588 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-09 09:33:12 +00:00
rey4
2b2f676ee3 worked around lack of working popen2.Popen3 class on windows
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@587 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-09 09:21:08 +00:00
rey4
2a8a87b1a6 updated to cope with colons and backslashes in windows paths
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@586 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-09 09:17:55 +00:00
rey4
c10162e3da updated installer for windows compatibility
- escaped backslashes in regular expressions
- added viewcvs.asp and query.asp to FILE_INFO_LIST
- set default install path to "Program Files" directory


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@585 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-09 09:16:09 +00:00
rey4
ac310d82cb fixed line endings
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@584 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-08 01:15:07 +00:00
timcera
595556b544 Need to set CVSROOT in order for spawned RCS utilities to correctly
expand $CVSHeader$.  See patch:
http://sourceforge.net/tracker/index.php?func=detail&aid=636331&group_id=18760&atid=318760


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@583 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-01 05:42:29 +00:00
timcera
bd78d04280 Bolding revision number. See patch
http://sourceforge.net/tracker/index.php?func=detail&aid=621979&group_id=18760&atid=318760


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@582 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-02-01 05:02:09 +00:00
timcera
59c63fab78 Added some filetypes to enscript's colorization list. Filetypes and enscript
settings used from
http://sourceforge.net/tracker/index.php?func=detail&aid=571973&group_id=18760&atid=318760


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@581 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-01-31 03:00:59 +00:00
cmpilato
a25b7cc8ba (view_directory_svn): pass diffoptions as a list instead of a string
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@580 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-01-27 17:36:29 +00:00
cmpilato
fa05f953c2 (view_directory_svn): allow empty log messages
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@579 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-01-27 16:36:00 +00:00
cmpilato
5eca0694fb Track changes in the Subversion bindings; use top-level svn modules
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@578 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-01-21 21:30:17 +00:00
pefu
8730954b1e Clarified usage text and removed one trailing blank
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@577 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-12-28 10:14:30 +00:00
cmpilato
932aa382f0 * viewcvs/lib/vclib/svn/__init__.py
(date_from_rev): New.

* viewcvs/lib/viewcvs.py
  (_re_extract_rev): Fix this regexp to allow Subversion-style
    revision numbers, too.
  (view_diff): Fix Subversion diff labels to have datestamps and revisions.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@576 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-12-13 19:01:02 +00:00
cmpilato
5a5450e4c9 Implement alternative URL scheme, and make Subversion a little more
public.  Miscellaneous Subversion bug fixes, too.

* viewcvs/lib/config.py
  (Config.set_defaults): Add default state for 'root_as_url_component'
    option.  Remove "CVS" from the 'general/address' and
    'general/main_title' default values.

* viewcvs/cgi/viewcvs.conf.dist
  Lots of documentation changes in here.
  (root_as_url_component, svn_roots, svn_parent_path): New options.
  (address, main_title): Lose the "CVS" in the value.

* viewcvs/lib/viewcvs.py
  (Request.__init__): Handle the new 'root_as_url_component' option.
  (list_roots): New.
  (clickable_path, download_url): Take any embedded roots into account
    during href generation.
  (view_diff): Fix the revision parsing here.  I dunno why I ever made
    this code CVS-specific in the first place...
  (view_log_svn): Populate 'roottype' data member.
  (view_log_cvs): Was view_log().  Populate 'roottype' data member.
  (view_directory_cvs, view_directory_svn): Use new list_roots()
    helper.  Also, calculate 'nav_path' unconditionally (it may be
    None, but it will at least be defined so templates can use it).
  (main): Update call to view_log_cvs().

* templates/directory.ezt
* templates/dir_alternate.ezt
  Take 'embedded_root' into account for href generation.

* templates/log.ezt
  Do some "CVS" vs. "Subversion" string changing.  Disable "annotate"
  link for Subversion.

* templates/log_table.ezt
  Disable "annotate" link for Subversion.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@575 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-12-12 02:02:52 +00:00
cmpilato
1e1b541063 track API rename
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@574 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-12-10 19:34:25 +00:00
cmpilato
794354e63a * viewcvs/templates/directory.ezt
* viewcvs/templates/dir_alternate.ezt
  Make the [hide] link conditional on the presence of the
    'attic_showing' data member. Also, treat the directory named 'Attic'
    special only for cvs roottypes.

* viewcvs/lib/viewcvs.py
  (view_directory_cvs): Setup the new 'attic_showing' data member.
  (view_directory_svn): Don't bother with the 'hide_attic_href' and
    'show_attic_href' data members.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@573 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-11-15 00:11:57 +00:00
timcera
6f118cda72 Code block removed that was supposed to handle some redirection issues
but failed under certain conditions (SERVER_URL not defined) and the
redirection problems are handles elsewhere in the code.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@572 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-22 03:01:53 +00:00
cmpilato
dabbdbd23c * lib/vclib/bincvs/__init__.py
Make BinCVSRepository a subclass of vclib.Repository.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@571 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-14 23:58:41 +00:00
gstein
f3ca7b9118 entity-escape some ampersand that go into the URLs on the page
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@570 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-10 23:14:23 +00:00
gstein
43c6a836e4 Fix the URL construction to use entities for the ampersands.
Submitted by: Ville Skytt� <scop@users.sourceforge.net>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@569 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-10 23:08:52 +00:00
gstein
53913a48d1 Fixes bug #536141 and #536144, submitted by Franz H�pfinger.
Escape the paths generated by clickable_path() and download_url()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@568 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-10 22:10:01 +00:00
gstein
42f004c911 Minor cleanups.
- remove the revision_symbolic_name since it was bogus and unused
- quote the outer table attributes for xhtml compat
- remove the unused usedlog
- change the line number formatting to simplify the width usage
  (through the '*' format character) and to make the name= anchor
  surround the actual number rather than empty space.
- use '*' for author formatting, too
- remove the '.diff' from the URLs


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@567 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-10 00:53:14 +00:00
gstein
8ec28642ba * lib/viewcvs.py (prepare_hidden_values): tweak the <input> tag to
make it xhtml compatible.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@566 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-10 00:18:39 +00:00
gstein
08a5af8aef Recognize cvsweb's custom MIME type. This allows people to upgrade
their cvsweb installation to ViewCVS and still have old URLs do the
right thing.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@565 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-10 00:14:57 +00:00
gstein
c82276049a Various changes:
- remove diff_font_face/size options and move the font stuff from code
  to the diff.ezt template
- move error() back to viewcvs.py and have config.py raise an
  exception (so config doesn't have to know about CGI stuff)
- revamp SVN parent path stuff to avoid catch-all try/except

* cgi/viewcvs.conf.dist: remove the diff_font_face and diff_font_size
    options. These are now part of the diff.ezt template.
    COMPAT BUSTER

* templates/diff.ezt: need to apply font changes since the EZT
    references no longer include them.

* lib/viewcvs.py:
  (error): moved (back) here from config.py
  (DiffSource._get_row): stop inserting HTML into the values; leave
    that for the template to do however it wants
  (handle_config): catching all exceptions is very, very dangerous.
    rework this code to avoid exceptions thru the use of
    os.path.exists() and wrap an OSError exception catcher around the
    small little bit that might throw it.

* lib/config.py:
  (error): shifted back to viewcvs.py
  (_parse_roots): shifted below the "important" part of this file,
    which is the config stuff. changed the error handling to throw an
    exception rather than call error()
  (MalformedRoot): new exception. note that ViewCVS includes code for
    catching exceptions and pretty-printing them to an HTML page, so
    we don't need a specific catch of this exception.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@564 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-09 04:04:03 +00:00
gstein
ddd22c15b5 A new utility module to compute sets of changed files inside a loginfo
handler. It properly deals with spaces in the paths and the filenames.
See the internal doc for more information.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@563 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-09 01:47:43 +00:00
gstein
37e1e3aa93 Fix up some of the imports. Some were not needed. Also avoided the
importing of bare names, so that references are vclib.FOO (more
obvious where FOO came from). Also fixed references to the
RCSStopParser name, which were unqualified (and would have failed).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@562 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-09 01:46:56 +00:00
cmpilato
97b7b4863b * viewcvs/lib/viewcvs.py
(handle_config): Oops.  Little fix for skipping non-repos dirs in
    the parent path.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@561 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-04 22:17:36 +00:00
cmpilato
b6e6db84c8 Implement a new svn_parent_path configuration variable.
* viewcvs/lib/config.py
  (Config.set_defaults): Add default value for 'svn_parent_path'.

* viewcvs/lib/viewcvs.py
  (handle_config): So special handling for 'svn_parent_path'.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@560 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-04 20:52:11 +00:00
cmpilato
341f1e8fe4 Hehheh...do some cleaning up, properly shutting down the repository
and terminating the APR stuffs.

* viewcvs/lib/viewcvs.py
  (Request.__init__): Update call to SubversionRepository.__init__().

* viewcvs/lib/vclib/svn/__init__.py
  (SubversionRepository.__init__): No longer take pool argument; do
    all the APR init stuffs inside this constructor.
  (SubversionRepository.__del__): New.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@559 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-03 15:06:35 +00:00
cmpilato
8fdacfb716 Finish getting that enscript stuff working for Subversion, and
implement rudimentary directory version jumping.

* viewcvs/lib/vclib/svn/__init__.py
  (date_from_rev): New.
  (StreamPipe): new class.
  (get_file_contents): now returns StreamPipe object.

* viewcvs/templates/directory.ezt
  Get some subversion directory-revision-jumping UI action on.

* viewcvs/lib/viewcvs.py
  (Request.__init__): Allow 'HEAD' as incoming 'rev' option.
  (view_checkout): Use new get_file_contents() return.
  (view_directory_svn): Populate new 'roottype', 'tree_rev' and
    'jump_rev' data members.
  (view_directory_cvs): Populate new 'roottype' data member.

* viewcvs/lib/config.py
  (set_defaults): Stop using real default values for cvs_roots and
    default_root.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@558 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-02 20:00:27 +00:00
cmpilato
749762bb37 * viewcvs/lib/viewcvs.py
(markup_stream): Only do log-reading for CVS right now.
  (view_log_svn): Fix the view link, and fix the selected rev comparison.
  (view_checkout): Try to get some enscript-y action going on here.
  (view_diff): Clarify a comment just a bit.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@557 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-02 17:32:38 +00:00
gstein
94ce93766d comment nit
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@556 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-01 21:14:57 +00:00
cmpilato
1c6914a304 * viewcvs/lib/viewcvs.py
(view_log_svn): Get "select for diffs" working.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@555 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-01 20:00:18 +00:00
cmpilato
0b682e93b2 Get some basic diff functionality working for Subversion.
* viewcvs/lib/vclib/svn/__init__.py
  (do_diff): New.

* viewcvs/lib/viewcvs.py
  (view_checkout): Be a little smarter with mime types.
  (view_diff_svn): Can this function (buh-bye).
  (view_diff): Get initial Subversion diff support in here.  Also,
    remove the cvs_filename parameter -- this path can be retrieved
    from the request object.
  (main): Update call to view_diff_svn and view_diff.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@554 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-10-01 19:20:37 +00:00
cmpilato
6760cc1c62 Address Issue #584803.
* viewcvs/lib/viewcvs.py
  (search_files): Skip unversioned files.  Thanks to David Resnick and
    Steve Frampton for noticing the problem.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@553 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-09-27 15:25:55 +00:00
cmpilato
b5d5e9d245 * viewcvs/lib/viewcvs.py
(handle_config): Use '' instead of None for the default value of
    "search".  A bug in urlencode() requires it.
  (view_diff_svn): New placeholder function.
  (Request.__init__, human_readable_diff): No longer chop the '.diff'
    off of the path.
  (main): Reorg the code here a bit.  I'm pretty sure I didn't
    actually change the logic outside of adding: redirect on file
    paths that have the extra '.diff' tacked on, and call the
    view_diff_svn stub at the right time.

* templates/log.ezt
* templates/log_table.ezt
* templates/include/diff_form.ezt
  Stop tacking that confounded ".diff" onto the diff queries.  The
  presence of r1 and r2 are enough to do the job.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@552 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-09-27 14:53:31 +00:00
cmpilato
d4271f954c * lib/viewcvs.py
(view_log_svn): New hacked-up half-hearted attempted at getting
    Subversion file revision history output.  Boy, if only those
    who've gone before me had documented the cryptic template data
    items, this kind of guesswork and weak deduction would be
    unnecessary... :-)
  (main): Do different stuff if 'rev' or checkout magic exists on a
    Subversion root request.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@551 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-09-23 17:01:23 +00:00
cmpilato
fefafefa2f * viewcvs/lib/vclib/svn/__init__.py
(LogReceiver.receiver): Add 'paths' argument (unused).
  (fetch_logs): _repos.get_logs is now _repos.svn_repos_get_logs.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@550 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-09-20 20:53:51 +00:00
cmpilato
c73e1cd5a4 * viewcvs/lib/vclib/svn/__init__.py
(_datestr_to_date, _fs_rev_props): New helpers.
  (LogEntry): Edit some comments.
  (LogReceiver): New.
  (get_logs): Use new helpers.
  (fetch_log, get_file_contents): New.
  (SubversionRepository.__init__): Store the repos item as a member.

* viewcvs/lib/viewcvs.py
  (main, view_checkout): Add crap-O Subversion file dump support (this
    is rather temporary, methinks).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@549 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-09-19 19:28:22 +00:00
cmpilato
87285b75f1 Fix datestamps and sorting for Subversion items.
* viewcvs/lib/vclib/svn/__init__.py
  (get_logs): Use the correct datestamp for Subversion tree items.

* viewcvs/lib/viewcvs.py
  (sort_file_data): Rename internal routine file_sort_cmp() to
    file_sort_cmp_cvs(), and add new file_sort_cmp_svn().  Add
    'roottype' argument to trigger which of those sort routines gets
     used.
  (view_directory_cvs): Update call to sort_file_data().
  (view_directory_svn): Update call to sort_file_data(), and populate
    the row data a little differently.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@548 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-09-10 17:15:08 +00:00
cmpilato
ab3b8795e3 Continue Subversion integration. Can now view trees (at any revision,
with minor browser Location bar hackery).

* viewcvs/lib/viewcvs.py
  (Request.__init__): Recognize 'rev' CGI field for Subversion roots.
  (sort_file_data): New, with file_sort_cmp() broken out from view_directory.
  (get_file_data_svn, view_directory_svn): New Subversions-specific functions
  (view_directory_cvs): Was view_directory.  Now uses sort_file_data() helper.
  (main): Use the appropriate view_directory_* function per roottype.

* viewcvs/lib/vclib/svn/__init__.py
  (LogEntry): New class (stolen with mods from bincvs)
  (get_logs): New.
  (SubversionRepository): Declare as a subclass of vclib.Repository.
  (SubversionRepository.__init__): Add optional 'rev' argument.  Also,
    make 'basepath' before trying to use it.
  (SubversionRepository._getvf_files, _getvf_subdirs): Fix references
    to 'pool', 'i' and 'thispath'.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@547 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-09-10 14:02:27 +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
cmpilato
f8f6b1a69b Itty-bitty docstring fixes.
* viewcvs/lib/vclib/__init__.py
  (Repository._getvf_info): Fix typ-o.

* viewcvs/lib/vclib/bincvs/__init__.py
  (BinCVSRepository._getvf_info): Fix typ-o.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@545 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-09-05 20:14:32 +00:00
cmpilato
e7c52618b4 Initial implementation of Subversion vclib module.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@544 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-09-05 15:24:25 +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
4b21d7cb88 Rip out the rlog parser that was in this file. Leverage the parser
from vclib.bincvs instead, and apply a small compatibility layer over
the top of it. tests/testparse.py was used to verify that the new
parser/wrapper is equivalent.

[ things can be simplified further by changing the callers to not
  require the compat wrapper ]


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@542 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-09-05 07:18:30 +00:00
gstein
974eb42d02 This module is no longer needed. Use the vclib.ccvs.rcsparse module
instead.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@541 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-09-05 07:12:30 +00:00
gstein
44b8e40d50 Switch over to the vclib.ccvs.rcsparse package.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@540 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-09-05 07:11:42 +00:00
gstein
fd4f86f49d Fix up the time processing, based on time processing fixes from
elsewhere (stupid replicated code; will need to fix in future).

Note that we need the 'compat' module here. Also another fix for
later.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@539 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-09-05 07:11:09 +00:00
gstein
7472b19243 Another module that I used for testing a conversion of rlog.py. Just
checking in the code in case something similar may be useful in the
future.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@538 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-09-05 07:00:39 +00:00
gstein
5c4edd8cef Switch to the vclib.ccvs version of rcsparse. Some other assorted
testing tidbits.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@537 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-09-05 06:57:49 +00:00
pefu
11ca5c1a37 Bugfix: wrong exception in except clause. Thanks to C. Michael (Mike) Pilato.
He wrote:
> Quick introduction: Hi, I'm C. Michael (Mike) Pilato, a Subversion
> developer (and CollabNet-employed subordinate of Greg Stein) who's
> trying to add Subversion repository support to ViewCVS.  I'm also
> trying to learn Python as I go, so I'm begging for patch review.
>
> Anyways, I figured I'd start off with a little patch that fixes a bug
> I noticed when I (intentionally, I swear) misconfigured ViewCVS.
>
> * lib/viewcvs.py
>   (Request.__init__): bincvs's BinCVSRepository.__init__ actually
>       throws a vclib.ReposNotFound exception.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@536 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-09-01 11:34:02 +00:00
gstein
dca08bb674 Rename to "path_parts" to clarify that we're referring to a list of
path segments rather than a pathname string.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@535 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-07-18 02:27:21 +00:00
pefu
90db34f205 Inspired by Lucas Bruand email describing the CVSGrab project I
added a new subsection to the home page containing a compiled list of
Links.  This is somewhat redundant with the information contained
in the ViewCVS INSTALL file.  But on the other hand people might
not view the INSTALL file using a web browser, so this list of
links might become handy for all people who want to install
ViewCVS on an operating system which was not delivered with all
those tools preinstalled and who have to grab all those software
from the Net piece by piece.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@534 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-06-15 10:06:12 +00:00
pefu
d7e6668ef3 Bugfix: Apply SF patch #569246: standalone+enscript = zombies
Holger Hoffst�tte (h2o) wrote:
> When run in standalone mode, using enscript will leave
> zombie processes hanging around. These will not exit
> until the standalone.py process is restarted. The
> attached patch solves this by properly wait()ing for
> the child process. CGI mode is not affected by this,
> since the viewcvs process exits after every request
> anyway.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@533 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-06-15 09:56:03 +00:00
pefu
854656ea8b Added a link to the EMail explaining the disadvantages of CVS keywords.
...and argghhh... Protect the CVS keyword only used as an example herein.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@532 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-06-13 06:04:32 +00:00
pefu
bcf951e1b5 Document current policy for the use of CVS $-keyword macros within
the stayle guide paragraph.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@531 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-06-12 16:54:15 +00:00
pefu
7f580e36dd Fix Python 1.5.2 compatibility problem pointed out in
http://mailman.lyra.org/pipermail/viewcvs-dev/2002-June/000722.html
Unfortunately even the current Python documentation misses to point out,
that the function timegm() was added to the calendar module at a later
release. :-(  I will submit a patch to the Python documentation.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@530 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-06-12 06:38:49 +00:00
lbruand
e944408e70 Small coding style fixes
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@529 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-06-11 21:27:06 +00:00
gstein
4a3bc3f33a Implement some fixes for recent changes.
* viewcvs.py (Request.__init__): when we switched to use vclib.bincvs,
    the path_parts erroneously contained a '.diff' extension. make
    sure to strip that (found by Peter Funk).

* vclib/__init__.py (class ReposNotFound): don't override the __init__
    the method. the base Exception class will handle the argument as a
    string, and print it out appropriately.
  (class ItemNotFound): clarify that this takes path_parts, then join
    them for the superclass.

* vclib/ccvs/__init__.py (CVSRepository.__init__): don't provide the
    path for the CVS repository (info leakage); just use the name.
  (CVSRepository._getpath): parts are passed, not a pathname; adjust
    variables to clarify this.
  (CVSRepository.getitem, CVSRepository.getitemtype): the ItemNotFound
    exception is defined to take path_parts, not a pathname.

* vclib/bincvs/__init__.py (BinCVSRepository.__init__): pass the name
    of the repository to the ReposNotFound exception.
  (BinCVSRepository.getitem, BinCVSRepository.getitemtype): the
    ItemNotFound exception is defined to take path_parts, not a
    pathname.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@528 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-06-11 19:32:03 +00:00
pefu
01d04c0397 This might be a clueless fix for the problem outlined in
http://mailman.lyra.org/pipermail/viewcvs-dev/2002-June/000725.html
But it works for me.  Diff display now works again.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@527 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-06-11 17:42:58 +00:00
lbruand
d857b82cac Modified ccvs so that it conforms to the new API by Greg.
Modified a bit the API also:
 * Added a Versitem class from which both Versfile and Versitem inherite.
 * Added a show_CVSROOT constructor parameter in the CVSRepository.

Now that I am looking over to this code after some time, There are number
of concerns/interrogation that are coming to my mind:
 - Why not go into some more abstraction/polymorphism with the items  ( e.g.
Versfiles and Versdirs):
	shouldn't Versitems  have only one common getitemlist methods ?
	that would return Versitems
( and not two "getsubdirs" and "getfiles" methods...)

 - Quite obviously there are cyclic references in this library.
     This will flaw garbage collection.
    e.g. Versfile points to Repository. and so on...
  According to me deleting a Repository should in turn, result in the destruction of
 its subitems.
 - Another point of concern, we will have to deal with is
multithreading...  One of the current problem of viewcvs is that it does not
have multithreading. ( being a cgi it's kind of normal)  Now, having
multithreading capabilities in vclib would definitely leverage the
difficulty of porting  viewcvs to a servlet-like behaviour. A servlet-like
behaviour would be a big win for speed, according to me.

 - A very important ( if not vital) feature is lacking:
    You cannot select a tag to view in the repository ...
 - There is a problem with subversion ( named svn, from now on...):
svn, as you probably know, represent the evolution of a file hierarchy over time and not the
 evolution of files in hierarchy ( as in CVS). This API does not work with this kind of behaviour.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@526 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-06-09 22:20:23 +00:00
pefu
7e2052b962 Apply SF patch #565579 by Bill Newcomb (nuke999):
Correct handling of daylight saving

Bill wrote:
> While installing ViewCVS to be used with our (large,
> old, many-branched) repository, we encountered problems
> while trying to build the checkin database.  We
> eventually traced the problems to a file that had a
> checkin on the first sunday of april, when daylight
> saving time begins in the us.  The time of the checkin
> was 02:24 UTC, which is a perfectly reasonable time
> (it's actually still saturday  PST), but feeding that
> time to timelocal will generate an uncaught exception
> in rlog.py.  timegm() has been part of calendar.py
> since at least python 1.5.2, so it seems like an easy
> choice to fix this so it's more robust.  The following
> patch allowed us to get everything converted and
> running, and we really like all the extra stuff that
> ViewCVS has vs. cvsweb.

> rcsparse.py has a similar problem that is apparently
> not exercised by ViewCVS but did trip me up when I
> tried to use it with Subversion's repository converter.
>  There don't appear to my (admittedly Python-naive)
> eyes to be any other places in ViewCVS that use
> timelocal, so I think this should do it.

This patch looks reasonable to me and didn't break anything here.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@525 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-06-07 06:07:30 +00:00
pefu
d92ff2f95e People hacking on templates have difficulties to track down errors.
This is a minor improvement on ezt template syntax error reporting.
Added two examples of bad template syntax to doctest section of the
module docstring.  Added doc string to the exception classes.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@524 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-06-06 13:05:57 +00:00
pefu
5a4a1b7216 Improved error reporting for a certain case of a malformed viewcvs.conf
configuration file.  That happened recently to some new user of ViewCVS.
Users unfamilar with Python have difficulties to interpret a Traceback
printout.

In order to implement this I decided to move the utility function
error() from module lib/viewcvs.py into the module lib/config.py and
import error() in viewcvs from module config.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@523 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-06-06 07:32:18 +00:00
pefu
2ed28fbc92 More detailed instructions how to implement access restrictions using Apache.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@522 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-06-06 06:22:00 +00:00
gstein
6925412e53 This commit contains three changes, which I couldn't split back apart
very easily (sorry):

1) use LogEntry for the fileinfo stuff
2) use bincvs.Repository for some basic functionality
3) update bincvs.__init__.py to the API that was checked in last week

* viewcvs.py

  (class Request): remember the split path parts. refine some of the
    error logic and messages. replace .cvsrep and .cvsroot with a
    Repository instance (and use .name and .rootpath instead).
  (_validate_cvsroot): refine the error message
  (clickable_path): use request.repos
  (view_directory, generate_tarball): use request.repos. use LogEntry
    for fileinfo.
  (file_sort_cmp): update for LogEntry
  (view_annotate, cvsgraph_image, viewcvs_graph, search_files,
      view_diff): use repos.rootpath rather than .cvsroot
  (main): tweak the ordering of some checks and dispatching. use the
    repos.itemtype() functionality to test for "is a directory".
    remove test for whether the CVS root exists -- it was done during
    the Request initialization.

* vclib/bincvs/__init__.py

  (_FILE_HAD_ERROR): copied over from viewcvs.py
  (class LogError): new class (unused so far) to represent an error.
  (process_rlog_output): use LogEntry for fileinfo rather than a tuple
  (class BinCVSRepository):
    - change the init to verify the root is a directory, and store the
      name and rootpath (rootpath used to be called basepath).
    - add new .getitem() and .itemtype() methods for retrieving and
      querying about items, respectively.
    - tweak _getpath() joining of paths so we don't have to worry
      about adding a separator onto .rootpath.
    - remove .getfile() (now part of getitem).
    - replace .getsubdirs() with ._getvf_subdirs().
    - replace .getfiles() with ._getvf_files().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@521 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-06-03 18:35:06 +00:00
gstein
2eb0e6d7b5 Update the API a bit.
* remove .getfile(), .getfiles(), .getsubdirs() from the Repository
  object. add .getitem() as a replacment for fetching items. add
  .itemtype() for determining the type of an item before retrieval.

* add the Versdir class for representing a directory within a
  versioning repository. it implements .getfiles() and .getsubdirs()
  methods for retriving information from within the directory.

* add ._getvf_files() and ._getvf_subdirs() to the Repository for use
  by the Versdir class instances.

* add FILE and DIR symbols for denoting the type of an object in the
  repository. set them as class attributes in Versdir or Versfile.

* add some exception classes for use by concrete vclib implementations


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@520 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-05-30 22:21:54 +00:00
gstein
3c5cb27b94 Upgrade our parameter checking (to resolve CSS attacks) to a much
stricter validation suite.

The 'search' parameter is still not validated, but it is not enabled
by default, and it shouldn't be enabled except in very secure
situations.
(it should still be cgi-escaped at some point for proper display on
 the HTML page, but we don't need to worry about CSS attacks from that
 angle right now)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@519 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-05-24 07:08:34 +00:00
gstein
0ab5f2107e Problem found by Daniel Rall <dlr@collab.net>:
Netscape 4.x and early Mozillas would not send qvalues with their
    language tags. Even for a simple case (browser sends "en, ja" and
    we have en and ja available), we could produce unexpected (read:
    erroneous) results.

Thus, we now select from multiple matches based on the ordering of the
items in the Accept-Language: header.

I've also added more comments to this code since some of it is rather
opaque.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@518 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-05-23 19:13:40 +00:00
gstein
4ea09932a2 Only attempt to set paths in the Python source code. We don't want to
accidentally do this in a jpeg or whatever. (yah, unlikely, but it is
easy to say "just python source" since we already have the flag)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@517 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-05-22 09:01:14 +00:00
gstein
cf4f673448 Remove items that have been shifted over to vclib.bincvs
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@516 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-05-22 01:17:42 +00:00
gstein
e3a4336d40 Enable installation of entire trees so that we don't have to name all
the files individually.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@515 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-05-22 01:16:07 +00:00
gstein
f7fc5bb6f7 Various fixes to realign the functions from viewcvs back to their
original form, to tweak the imports, and to get the functions working
within their new context.

* realign parse_log_header() with the original from viewcvs.py. rather
  than updating a target object, the caller just grabs the relevant
  data from the returned LogHeader object.

* bring over various global constants for the parsing (e.g. _EOF_*)

* pass 'rcs_path' since cfg.general.rcs_path is not available

* add fetch_log() from viewcvs.py. only change is to pass rcs_path.

* change imports:
  - import 'vclib' rather than symbols from 'vclib'
  - import 'time' and 'compat' for some functions
  - don't import 'exceptions' since those are builtin anyways


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@514 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-05-21 22:47:16 +00:00
timcera
99ab86e91c Added redirection for bare script name that is missing the trailing '/'.
* Request class now tests for 'PATH_INFO', if None, then redirects URL.
  Required 'SERVER_URL' in order to not have the server remove the '/'.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@513 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-05-17 17:42:12 +00:00
pefu
a9a59a9961 Tim Cera wrote:
>   Added UTC/localtime feature based on patch supplied by Guy Davis in
>   '[ 548889 ] Local time display option'.
[...]
I got CET displayed even for times in July, where it should read CEST
since we are 2 hours earlier here in summer instead of the usual 1 hour in
winter due to daylight saving time.  Hopefully I fixed this correctly.

Unfortunately nobody committed something into my CVS repository in those
nights where transitions from normal to daylight saving time and vice versa
happened.  So I didn't tested those particular nesty cases of time display.

BTW: I believe the whole idea of daylight savings time sucks...  but since
we have this everywhere here in the EU this is not going to change soon. :-(


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@512 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-05-06 06:43:39 +00:00
pefu
cb5c3b30d3 Added a new toggle to the Tkinter GUI to be able to test the
the new 'use_localtime' configuration option added by Tim Cera
yesterday (based on SF patch #548889 by Guy Davis).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@511 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-05-06 06:17:46 +00:00
timcera
ce16ab01b0 Added UTC/localtime feature based on patch supplied by Guy Davis in
'[ 548889 ] Local time display option'.
* Made a 'make_time_string' function that returns formatted date
  string in localtime or UTC, based on configuration choices.
* Added 'use_localtime' option in 'cgi/viewcvs.conf.dist' and
  'lib/config.py'.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@510 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-05-06 02:05:25 +00:00
timcera
1b9de04258 * Added 'GNUmakefile' to enscript_filename so that enscript will color
GNUmakefiles.  See 'Feature Request' - '[ 551690 ] colorize GNUmakefile
  like makefile'.
* Moved '.for: fortran' in enscript_extensions to maintain sort order.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@509 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-05-05 12:03:55 +00:00
timcera
c01aa7d4fe For some reason, Python 1.5.2 would not accept a compiled pattern. Moved the
pattern text directly into the re.search.  This search is for nefarious
characters :-) that could be used in a CSS attack.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@508 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-04-30 19:39:51 +00:00
timcera
837c82f2f1 Changes to the onClick handlers. Patch from Ville Skytt� (scop).
Basically include a 'return false;' and replace 'about:blank's.
See [ 541050 ] Bad onclick handler implementation at
http://sourceforge.net/tracker/index.php?func=detail&aid=541050&group_id=18760&atid=318760


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@507 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-04-27 20:24:12 +00:00
gstein
217169c9f8 Fix the style in these two files. Lots of white space was needed.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@506 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-04-26 08:51:05 +00:00
gstein
18b0f10c6e switch to a single, top-level makefile
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@505 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-04-26 08:01:41 +00:00
gstein
70d991b700 Big changes to the basic elem extraction tools.
* elx-common.c: new file for common file handling and token / symbol
    output.

* elx.h: expanded for new functions in elx-common.

* elx-java.c: switch to using a context for the files, and rely on the
    common functions to open/close and output stuff.

* elx-python.c: switch to using a context for the files, and rely on
    the common functions to open/close and output stuff. the
    identifier that we fetch is now null-term'd, so don't bother with
    a bunch of stuff to null-term it.

* scanner.c: null-term the identifier.

* elx_html.py: generate a full page, not just a body. use buffers to
    reference slices, rather than constructing slices. (and some test
    code to try binary files)

* add a couple .cvsignore files


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@504 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-04-26 08:00:53 +00:00
timcera
10ed9dbf05 Sorting not working right, but for different reasons.
* Did something about the 'None' values from fileinfo.  Now 'None' values
  are changed to _FILE_HAD_ERROR.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@503 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-04-18 02:54:21 +00:00
timcera
96300b1257 Sorting in the directory view under some situations would fail.
* Included patch from "[ 523275 ] Sorting bug fix (0.9.2)" from Jordan Russell
* Removed the substitution of "None" for "_FILE_HAD_ERROR" and changed
  tests appropriately.
* Moved section of code that sorts the filenames and changed logic.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@502 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-04-15 03:01:48 +00:00
lbruand
b7ced98ac2 debugged a checkout bug when a revision had a two-digit last number in a branch.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@501 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-04-14 21:31:41 +00:00
lbruand
25b5885a6b A working version of vclib.ccvs. Need a lot of debugging. Writing a driver
(called bincvs) for vclib that uses rlog and co binary rcs commands.
Added a few tests scripts.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@500 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-04-13 09:43:22 +00:00
timcera
6777801f27 A very low tech approach at validating URL input. Greg wants
restriction of each variable to it's allowed set of values, but I
couldn't do that quickly.  This works and I think a little easier
to maintain.  If it is found lacking I can improve later.  If a re
search of value finds '\'|"|<|>' the (name, value) pair is not put
into query_dict.  I can't think of a ViewCVS created URL, except
for search, that would have any of those characters.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@499 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-04-01 01:32:16 +00:00
gstein
cdaba43ea1 I've been screwing around for *days* trying to tweak this darned Java
grammar. Forget it for now, and checkpoint what I've done.

The elx-python and elx-java programs produce "element" text files
which can then be consumed by elx_html.py to produce syntax-colored
HTML output. elx_page.sh is a little wrapper around that to produce a
full page.

The Python stuff seems quite fine, and is blazing fast (the scanner
runs over 100k lines/second). The Java grammar is horked, so it does
work (the Java scanner seems fine; just the grammar).

Lots more to do on this, but I'm out for the weekend, so this it's
time to check point this. Maybe someone will have better ideas on how
to fix the Java parser. Note that this stuff requires the 'msta' and
'shilka' programs from the 'cocom' toolkit.

I still need to package this up nicely (some copyright/license
notices, better makefiles, some minimal doc, etc). I also want to mess
around with profiling the syntax coloring. It appears to be a bit
slower than enscript right now, but it shouldn't be since we've
already parsed the file by that point (gonna try binary element files,
and some perf improvements to elx_html.py).

General theory: write elx-* for any language needing cross-referencing
capabilities (things that only need hiliting can continue to use
enscript). The elx-* programs can be implemented in any fashion, as
long as it produces the element description file. Python, Perl, pure
C, automated scanner/parser, whatever.

Future steps include using the element description file to get
function names, to index them, and to feed that into the HTML
generation. It would also be quite possible to feed the element
descriptions right into a database and query from there.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@498 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-03-15 01:54:28 +00:00
pefu
c4942bf983 Russell Yanofsky (rey4@sourceforge.net) obviuosly spend a lot of time
porting ViewCVS to windows and added ASP support.  His patch #526282
is quite huge and this first step only commits the newfiles.tgz to CVS,
because this shouldn't break anything.  I will not commit the actual
patches contained in diff.txt until I've spend some time testing it here
with Linux because Russell wrote he didn't has the possibility to test
with Unix.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@497 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-03-06 09:53:08 +00:00
pefu
fb897f7db8 As pointed out on the mailing list, the TCPServer class from the
Python standard library is missing a close_request method.  See
Lucas Bruands followup message in SF patch #522034 and Greg Steins
mail:
   http://mailman.lyra.org/pipermail/viewcvs-dev/2002-February/000562.html
Furthermore I added a try except IOError-clause to catch those
Broken Python exceptions, if someone hits the Stop-button of his
browser while retrieving a huge page.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@496 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-03-01 07:32:07 +00:00
pefu
2fbce441df Started spring cleanup... ;-) A lot more is missing here.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@495 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-28 17:59:12 +00:00
pefu
a80d3e8cb8 apply a slightly modified version of Lucas Brand patch #522034
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@494 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-28 17:53:00 +00:00
gstein
e47409ce23 Minor tweaks to get this stuff working.
* ccvs/__init__.py: the package is 'vclib' rather than 'versionlib'

* rcsparse/texttools.py: the string module is needed


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@493 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-23 00:16:18 +00:00
akr
b80e352f5e Don't contain a forbidden module in a tarball.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@492 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-22 09:20:46 +00:00
pefu
10cf1131c5 Esben Haabendal Soerensen suggested on viewcvs-dev:
> Ville Skytt <ville.skytta@xemacs.org> writes:

> > I noticed some problems with the sunsite.dk ViewCVS setup
> > (cvs.xemacs.org in particular) that look like virtual host configuration
> > problems.
> >
> > I'm CC'ing viewcvs-dev in case someone there wants to look at the python
> > traceback.
> >
> > If the Host: header sent by a browser contains the port number (eg.
> > Host: cvs.xemacs.org:80), ViewCVS fails. If the :80 part is not in the
> > header, everything works fine. It looks like a problem specific to
> > sunsite.dk (for example http://cvs.open-bio.org/ doesn't have the same
> > problem and is running ViewCVS 0.9.2 too). To reproduce:

> I have fixed this problem.  It is necessary to add the special case
> with :80 appended.  So I now have:

> [vhosts]
> main = cvs.sunsite.dk, cvs.sunsite.dk:80
> xemacs = cvs.xemacs.org, cvs.xemacs.org:80

> In our viewcvs.conf.  My guess is that Sunsite.dk is not the first and
> will not be the last site to not think of this.  Perhaps future
> versions of ViewCVS could ignore port numbers if only one vhost
> matches the domain...

In fact I now simply ignore the port number in vhost lookup.
Please tell me if this is to harsh.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@491 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-20 07:11:48 +00:00
pefu
caed1bbc6f Improve misleading docstring (Thanks to Lucas Bruand for pointing this out).
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@490 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-20 07:02:08 +00:00
lbruand
fca8276255 Memory leaks bugfix, by D. Berlin
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@489 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-19 20:22:11 +00:00
pefu
09aee9f2a8 I've tried to optimize Tims new prepare_hidden_values() function and
added a doc string.
I'm not really sure, whether the well known Python idiom to perform
string concatenation through list.append() will really pay off
here, since the list of hidden values is really short most of the time.
But I couldn't resist.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@488 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-19 15:55:57 +00:00
pefu
1d1b308d87 During testing with standalone.py I got a lot of
annoying 301 redirection "errors".  I tracked them
down to missing trailing slashes.  This change adds
these slashes to the directory URLs.  I'm not sure
whether this is right cure for the problem.  Please
review and comment.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@487 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-19 15:51:06 +00:00
pefu
f583f7fc50 Sync with Tims changes to directory.ezt
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@486 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-19 15:26:10 +00:00
pefu
53b39b5950 Modified the '-r' option to aid testing of ViewCVS with more than one
repository withut actually having to install ViewCVS.  I now usually
use ./standalone.py -g -r /cvs1 -r /cvs2 to test my uncommited hacks to
the ViewCVS sources.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@485 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-19 15:02:11 +00:00
timcera
10a05b47f1 I think this fixes the cvsroot= not being propogated correctly in
the URLs.  It also fixes a problem with directory.ezt not having
closed </form> tags under certain conditions.
  *) Abstracted out a prepare_hidden_values function to create the
     appropriate hidden values for a particular form.  Should have
     everything in _sticky_vars in the request object as a hidden
     value EXCEPT the value(s) set by the form.
  *) Edited directory.ezt to use the new system.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@484 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-19 10:52:23 +00:00
lbruand
ed3bf198b7 remove tparse/sink.py & testtp.py, now redundant
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@483 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-13 18:24:55 +00:00
lbruand
718b506a9f * Removed debugging statments from the (C++) Sink class.
* Changed INSTALL to reflect the move of rcsparse to lib/vclib/ccvs/rcsparse.
  * Now when tparse cannot import common.py, it fails.
  * Added check for sink being of common.Sink class.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@482 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-13 18:19:12 +00:00
gstein
2acf85261a Some whitspace, spelling, and minor formatting tweaks. No functoinal
change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@481 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-13 13:37:46 +00:00
gstein
ff8d47b670 Shift around some more code. Remove duplicate Parser classes.
* __init__.py: revise the import tests to just end up with an exported
  function named "parse" to parse an RCS file. move the test/debug
  functions to the new debug.py module.

* common.py: add mising imports. move DebugSink and DumpSink classes
  to the new debug.py module. tweak the RCSExpected class a bit to
  call the init method for its parent. move the Parser class here,
  expecting subclasses to set the .stream_class attribute.

* default.py: toss the 'time' import and import 'common' as a module,
  rather than getting all symbols from it. clarify where the
  CHUNK_SIZE value comes from. use common._Parser, but leave the
  parse_rcs_admin() method until we fix the token parsing for proper
  ":" handling.

* texttools.py: use 'common' as a module, rather than grabbing
  symbols. clarify CHUNK_SIZE. use common._Parser

* debug.py: shift DebugSink, DumpSink, and some utility funcs here.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@480 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-13 12:17:38 +00:00
gstein
455641bf37 Renamed these two files for clarity. No changes (those will come in a
separate commit, where we can actually see/record diffs more easily).

* pythparse.py was renamed to default.py: "pyth" is a funny
  abbreviation, "parse" is redundant with the "rcsparse" package name.
  this is intended as the default/fallback parser, so "default" is good.

* textparse.py was renamed to texttools.py: "text" is too generic.
  "texttools" describes the basis of the module better.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@479 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-13 10:53:38 +00:00
gstein
a86ad034e2 These files somehow got ^M characters into them, but were not being
subjected to proper newline translation. Removing the ^M characters so
that we can get some good diffs occurring, and to (hopefully) fix the
translation stuff.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@478 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-13 08:31:36 +00:00
lbruand
928ffd54d6 Import of vclib
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@477 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-11 21:03:31 +00:00
lbruand
87f43f02d5 Support for parser exceptions RCS*
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@476 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-11 20:13:50 +00:00
lbruand
8eec37e768 Daniel Berlin's patch
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@475 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-08 17:32:27 +00:00
pefu
9843b1b890 Improved diagnostics, if modules are not availabe on a certain Python
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@474 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-08 08:26:54 +00:00
pefu
6c216e387e Fixed sequence in content listing. Added a note about
standalone -g requiring thread support and Tkinter


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@473 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-08 07:39:10 +00:00
pefu
44918c941c Added a new section about Apache configuration
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@472 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-08 07:13:44 +00:00
timcera
314efa19da Added down.png and up.png for sorting on dir pages.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@471 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-07 13:21:21 +00:00
pefu
67de5edd63 Correct hasty checkin (URL path to icons went wrong)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@470 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-07 10:03:29 +00:00
pefu
1d120d8991 Inspired by Tim Ceras EMail this morning
( http://mailman.lyra.org/pipermail/viewcvs-dev/2002-February/000485.html )
I added sort direction toggles to the directory view.  It works.
But unfortunately the table header code in the template becomes very
bloated.  So I decided to put this only into dir_alternate.ezt for the
time being.  Please play around with it and review.  Putting
directory.ezt back into sync can be done later.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@469 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-07 09:08:50 +00:00
timcera
8b95292331 Hopefully adapts to enscript version 1.6.3 and later.
Shifted to the long options for enscript.  The short options are
either no longer tolerant of a missing ',' or they have changed.

Tested with enscript 1.6.2, so nothing has broken, but still need
verification that ViewCVS works with 1.6.3.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@468 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-05 22:55:03 +00:00
pefu
0988e943f6 see http://mailman.lyra.org/pipermail/viewcvs-dev/2002-February/000475.html
That's why I tried to improve diagnostics here


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@467 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-05 08:16:19 +00:00
pefu
30b78cf376 Added the recently added 'use_pagesize' option to the GUI
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@466 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-05 07:24:37 +00:00
pefu
2c9ccd262e Trying to keep this in sync with directory.ezt. :-(
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@465 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-01 07:40:21 +00:00
timcera
44651e5b2e * Fixed bug where a directory of only directories still had the search
files option.
  * Rearranged table to make 'Show all files' button lined up with the 'Show'
    button.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@464 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-01 04:08:51 +00:00
timcera
794a72f201 Added a page number to the page pick list.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@463 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-01 04:05:46 +00:00
timcera
705a54514e Corrected small errors noticed by pychecker.
* Multiple imports of the same module.
  * Module imported but never used.
  * Variables only used once.
  * Corrected deprecated modules.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@462 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-01 03:43:56 +00:00
timcera
8004d3ed59 Made common elements of the log templates into include files. Makes the
templates much easier to read and allows easier movement of the
elements around on the page.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@461 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-01 03:29:25 +00:00
timcera
d72922d81b This changes the behavoir of the View and Download links on log and log_table.
* For text files:
  'Download' opens download to file dialog box
  'View as Text' displays revision in new window
  'View as markup' displays enscript colored view with header information
  'View annotated' displays blame

* For gif, jpeg, and png:
  'View' displays graphic with header information similar to text markup

* For other binaries:
  'View/Download' will either view or download depending on browser's
   mime type / application settings.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@460 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-02-01 03:02:17 +00:00
lbruand
6afc2fb4f1 return wrong value in tparse.cpp
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@459 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-30 18:27:34 +00:00
lbruand
05e605e3da Few modification and debugging...
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@458 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-30 18:24:17 +00:00
gstein
3d6755bcde Fix construction of state token: it was always appending a space, when
it should do that only when multiple states are found.

Fix parsing of dates. Some CVS files have a two-digit year (e.g. 99).
So we try parsing a 2-digit year first; if that fails, then we try a
four digit year.

timelog.compare_fetch() now shows tparse generating the same output to
the sink.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@457 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-29 11:30:10 +00:00
gstein
b37103c4d7 Check in the mxTextTools-based parser that I implemented back in
November. The timelog.fetch_log2() timing dropped from .53 seconds for
my test input to .34 seconds. Overall stream speed dropped from .25
seconds to .10 seconds.

This also introduces an mget() method on the token stream so that the
parser can get multiple tokens in one shot, rather than needing to
call many times.

In timelog, I've added a new compare_many() for big verifications,
time_stream to time individual token streams, profile_stream for
profiling streams, and revised the time_fetch function to do multiple
fetches and to trim the exceptional cases off the ends before
reporting.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@456 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-29 10:08:46 +00:00
lbruand
2c245d2bdb CHANGES update
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@455 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-27 14:01:53 +00:00
lbruand
fdb39468d3 added INSTALL file and various small modif.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@454 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-27 13:57:29 +00:00
lbruand
a163e8b5b8 Initial revision of the C++ RCS parser.
VS: ----------------------------------------------------------------------


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@453 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-25 17:36:15 +00:00
timcera
a25b2de3f9 This corrects some problems with rcsdiff header processing.
* Symbolic constants for tests.
* Moved text to diff.ezt template.
* Used elif to clean up logic.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@452 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-24 02:17:53 +00:00
timcera
ed9d473ff1 * Added template components to templates/include.
* Added description of remaining install step at end of install.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@451 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-23 05:24:31 +00:00
timcera
d24e850723 Added complete processing of rcsdiff header.
* Binary files are treated appropriately, detecting if there are differences
  or not.  Should fix part of feature request '[ #497044 ] Hide Diffs for
  Binaries'.
* Detects whether diff is accessible to rcsdiff and whether diff is GNU diff.
  Might move a diff test to viewcvs-install.  Advantage to it being here is
  that it responds to the CGI environment.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@450 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-23 05:05:18 +00:00
timcera
a30ae3877a Created template components and put in templates/include directory.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@449 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-23 04:18:26 +00:00
pefu
d54413e580 Don't complain about the release files kept in
/home/groups/v/vi/viewcvs/htdocs @ sf.net when doing a cvs update there


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@448 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-22 08:51:06 +00:00
pefu
8145be1151 Added a comment pointing out, that the -C option of enscript doesn'nt work
with HTML output.  TODO:  Invent a way to generate line numbers.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@447 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-22 08:42:23 +00:00
pefu
40e4f03f27 Added a paragraph clarifying howto upgrade to the latest version with
skipping one or more releases inbetween.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@446 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-22 08:38:21 +00:00
timcera
477599ee40 * Used pychecker to identify unused variables.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@445 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-17 04:01:08 +00:00
timcera
1f72a98e9e * Fixed bug in search_files where every file was identified as 'text/plain'. This was from not removing the ',v' from the file name before it was tested by mimetypes.
* Made the test for text files much clearer to read.
* Added/changed comments in search_files.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@444 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-17 03:52:20 +00:00
gstein
cd5fedd3dd update for 0.9.2
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@441 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-15 09:55:01 +00:00
gstein
dff5d57e76 describe the changes in 0.9.2
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@438 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-15 09:10:43 +00:00
gstein
c832f96e5b Fix a problem with diffs between revisions that have no changes. The
state was never getting set to "done" (== was used rather than =).
This also uncovered a problem where left_col and right_col were not
initialized before use, so get them set to empty values.

Reported by: Sam Mason <smason@mtc.ricardo.com>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@437 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-10 01:26:36 +00:00
akr
385c97ba04 redirect to Attic for diffs didn't work.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@436 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-05 05:40:09 +00:00
pefu
4fcf12e391 Richard Offer posted Patch [ #498165 ] listen on non loopback interfaces:
> The attached patch adds the ability for the standalone
> server to listen on interfaces other than the loopback
> (localhost).
>
>  usage:
>
>  ./standalone -h `hostname`
>
>  Will allow anyone not on the localmachine to still view
> the cvs repo, without requiring a full-blown web server
> be set up first.
>
>
>  Patch is against release 0.9.1

I must admit, that I personally don't fully understand, why this
should be required.  But after adding some additional lines to the
gui() function and to the option initialization I applied this patch.
I tested it here with the name of my notebook and didn't see any
difference.  So at least it didn't hurt. ;-)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@435 8cb11bc2-c004-0410-86c3-e597b4017df7
2002-01-02 18:50:57 +00:00
timcera
16bcb9e218 Added paging capability.
* Added use_pagesize to viewcvs.conf.dist and config.py
  * Modified directory and log templates to have a <select>
    pulldown menu based on files for directory views and revs
    for file logs.  Also setup to make the current page the
    'selected' item in the pulldown.
  * Added paging function to viewcvs.py.  Called from
    view_directory and view_log.
  * Added two variables to the _sticky_vars, dir_pagestart and
    log_pagestart.  Couldn't use a single pagestart var because
    it stuck around between the directory and log pages.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@434 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-31 04:39:34 +00:00
gstein
f75d262553 I disagree that 0.10 is confusing, but I guess we *do* have to call
this thing 1.0 at some point :-)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@433 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-27 08:17:53 +00:00
gstein
49b970079c More info on making a release.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@432 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-27 08:17:07 +00:00
gstein
b815e6ece7 update for 0.9.1
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@430 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-27 05:18:35 +00:00
gstein
c35dabcaeb Rolling 0.9.1
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@429 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-27 05:17:51 +00:00
gstein
f45b5f8d7f bleck... a debug statement was left in the code. all those people with
0.9 are going to see a really large /tmp/log file...


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@428 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-27 05:15:47 +00:00
pefu
44528c0b7e quick backport to Python 1.5.2
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@427 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-24 11:38:30 +00:00
pefu
11f594b7ed Using 0.10 as a version number AFTER 0.9 is a really bad idea and
will cause a lot of confusion, because many people will think 0.10 < 0.9!

Since the main functionality of ViewCVS is mature, there is no need to
avoid bumping up the version up to 1.0-dev.  I do that right now.

Merry Xmas to all.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@426 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-23 15:54:18 +00:00
gstein
8a9719a5f8 we're developing 0.10 now...
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@425 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-23 12:04:32 +00:00
gstein
7ca272ab88 updates for 0.9
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@423 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-23 11:26:46 +00:00
gstein
d13e98ef34 rolling 0.9
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@422 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-23 11:15:50 +00:00
gstein
ba99093be8 fix the test for selecting the "Side by Side" popup
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@421 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-23 10:34:14 +00:00
gstein
9171ad07a8 Add a missing UTC onto the revision's date.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@420 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-23 09:58:33 +00:00
gstein
cd03714ecd Stop defining page titles in the code, and do it in the templates
instead.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@419 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-23 09:57:06 +00:00
gstein
df09de394d Add arguments to [include] directives. This allows the caller to pass
in additional arguments to the target EZT file. The target file can
refer to the arguments as [arg0] thru [argN].

Example usage: [include "header.ezt" "annotate"]


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@418 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-23 09:47:26 +00:00
gstein
f46fed363e Provide for a way to internationalize the "ago" times in the pages.
(need to put instructions somewhere, but in brief:)

An admin can create a KV file in the [i18n] domain:

kv_files = [i18n]data/%lang%-text.conf

That KV file should have a [time] section and options named
%(name)_singular and %(name)_plural, where name is one of: second,
minute, hour, day, week, month, year. Each of the values should be
like: %d second. Additionally, one option name "little_time" with a
value like: very little time  (e.g. no format specifier).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@417 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-23 07:07:14 +00:00
gstein
b41bd99aa3 Fix a bug where accidentally overwrote [nav_path] with the file
navigation. Change the file navigation to [nav_file] (in the code and
the template)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@416 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-23 04:47:18 +00:00
gstein
c9710b9ba2 remove the "diff_name" variable; it is unused and we don't want
(language-specific) text in the source.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@415 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-23 04:18:42 +00:00
gstein
5ca27eee4c Revise some of the attic handling to clarify what is happening, some
of the naming, and shift some text from the program to the templates.

* viewcvs.conf.dist: clarify description of the hide_attic default

* viewcvs.py: add [show_attic_href], [hide_attic_href], and
    [rows.state] variables for managing the attic links. remove the
    [rows.hide_attic_href] and [rows.attic] variables.

* directory.ezt, dir_alternate.ezt: use the new vars to insert the
    text/links for the attic handling.

* upgrading.html: document the template variable changes. a few other
    tweaks.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@414 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-23 04:13:35 +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
1470ccd12f Various UI fixes and tweaks
* viewcvs.py:
  - make "search" param a sticky variable; it should propagate through
    the screens, across column sort changes, etc
  - htmlify() the search expression
  - add a new variable to specify whether a search form is needed on
    the directory page (to select a tag and/or a regex)
  - add [files_shown] since [num_files] isn't "right"; need longer
    term fix for variable w.r.t message when zero files are selected
  - always create form parameters because we may have a search form
    (and now use them in the search form)
  - use new ezt.boolean() where appropriate

* directory.ezt, dir_alternate.ezt:
  - display the current location and selection criteria in one block
  - move selection form to bottom of screen; this emphasizes the
    directory contents rather than how to select/refine the contents
  - tweak the "no_match" message since the search expression could be
    causing the zero-matches
  - use a table to format the various forms of selection criteria
  - use the params for *both* tag selection and regex selection
  - optionally display the "show all files" button, based on whether
    there is current selection criteria or not


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@412 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-22 04:54:38 +00:00
gstein
b476f4a882 add a new utility function for creating a "boolean" value
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@411 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-22 04:43:41 +00:00
gstein
eacb04ee26 Whoops! Get the right template for the "markup" page.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@410 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-22 04:15:50 +00:00
gstein
2910bc4a22 If more than one argument is given to the implied PRINT, then treat it
as a formatting command. Prepare the arguments and pass them to the
new _cmd_format function.

_cmd_format splits up the format/value and then delivers it to the
output file with any potential substitutions.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@409 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-22 02:29:42 +00:00
gstein
ae049f281b Implement the alternate view: revnum in front, linking to log page;
fname in second column, linking to HEAD.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@408 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-21 12:22:12 +00:00
gstein
7e3baffea4 add dir_alternate.ezt
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@407 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-21 11:59:45 +00:00
gstein
c40b88fb8b Remove the flip_links toggle and add a radio button for dir_alternate.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@406 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-21 11:11:51 +00:00
gstein
c7fc7d8885 Oops. main_title is still used by the templates. We could probably
eliminate it, but keep it for now.

Found by: Peter Funk <pf@artcom-gmbh.de>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@405 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-21 10:59:46 +00:00
gstein
68336ffcdf Move the set of the name to *after* we strip the Attic/ from it. Prior
to this, when we displayed the attic contents, then would have Attic/
on the front of the name (erroneously).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@404 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-21 10:11:00 +00:00
gstein
70db664ec6 Clean up the mess in directory.ezt
* rather than using [headers] to determine the columns, just display
  them explicitly. use the new [have_logs] to determine whether the
  additional columns are needed.

* fix a bunch of problems in directory.ezt relating to unreadable
  files or errors while reading CVS information (lining up columns and
  whatnot)

* remove the "show_author" config option, favoring removal from the
  templates instead.

* remove the unused "hide_non_readable" option. remove the
  "use_java_script" and "open_extern_window" options; these were
  removed recently, but accidentally left in the .conf file.

* remove the "flip_links_in_dirview" option, favoring a new template
  instead. added a copy of directory.ezt as dir_alternate.ezt. changes
  to actually make the columns flipped are coming in a future commit.

* remove the [rev_in_front], [rows.span], and [rows.cols] options;
  these are now obsolete given the above changes

* add documentation to upgrading.html


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@403 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-21 04:50:33 +00:00
timcera
e88fcaebce Added lib/accept.py
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@402 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-21 04:46:11 +00:00
pefu
e2c82d9341 Bugfix: Exception handling: html_footer(None) passes a None-request
to generate_page()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@401 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-20 10:19:36 +00:00
gstein
3844161f7d add a little commented-out print statement for debugging
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@400 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-20 00:25:45 +00:00
gstein
9da5df779a Add capability for a couple forms of internationalization.
* define a new "languages" config item for the available languages

* use the accept.py module to select the appropriate language based on
  the Accept-Language header and the languages config.

* add a new key/value files concept. load them after determining the
  language to use.

* support %lang% specification in the template files. This required
  passing the "request" variable to generate_page() and to
  html_footer()

* pass the 'kv' name into all templates


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@399 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-20 00:18:12 +00:00
gstein
f9d697db0c Add some code to parse and process the Accept-Language header. We'll
be using this to dynamically select what language to use for page
generation.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@398 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-19 05:09:21 +00:00
timcera
8432cb1c1d An [end] directive was missing, ViewCVS was throwing the new unclosed block
error.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@397 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-18 06:11:13 +00:00
timcera
c8718c00cd Added new template files.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@396 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-18 06:07:47 +00:00
gstein
d71c208540 Big update! Convert the rest of the pages to use templates.
* annotation, human readable diff, CvsGraph, and a marked-up file all
  use a template to generate the basic parts of the page. In many
  cases (annotate, graph, markup), the content is still rendered
  by other code.

* for the diff support, we take advantage of the new list iteration
  support in EZT to "iterate on" a DiffSource object, which parses a
  diff stream into structured object for the template to display.

* for the CvsGraph page, we make use of EZT's new stream support to
  stream in an imagemap from the CvsGraph executable. the graph page
  includes a navigation header now.

* updated the upgrading.html page with some items missing from the 0.7
  instructions, plus new instructions.

* because of the complete conversion, the configuration file no longer
  specifies colors or images -- these are all in the templates now.
  Removed the relevant material from config.py and viewcvs.conf.dist.

* converted html_footer() to use the new footer.ezt template because
  we still have to call that manually in the markup and annotate
  cases.

* add the templates to viewcvs.conf.dist and config.py

* added a handy generate_page() utility for generating pages from a
  template and its input data.

* removed download_link, html_icon, html_option, print_diff_select,
  and navigate_header utility functions. These all printed HTML to the
  output, but are obsolete due to the new templates.

* the new nav_header_data() utility function fills in data used by the
  "header.ezt" template, which replaces the navigate_header() func.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@395 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-18 00:22:14 +00:00
gstein
830c6ba76c Move the footer to its own template, and include it from the others.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@394 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-18 00:09:00 +00:00
gstein
e9a4e3bbe2 Minor fix to the diff-selection popup. It tested for "c" when it
should have been "s". (the resulting bug is that a side-by-side diff
would never appear pre-selected in the popup)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@393 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-18 00:06:53 +00:00
gstein
62f37986d5 Some more refinements:
* [include] now uses the current template's directory as a base for
  including other templates. Thus, you can [include "header.ezt"] to
  refer to a header.ezt template in the same directory.

* _cmd_print() now looks for a "read" attribute on the value, to
  determine whether it is a stream (rather than a simple string). It
  can now copy a stream to the output.

* added a simple catch for unclosed blocks. It doesn't say *what* is
  unclosed, but it will at least give you an error about it, rather
  than quiet failure.

* [for] loops now iterate until the end of a list (determined
  internally by the interpreter when an IndexError occurs), rather
  than using len(list). This allows for lists of an indeterminate
  length to be used.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@392 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-18 00:03:53 +00:00
timcera
a2b579b5ac Allow the installer to view differences between old and new configuration files.
* Use lib/ndiff.py to do the differencing.
* Passes by configuration files that have no differences between new and old.
* Create menu loop to choose between overwrite, do not overwrite and view
  differences.

Future:
  Need to work on difference format, ndiff is unusual.  Need line numbers.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@391 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-16 01:58:00 +00:00
gstein
46d8987848 Changes to directive argument parsing.
1) don't include the surrounded [ ] in the regex group, this avoids the need
   to slice them off (the [1:-1] stuff)
2) use a new regex to properly parse the args: loose double quotes, strict
   symbols.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@390 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-15 03:37:59 +00:00
gstein
73209134c9 minor change to reduce a bit of code: use copy_stream() where possible
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@389 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-15 03:36:36 +00:00
gstein
8e9831d6ec Enhance the directive parsing to allow anything between double quotes, and
to be restrictive on what a refname can contain.

Add some basic tests for the parsing regex.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@388 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-13 12:46:09 +00:00
pefu
83f6a7c7d5 Install new help pages also
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@387 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-12 20:43:58 +00:00
pefu
acbf138a6e Add Help buttons.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@386 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-12 20:42:31 +00:00
pefu
e872681988 More help pages and improved navigation between help pages.
help_logtable not yet finished (sorry, I will try to do this later).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@385 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-12 14:14:54 +00:00
pefu
27430791cb Added a new toggle to the Tkinter GUI allowing to play around with
Tim Ceras new 'use_re_search' configuration option.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@384 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-12 12:29:51 +00:00
gstein
e72b133665 Add warnings about the regex-based searching option.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@383 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-12 11:48:21 +00:00
gstein
3ea9aec854 Fixes for the regex searching.
* get_file_tests(): revert a portion: on error, append file, not full_name

* process_checkout(): take individual params rather than a request object.
    nit: removed a call to normpath()

* view_checkout(): pass the individual params to process_checkout()

* search_files():
  - call it "request" for consistency with other uses of the object
  - DON'T CHANGE ITS FIELDS. the request object is passed to the template,
    which needs values from it. we cannot go mucking with it. and who knows
    what the caller may want to do with it.
  - set up various local vars rather than munging request.*. note that we
    call mimetypes.guess_type() manually
  - rearrange ordering within loop to avoid expensive operations if we are
    just going to bail out: if we have a dir, or the file isn't a text file.
  - style nits: spaces after commas in function calls' args
  - if we terminate reading of a pipe, then close it (avoids a hang)
  - pass individual params to process_checkout()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@382 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-12 11:42:13 +00:00
gstein
a807605e31 Minor tweaks on the way to i18n.
* _prepare_ref() and _get_value() can now handle string constants
* change [is] processing to stop special-casing strings
* single quotes are not allowed, so simplify [include] parsing


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@381 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-12 09:50:37 +00:00
gstein
d3ed0a9cb5 add use_re_search default
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@380 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-12 09:47:27 +00:00
pefu
77f1d6f2e4 ViewCVS 0.8 is out and development for 0.9 started
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@379 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-11 11:52:59 +00:00
timcera
d59be9459d * Added regular expression search of all files in a directory.
+ created search_files function
  + split view_checkout into view_checkout and process_checkout.
    Wanted the process_checkout code to checkout the files from the
    repository.
  + split get_file_data into get_file_data and get_file_tests.
    Wanted get_file_tests to tell what kind of object was in the repository.
  + Modified directory.ezt to include searches.
    - Moved select by tag function up to the top of the page
    - Included code to return how many files survived the filters
    - The 'Reset' button now says 'Show all files'.
  + Modified viewcvs.conf.dist to include use_re_search option.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@378 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-11 05:19:22 +00:00
gstein
1a8c6ac15b grr... prevent double compression of the tarball
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@377 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-10 20:02:54 +00:00
gstein
4f5800cec5 ViewCVS 0.8 is out, so toss the warning.
All the options were removed, so stop repeating that fact.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@375 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-10 13:45:35 +00:00
gstein
e4cf54b49e More edits.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@374 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-10 13:44:02 +00:00
gstein
24070dcc6f * <a> cannot span <h2>, so move the anchors inside the <h2> tags
* colorization is "less important" than the other subjects, so shift
  it to the bottom of the page (no changes)
* reflow one paragraph (no changes)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@373 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-10 13:29:21 +00:00
gstein
afe213e140 Prep for the 0.8 release: shift around the feature listing, adjust the
links to refer to 0.8, add a link for the .zip file, add links for the
CHANGES file.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@372 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-10 13:23:34 +00:00
gstein
0dd6919af9 Describe the changes (at a higher level than a ChangeLog) that have
been introduced into ViewCVS 0.8.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@371 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-10 13:05:59 +00:00
gstein
1b4543ed92 Remove the even_odd option; it is no longer used.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@370 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-10 09:42:18 +00:00
pefu
26259d1fb1 Added a help page for the query database screen.
Added navigation between help pages.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@369 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-08 22:03:16 +00:00
pefu
6941197684 New wording that should work for either setting of flip_links_in_dirview.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@368 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-08 21:37:29 +00:00
timcera
02b0870390 * Removed requirement for trailing blanks on paths in viewcvs.conf.
In fact, can have them or not, doesn't matter.
* Changed logic dealing with collecting the revision number from the view_tag
  for rlog.  Identical 'rlog=...' statements were in both the if and else
  blocks.
* Added "'.for': 'fortran'" to list of extensions for enscript.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@367 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-07 14:43:42 +00:00
gstein
715f4dfa5a rolling 0.8
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@366 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-07 11:37:00 +00:00
gstein
5e5ee35046 Simplify generation of header using simple interpolation, rather than
depending upon locals()  (that function is generally Badness)

Removed the meta fields.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@365 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-07 11:22:25 +00:00
pefu
77355718c6 Fix SF Bug [#489470] loginfo-handler broken due to rlog interface change
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@364 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-05 19:00:27 +00:00
pefu
19ab90b4fb note modified to take new templates into acount
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@363 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-05 14:57:41 +00:00
pefu
7a3c8bf9c4 Fix title string in cvsgraph output: path was missing. module is unsed by ViewCVS
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@362 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-05 14:52:59 +00:00
pefu
d11dffb713 Table header should look left aligned and green similar
to the table headers in directory.ezt and query.ezt


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@361 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-27 22:13:30 +00:00
pefu
16281c1db5 A lot of small changes in one commit:
lib/viewcvs.py, templates/directory.ezt:
* Fix SF Bug [ #486085 ] checkout_magic_path uses invalid chars
  Provide backward compatibility for old style URLs.

standalone.py:
* Changed from calling viewcvs.main() to calling viewcvs.runcgi(),
  so that the timing results sampled by debug are displayed in the browser.

* Added two more toggles to the GUI.  Now it is simpler to perform a
  systematic test of several permutations of these config flags.

* Shortened the label text for the query entry field in the standalone GUI.

* Added some comments to this Tkinter GUI setup code, which has grown beyond
  than what I was my first intention.

lib/viewcvs.py, lib/config.py, cgi/viewcvs.conf.dist, standalone.py
and templates/directory.ezt:
* Added a new config flag variable called flip_links_in_dirview, which defaults
  to the classic setting (like cvsweb).  If it is set to 1 instead then the
  file and revision columns are exchanged and at the same time these two columns
  exchange the meaning of their links.  This design should solve the user
  interface design problem brought up first in
    http://www.lyra.org/pipermail/viewcvs-dev/2001-November/000285.html
  which was than than further discussed here:
    http://www.lyra.org/pipermail/viewcvs-dev/2001-November/000288.html
    http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/viewcvs/viewcvs/templates/Attic/direasy.ezt?hideattic=0
    http://www.lyra.org/pipermail/viewcvs/2001q4/000533.html
  Since than I received two personal emails from people sharing my POV.

  Unfortunately the huge [for rows]-block in directory.ezt has grown
  again.  But it is difficult to avoid this with the current design of
  lib/viewcvs.py and the templating engine lib/ezt.py.  I'm open to
  suggestions.

  In lib/viewcvs.py function view_directory I factored out the computation
  of row.span into a new local variable called span, since the number of
  empty trailing columns is decreased by one if the flip_links layout
  is configured.

templates/query.ezt:
* Rearranged the table columns in the commit database query result table,
  so that they match the existing table layouts of directory.ezt and
  log_table.ezt.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@360 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-27 21:56:06 +00:00
pefu
0da8dec361 * cutting a release should become even easier: Added tarball and .zip file
generation. (People using Windows often still prefer .zip over .tar.gz)
  fix permissions before generating the files.  Don't emit a an irritating
  warning, if someone tries this script to cut out viewcvs-0.7 again (even if
  solely done to test this script, before the v0_8 tag has been set ;-))


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@359 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-27 21:18:39 +00:00
pefu
1606e4e6dd Add entry field for query.ezt
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@358 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-19 22:52:02 +00:00
pefu
0393ef47f7 synchronize lib/config.py with viewcvs.conf.dist.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@357 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-19 21:25:01 +00:00
pefu
3d9eb3c638 all externals links in italic.
Added more subsections.  Especially a procedure about what I
think how Greg is going to cut a ViewCVS release.
suggestions and corrections welcome.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@356 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-19 21:13:43 +00:00
pefu
6a0c6f2029 Log messages should look like they were
formatted in the first place. (see viewcvs.print_log() last line for
example, how the log message is displayed elsewhere


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@355 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-19 14:36:18 +00:00
timcera
b564bd020a * Added apache_icons.py so that standalone.py works.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@354 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-19 13:55:18 +00:00
pefu
889f71f657 Even on the 1600x1200 pixel display of my new DELL Inspiron the table
generated by query.cgi was unacceptable wide.

After I widened the browser window so that it occuoies the whole
screen width, it still required a horizontal scrollbar.
I find this unusable.  So I decided to remove the
Description column and put the Log message blocks on a separate
table row.

But since this may be a matter of taste, I left the original
stuff in, but commented out.  People with really large
screens (2000 pixels and up) might want to revert this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@353 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-19 12:09:55 +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
pefu
eff0ddeabe Add the new debug module to the installer
installed viewcvs dies with an ImportError exception otherwise.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@351 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-19 10:22:28 +00:00
gstein
d69802487f Revamp bin2inline to create lines that are less than 80 characters wide.
Regenerate the icons.

Suggested by: Peter Funk <pf@artcom-gmbh.de>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@350 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-19 10:13:01 +00:00
gstein
0ff4aed795 Various changes:
* security: remove use of SimpleHTTPServer and just go with Base

* get the icons working -- send a 200 response line

* get redirects working by sending Location: header

* toss the PATH_TRANSLATED so we don't have to depend on .translate_path()

* use normal Python style for base invocation, rather than the self.base
  thing

* use SO_REUSEADDR if it is defined to avoid problems with stop/start of the
  server and rebinding to the socket


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@349 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-19 04:36:19 +00:00
gstein
a4aa00b5f1 Just store the icons as binary strings rather than worrying about base64.
Both are equally unintelligible, so we may as well simplify.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@348 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-19 04:20:04 +00:00
gstein
cef439958f Remove direasy.ezt.
directory.ezt incorporated its cvsgraph icon, so its only difference is
flipping the links around. But the existing definition for the links makes
more sense, so that leaves direasy.ezt without any new or interesting
features.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@347 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-19 03:11:21 +00:00
gstein
175d6f0ac4 Updates to the help stuff
* rename ~helppage~ magic path to ~docroot~ with the intent that we might
  serve other content out of there (including users' data if necessary)

* shift Help link down below the logo where it is more visible

* rename g_template_dir to its real semantic: g_install_dir

* rename view_helppage() to view_doc() and use new g_install_dir to find the
  doc root.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@346 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-19 02:59:13 +00:00
gstein
27df7480c5 Various tweaks:
* remove standalone comment from README; standard operation is to use a CGI
  script, so we don't want an incorrect emphasis; keep this discussion in
  INSTALL.

* clarify the GUI vs CGI operation description at the head of the file

* other updates/clarifications in INSTALL

* reformat a bit of text in the installer


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@345 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-19 01:10:08 +00:00
pefu
05bec0ce73 Advertise standalone.py ;-). And some cosmetic fixes
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@344 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-18 20:27:26 +00:00
pefu
d7c84f3149 Fix unit test to take the new white space compression into
account.  Using this opportunity to update another not related
part of the module doc string.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@343 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-18 20:03:19 +00:00
pefu
a0ece2036e Remove a superflous line of code and change the redirect response.
This should fix the first two of the five remarks made
by Greg Stein yesterday


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@342 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-18 14:04:41 +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
gstein
37166f065c Remove the <tt> tags. They actually didn't force fixed-width when
diff_font_face said otherwise. Further, fixed-width isn't necessarily
"correct" here. Most people (SourceForge, Debian, ASF, handhelds.org, at
least) all run with proportional fonts.

Admins can set diff_font_face to switch to fixed-width.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@340 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-18 11:52:59 +00:00
gstein
983a2c298e Minor tweaks:
- "view annotated" rather than "view annotation" (we don't want to imply
  there is some kind of annotation facility; we really need a better word
  for this; and no... 'blame' isn't it :-)

- use a rowspan on the revision column


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@339 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-18 11:45:54 +00:00
gstein
51988428f2 Fix up the diff links:
* put them back on a single line

* restore ordering -- "previous" is the most common, so it goes first

* add the action text into Diff links for larger hit targets
  (idea from Stephen Lamm <slamm@yahoo-inc.com>)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@338 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-18 11:30:27 +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
02db1bf262 Two nits: add some closing quotes to fix Emacs' font-lock; shift some code
outside of a try/except block (the try/except shouldn't apply).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@336 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-18 10:36:45 +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
5e497355a4 Fix up how the cvsdb handles loading the configuration.
* cvsdb.py: provide for running out of the CVS working dir. pass the config
  to GetRlogData().

* rlog.py: stop reading the config here (it's a library module). accept the
  config object as a param.

* viewcvs-install: turn off install-time substitution for several files


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@334 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-18 10:29:31 +00:00
gstein
45d1849883 Enable [if-index REF first]
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@333 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-18 10:22:36 +00:00
pefu
1e082e2982 Bugfix: stdout redirection problem, which occured with enscript
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@332 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-17 22:41:01 +00:00
pefu
55a94583fa I've rewritten the handling of icons in 'standalone.py': Currently only
very few icons from the set of icons distributed with Apache are really
used within the ViewCVS templates.  I've simply converted them into
a tiny new module, which is imported and used by standalone.py.  Now
standalone.py is really 'standalone' and can be run without Apache
alltogether.  The former options '-i' and '--apache_root=' of standalone.py
are now obsolete and I've removed them again.

The tool 'bin2inline_py.py' that I have used to convert the icon files
into a single sourcecode file is a cut-and-rape-oneway script from
something I've written a while ago to put icons into some other Tkinter
standalone program.  I case someone wants to add another icon, I've
placed this hacked version into the tools subdirectory and modified
'make-release', so that it will not be included into the final
ViewCVS 0.8 tarball.

For those who want to run standalone directly from the ViewCVS
source distribution, I've added a new option '-r' (or --repository=)
to standalone.py, so that it is now possible to patch the default
path '/home/cvsroot' without having to setup a Symlink in /home
pointing to their repository.  (Not everybody has the permissions
to do that on their server.)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@331 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-17 21:53:03 +00:00
pefu
cb41e82e6b This hopefully corrects a mistake I made. The alternative would have
been to change all references to LICENSE.html sprinkled
over all source files.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@330 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-17 13:09:58 +00:00
pefu
2b2f813262 Add comment about policy to keep external links in italic
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@329 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-17 12:27:01 +00:00
gstein
679153a77c Use a more sophisticated pipe so that we can get the output of the MySQL
command. In the success case, nothing is printed. But for the error case, we
get the information about the error.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@328 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-17 11:20:08 +00:00
gstein
674a2ee494 incorporate the graph icon from direasy (add size params). keep the links
the same. eliminate the border around the image.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@327 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-17 09:25:19 +00:00
gstein
8930cd8736 * use 1% for the width to keep the column as skinny as possible
* use &nbsp; for spaces in the links on the left side (compensating for the
  above change)
* Open Source has a space in it :-)
* offsite links are italicized


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@326 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-17 08:58:30 +00:00
pefu
bef73fd21a Improve error handling. Thanks to Tim Cera.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@325 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-16 14:52:06 +00:00
timcera
9fdfe05d24 * Corrected the colspan option for the 'Log' row.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@324 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-15 20:42:25 +00:00
timcera
70b05c8a5e * Added direasy.ezt to install.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@323 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-15 20:17:16 +00:00
pefu
2bc61a621d direasy.ezt is a simple variation based on directory.ezt.
Recently Stephen Lamm wrote:
> Have file links go to the latest revision instead of the cvs log.
> When I click on the file name, I expect to get that file, and not
> some meta information about it. Another column next the name could
> have a link like "(Log)" to get that information. That would be
> more explicit. I find it strange to click on the revision number
> to get a file because I typically do not think of files in terms
> of revision numbers. (The revision number probably should not have
> a link on it at all.)

In this template the revision number carries a link to the Log
page  (so the meaning of both columns are simply swapped).
Additionally (if you enable cvsgraph) the text string "(graph)" is replaced
by a small 16x16 pixel icon.

I experimented with the suggestion to add the word '(Log)' to each
filename but in the end I think that both (graph) and (log)
waste a lot of valueable horizontal screen space.

If you want to try this template out, you can simply start
	./standalone.py --gui
in the viewcvs directory and select the radio button labeled
with 'direasy.ezt'.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@322 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-15 18:12:22 +00:00
pefu
eae9e0131f Added the utc date (I missed that)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@321 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-15 18:00:56 +00:00
pefu
28ecb8c8f4 * Took out mentioning ViewCVS 0.5 (that was long ago).
* Added proper credit to Bill Fenner (see
	http://mailman.lyra.org/pipermail/viewcvs/2001q4/000521.html
  )
* Added some info about the upcoming Release 0.8.
* rearranged a lot of text and added section headings.
* Added links to each section to the navigation panel at the left side
  of the page.
* Added link to the download page of the mxDateTime extension, which is
  required by MySQLdb.
* Added links to the tracker @ SF for feature requests
  and bug reports where appropriate.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@320 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-15 15:01:44 +00:00
pefu
0642725543 Fixed packing alignment of check buttons.
And: Now it is easy to compare the outcome of different templates:
Just choose the template you want to use and click reload in
your browser window.

This is currently only implemented for the directory view and
the Log page template.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@319 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-15 10:52:33 +00:00
pefu
ad9a3d8c07 Close SF patch #481914:
The included patch enables the Delphi colorizer
for .pas and .dpr files. Most code should be delphi or
some form of Turbo Pascal equivilent syntax if it uses
the .pas. Currently ViewCVS has this mapped to the
ANSI standard 'pascal' colorizer. I checked with
Michael van Canneyt, the maintainer of both the Pascal
and Delphi colorizers in Enscript and he recommended
this change.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@318 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-15 08:23:43 +00:00
timcera
7232487cf0 * Combined the 'Branches' and 'Tags' columns.
* Probably fixed the problem of many tags in the table.
* Minor format changes.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@317 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-15 02:10:26 +00:00
timcera
2e9bbd9be6 * Ran through a spell checker and corrected mistakes.
* Rearranged 'Prerequisites' and 'Optional' sections.
* Maybe some other minor clean-ups.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@316 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-14 15:06:31 +00:00
pefu
34b639106b lib/viewcvs.py:
1. Fix the group membership and ViewCVS believes unreadable-Bug pointed
    out by H. Wade Minter <minter@lunenburg.org> on the ViewCVS mailing
    list yesterday.
 2. Load configuration only once, even if the function main (or run_cgi)
    is called more than once.  This is needed to allow tinkering with the
    configuration on the fly without the need to edit the viewcvs.conf file.
standalone.py:
 * Several coment typos fixed and added more docstrings.
 * Add two check buttons to the GUI to allow tinkering with the two
   configuration variables 'use_cvsgraph' and 'use_enscript' without
   having to edit a viewcvs.conf file.
 * Allow testing of the cvsgraph feature directly from a CVS working
   working copy (cvsgraph needs to find cgi/cvsgraph.conf.dist in this
   case).
 * Added a new option to specify a path to the Apache icons used all over
   the templates.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@315 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-14 15:02:11 +00:00
pefu
18667d725d Open a new browser window to display help pages.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@314 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-13 22:32:29 +00:00
pefu
d01364d0bd * Changed path used to serve help pages to take CWD='lib' into account
(required for the templates)
* Implemented two suggestions from Gregs reviewing mails:
  1: The fragment comes after the URL. The above pattern would be something
     like: "href=\"%m%F%7#rev%R\""
  2: request.qmark_query is what you're looking for here
  Thanks, Greg.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@313 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-13 21:12:05 +00:00
timcera
c80469ba5e * Moved log to seperate line.
* Changed link text.
* Added 'Diffs' column.
* Removed link from revision number.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@312 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-13 20:59:35 +00:00
pefu
c8f661e626 * Fixed the links on the help pages to point to the viewcvs website @ SF.
* Finally removed the duplicated text from directory.ezt and replaced it
  with a 'Help' button at the upper right corner.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@311 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-13 20:54:07 +00:00
pefu
2376c9a7ef A tiny standalone Webserver. Not yet completed but works somehow.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@310 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-13 19:28:51 +00:00
pefu
2be790dcb3 Greg voted against providing local copies of the ViewCVS docs in a
ViewCVS installation.  So back these out from the doc directory again.
Remaining work:  Change the links within the Help pages.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@309 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-13 19:01:01 +00:00
pefu
61c8b3d41f Hendrik Ruijter wrote:
> Note quite there yet.
>
> map_rev_href = "href=\"%m%F%7&rev=%R&content-type=text/vnd.viewcvs-markup\"";
>
> in cvsgraph.conf works. The content-type is *essential*.

I also added comments describing the difference between this and the
previous configuration setting and a comment to describe the new options
passed from ViewCVS to cvsgraph.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@308 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-13 17:08:23 +00:00
pefu
341525d3e4 Bugfix. Hendrik Ruijter wrote:
> When a repository root other than the default
> one is chosen, cvsgraph does not take the
> ?cvsroot=FOO into account. e.g.
>
> <area shape="rect" href="files.default#rev1.1"...
>
> The %c = cvsroot (with trailing '/') in cvsgraph.conf
> is the path, not what viewcvs.cgi wants. Thus,
> it seems that 'request.amp_query' or something similar
> has to be sent as a command-line argument to cvsgraph
> and weeded out as a %0..%9.
>
> e.g.
> map_rev_href
> = "href=\"%m%F#rev%R\"";
> should be
> map_rev_href
> = "href=\"%m%F#rev%R?cvsroot=%6\"";
> where %6 is 'Development' or something similar.

Not exactly but similar.  Please test.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@307 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-13 12:06:46 +00:00
pefu
808cf5265c Added comment advertising Tim Ceras alternative log_table.ezt template
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@306 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-09 22:44:12 +00:00
pefu
e824f93fb5 make contributing.html also available locally
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@305 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-09 22:10:44 +00:00
pefu
9dcdc1a660 make request object visible to the directory.ezt template
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@304 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-09 22:08:42 +00:00
timcera
9da51dbec2 Added log_table.ezt to the installation.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@303 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-09 18:42:34 +00:00
timcera
a0503097c0 * Developed a solution for the hanging 'Diff' issue. Rather simple solution
really, which means that I probably overlooked something, but it works.
* Rearranged the diff links.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@302 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-09 18:06:11 +00:00
timcera
1e5d9dd974 * Added &nbsp; to the 'Branch' and 'Tag' columns in order to have them
maintain the row color if there aren't any entries.
* Colapsed the 'Branch Path' column into 'Branch'
* Added <br> and &nbps; tags where appropriate to correctly format each entry.
* Diff to branch point works correctly.
* Many misc. changes.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@301 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-09 18:01:49 +00:00
timcera
9322e4e59e * As near as I could determine, the rev2tag.has_key(branch_point)
was never true.  The entry.branch_point was never set.  Now works as
  expected in the log template files.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@300 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-09 17:59:56 +00:00
pefu
657b50834d Ouppss: swapped the logic in my last commit. Fix that.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@299 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-08 22:30:32 +00:00
pefu
09c4ee378a A quick'n'dirty fix for the DST time problem pointed out by
Jon Burt <jonb@inktomi.com> on the viewcvs mailing list today.
Jon posted a patch which I slightly modified (see my reply to
his EMail in the mail archive).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@298 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-08 22:23:06 +00:00
pefu
af4ba05019 Started to "rape" one of Greg's latest pets: 'lib/ezt.py' ;-)
* Added much more "denglish" text to the module doc string!
  Attention: The docstring is probably not yet DOC-SIG (DPS) compatible.
  I lost track following the exciting work done there lately.
  Please correct any bad english grammar.  May be I will be able
  to improve my english from reviewing your diffs <wink>.

* Reworked the initial (one-and-only) test case so far to include
  at least one if block directive and fixed some typos.

* Added more doc strings to functions and methods.

* implemented an include directive.  My implementation might not be very
  elegant.  I wanted to optimize the case, where the include
  directive occurs within a for block, but the name of the include
  file is a string constant.  The include file is readed in only once then.

  To be able do this I wanted to recursivly call the parse_file method
  and append the returned 'program' to the 'program' assembled so far.
  To do this, I renamed 'parse' and 'parse_file' into '_parse' and
  '_parse_file' which return the program sequence instead of assigning
  to instance attribute directly.  To avoid a change in the interface,
  I added two new wrapper methods 'parse' and 'parse_file', which
  simply call these new private methods.

  The other case (include filename given as a value reference) is
  handled in a way similar to what was suggested by Greg: I added a
  _cmd_include() method which will invoke _parse() and _execute()
  each time again, if its execution is encountered.  This however
  will avoid (delay) reading the include file, if the directives
  happens to be in an if or else clause, which is not executed.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@297 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-08 18:55:53 +00:00
pefu
946e480778 Two minor changes in one commit:
1. make 'request' accessable to the template/directory.ezt
    (I want to use [request.script_name] for constructing a help page url)
 2. Fix tarball name generation, if someone requests to download a tarball
    of the whole repository.  Someone suggested the name 'cvs_root' somewhere
    and this guy also suggested to add a new config option to disable tarball
    generation in the root directory alltogether.  I thought about adding
    this config option but decided against it.  We should think of users
    as consenting adults and I wanted to keep configuration reasonable simple.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@296 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-08 17:29:11 +00:00
pefu
227fa91673 Change the default colors used for displaying colored diffs:
The new colors match the traffic light metapher:
1. red (stop) displays removed code no longer in use
2. yellow (attention) displays changed code
3. green (go) displays new added code.
Colors are always a matter of taste.
But I believe these colors make more sense and especially provide
more visual contrast than the previous colors copied from cvsweb.

I also modified some comments.

Please tell me, if you disagree.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@295 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-08 16:41:21 +00:00
pefu
c2d403b482 Informational stuff separated out into two help pages.
Might be removed from templates/directory.ezt.
Please have a look at my email to viewcvs-dev.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@294 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-08 08:12:56 +00:00
akr
248c7998c4 *** empty log message ***
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@293 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-08 03:01:14 +00:00
pefu
d867b9001f Fix non-matching table row tags in view diff.
The second of these patches was submitted by Christophe Jaillet (tititou)
as SF bug #478323, which should be closed now.  Greg?


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@292 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-05 19:36:02 +00:00
timcera
9639a02d25 * Added log_table.ezt as a draft table format for the log page. Need to add
logic for sorting similar to what is available on directory page. Need more
  testing to make sure format is scalable to complex repositories.
* Fixed small bug in log.ezt.  Stray 'Diff' string in the wrong place.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@291 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-11-03 04:17:17 +00:00
pefu
f5fa59bbd3 Improve setup debugging based on an idea of Tim Cera.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@290 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-31 09:15:42 +00:00
pefu
5367f945e7 swapped colors to increase contrast between first line of table and table header.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@289 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-29 07:53:01 +00:00
gstein
9a797cdd53 [ this was missed from a previous commit; checking it in... ]
The missing column is not dependent upon the show_subdir_lastmod flag -- we
don't need to propagate that into the template. If that branch of logic in
the template is reached, then we *know* that show_subdir_lastmod is enabled.
Just hard-code the column (for the revision).

Also a minor optimization: shifted the setting of row.graph_href rather than
setting it for every dir in file_data (note that we skip some of them).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@288 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-29 04:35:51 +00:00
gstein
2af952b542 The missing column is not dependent upon the show_subdir_lastmod flag -- we
don't need to propagate that into the template. If that branch of logic in
the template is reached, then we *know* that show_subdir_lastmod is enabled.
Just hard-code the column (for the revision).

Also a minor optimization: shifted the setting of row.graph_href rather than
setting it for every dir in file_data (note that we skip some of them).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@287 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-29 04:34:20 +00:00
pefu
86649f829b Improved error handling: if enscript stops due to wrong arguments
or some other reason, output the actual command before reraising the
Broken Pipe exeception.
I hope this change reduces the chance people will blame problems
with their enscript installation on ViewCVS.
For me this made it much easier to track down a small typo I commited
with revision 1.45 earlier this week:  To be consistent with the
'enscript'-patch, which I submitted to Markku Rossi <mtr@iki.fi> this
spring I replaced 'modula2' with 'modula_2'.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@286 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-28 11:08:28 +00:00
pefu
b2b26e4a65 removed some obviously resolved items and added a preface indicating,
that this file will go away and pointing to the SourceForge tracker URL.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@285 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-28 11:07:44 +00:00
pefu
ab0ac566fe Started to document this module. Docstring contains a runnable
example using Tim Peters 'doctest' module


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@284 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-27 14:42:43 +00:00
timcera
1c26250da7 Patch addresses 2 problems that occurred with certain combinations of the
use_cvsgraph and show_subdir_lastmod options:

* If use_cvsgraph and show_subdir_lastmod were both on, some subdirectory
  entries would get (graph) links.
* Under various combinations of settings, the directory entries would not
  line up in the proper columns.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@283 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-26 14:45:47 +00:00
pefu
c230a38f9d Added a warning about cvsgraph
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@282 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-25 21:53:28 +00:00
pefu
89a9e91a56 Allow testing help buttons from working copy
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@281 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-25 20:05:51 +00:00
pefu
773eb89f9b Updated according to my experiences to get the commit database up.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@280 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-25 20:02:22 +00:00
pefu
7ae3a23f5f New function to serve help pages from the ViewCVS install directory
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@279 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-25 19:52:34 +00:00
pefu
127d12fd9c Started testing, minor bugfix
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@278 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-25 17:34:07 +00:00
pefu
d206d1d80b Some new files were missing in the installer
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@277 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-25 16:17:06 +00:00
pefu
fa424931e7 Do not chop the documentation from the upcoming release 0.8
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@276 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-25 14:57:43 +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
gstein
45d2dec67b Make sure that the graph_href value is always defined. Otherwise, testing
for it could throw an UnknownReference.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@274 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-25 08:52:16 +00:00
gstein
f5c4bab1d0 Add the developers who have made significant contributions to ViewCVS. These
people should be recognized properly. This also implies joint copyright, but
who needs that with the flexibile license we have? :-)

I don't have URLs for home pages for these people, nor do I know if they
want them listed... so just names for now.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@273 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-25 08:49:48 +00:00
pefu
0b033dc738 Message from Hendrik Ruijter Oct 23, 2001 02:16:47 pm +0200:
I think the lib/config.py must define cvsdb.row_limit.
  Hacked around the viewcvs.html_header problem and got an error
  in lib/cvsdb.py until I added row_limit = 1000 in viewcvs.conf.
  Works now.

I've not tested this!  I'v no MySQL setup.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@272 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-25 07:26:40 +00:00
pefu
155679c36f A note about security
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@271 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-25 06:26:45 +00:00
pefu
aaa04ac917 Two icons (16x16 and 32x32 pixels), which may be used in directory.ezt
or elsewhere to represent the link to the cvsgraph page


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@270 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-25 06:16:50 +00:00
pefu
260d00b24b logo should look like a blimb and not like a bomb. :-(
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@269 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-25 06:11:50 +00:00
pefu
91f6f38ae4 * Removed the Graph column from directory display and changed the File
column to colspan=2, if cfg.options.use_cvsgraph is enabled.  This is
  a very minimal change not solving what Greg called
     """the stupid stuff about table headers in view_directory() and
        directory.ezt needs to be cleaned up. Specifically, the whole
	"show_author" crap should just be an aspect of the template, not the
	code."""
  Although I still believe, that the /icons/small/image2.gif would look
  better, I left the text "(graph)" as represenation of the link in there.
* Added a link to the cvsgraph display to the log.ezt template.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@268 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-24 23:26:09 +00:00
pefu
57850b9d84 * To be more consistent, I replaced all occurences of <install-root> in
INSTALL with <VIEWCVS_INSTALL_DIRECTORY>.  I needed to reformat several
  paragraphs in order to keep line length below the 80 column treshold.

* Added a small note about extending enscript syntax highlighting to
  exotic programming languages.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@267 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-24 12:56:10 +00:00
pefu
f3538a0136 sorted enscript suffices alphabetically and added Modula-2.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@266 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-24 10:17:48 +00:00
pefu
89282b3125 * ATTENTION: I changed the meaning of the cvsgraph_path config option variable!
This is more consistent with the already existing enscript_path config option.

* Added a new subsection about enscript configuration to the INSTALL file
  similar to the subsection about cvsgraph.

* Updated the notes about cvsgraph to match the new situation. (make install
  in the cvsgraph source directory places itself into /usr/local/bin).

* Added a note about linking cvsgraph on Solaris.

* The value of the config option variable cvsgraph_conf needs to be an
  absolute path.  viewcvs-install now sets this path automatically
  to the viewcvs install directory.

Idea: Should viewcvs-install try to find cvsgraph and enscript binaries
on $PATH and enable the use*-config options automatically?


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@265 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-24 09:44:59 +00:00
pefu
10d0f30cfa * Replaced the os.system() calls inherited from cvsgraphwrapper.cgi and
cvsgraphmkimg.cgi with popen.popen().  Suggested by Greg Stein.

* Removed the cvsgraphwrapper.cgi and cvsgraphmkimg.cgi scripts.  They
  are no longer needed.  Suggested by Greg Stein.

* Fixed the viewcvs-install accordingly.

* Added some basic HTML files to the installer, so that they are available
  for access from an installed viewcvs locally.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@264 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-23 11:58:05 +00:00
pefu
de7c322520 * Replaced the os.system() calls inherited from cvsgraphwrapper.cgi and
cvsgraphmkimg.cgi with popen.popen().  Suggested by Greg Stein.

* Removed the cvsgraphwrapper.cgi and cvsgraphmkimg.cgi scripts.  They
  are no longer needed.  Suggested by Greg Stein.

* Fixed the viewcvs-install accordingly.

* Added some basic HTML files to the installer, so that they are available
  for access from an installed viewcvs locally.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@263 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-23 11:26:49 +00:00
pefu
fdabbe7687 Moved cvsgraph interface into viewcvs.
This solved the apache ScriptAlias and URL problem.
The cgi/cvsgraph* scripts are no longer needed.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@262 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-23 00:18:15 +00:00
pefu
289e6514da * Added a README file. Currently this simply refers the reader to the
existing file INSTALL.
* Similar to the README file of the Python distribution I added a new
  section titled "TO THE IMPATIENT" at the top of the INSTALL file.
* Changed the section about upgrading to refer to the HTML file.
* Added a note about the optional prerequisite 'cvsgraph'.
* Modified the default behaviour of viewcvs-install, so that it will
  use a fresh installation directory for each major release of ViewCVS
  and changed the INSTALL file to point this behaviour out.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@261 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-22 21:17:59 +00:00
pefu
132f7e2342 Greg pointed out to me:
"""The point is that we don't want somebody to install ViewCVS and have the
   group ML be on there. Otherwise, we will get stupid questions about the
   *contents* of the CVS repository. You should see my inbox... I get all kinds
   of questions about software. And I'm all, "what the hell? never heard of
   that. oh... you're probably looking at the software via ViewCVS. well... go
   away... go find the real admin" :-)
""".  This change should fix that problem.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@260 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-22 20:30:05 +00:00
pefu
06b3adbbbf * Fixed comment
* Synchronize two options with viewcvs.conf.dist


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@259 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-22 07:00:59 +00:00
pefu
77a8a74a05 Improved error handling.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@258 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-22 06:41:15 +00:00
gstein
621adf6b35 Remove two options which have become obsolete: input_text_size and
allow_version_select.

Document their removal and where their new counterparts are.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@257 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-21 11:27:04 +00:00
gstein
d89a788783 Complete the rest of the log template.
CHANGE: the "Long colored diff" format option is now specified with "l"
  rather than "H". This may affect persistent URLs or existing .conf files.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@256 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-21 11:06:25 +00:00
gstein
2dade9e281 Clean out some obsolete code, now that we're using a template.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@255 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-21 08:31:20 +00:00
gstein
3d81935a92 Shift the log entry generation to the log.ezt template.
This change is focused around augment_entry(), which adds a bunch of
additional information into the entry object. Basically, augment_entry()
contains the logic from print_log() (leaving out the HTML generation).

print_log() also had a bug fix made to it (and these fixes are in the new
augment_entry). Essentially, the "next main" computation was wrong in two
ways: it applied int() to each component of c_rev, but that would make the
later comparison always fail (int != string); the second probably was that
c_work was created by splitting rev, but it should have split next. With
this fix, you can now diff against "next main".

Did a few cleanups/optimizations (rev_order use in print_log, dropping a
separate "filename" variable when computing file_url, use entry.changed
rather than rev_map).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@254 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-21 06:54:51 +00:00
gstein
9c1d4a954b Fix nested lists, do some small optimizations in _get_value(), and some code
cleanup.

It was possible to do [for one.two], but it was impossible to refer to
[one.two] or [one.two.field]. The _get_value() function was only checking
the first part of the dotted name for use in an iteration.

We now maintain a stack of iterations in progress (in scope, basically).
When we prepare a value reference, we pass that list and do an up-front
check for the use of an iteration variable. The preparation returns the
starting point of the value lookup, and the rest of the attribute names.

(before, we returned a (refname, split-ref) tuple, now we return (refname,
 start, rest-of-ref) tuple)

We also optimize _get_value() to use 'start' rather than ref[0] and 'rest'
rather than ref[1:] (i.e. skip an index and a slice).

The value-references in the code were changed to avoid tuple-unpacking and
just pass the whole reference to _get_value() (which does the unpacking as
part of its argument definition). This effectively hides most of the
internal format of a prepared value reference.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@253 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-21 03:26:28 +00:00
gstein
ff58af471c Create rev2tag and branch_points as lists rather than a string. In almost
all cases, we wanted the list. Semantically, this just makes more sense,
too: reduce to a string only when generating output.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@252 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-21 00:38:46 +00:00
gstein
9b25497fe9 Specify the template to use in the .conf file. This allows vhosts to select
different templates. (and simply provide flexibility to the user)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@251 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-20 23:54:21 +00:00
pefu
b01b1c3b1e With Greg's permission changed the EMail addresses, so that they
point to the ViewCVS mailing lists.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@250 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-20 23:43:06 +00:00
gstein
e3a16b2481 *) Remove the logo from the config file (and config.py).
*) Update the upgrading.html document to note the logo removal. Add
   commentary about 0.8 not being released. Tweak the [text] options.

*) viewcvs.py: toss html_header() (and its logo usage). Change the exception
   handling to simply generate the header text rather than use
   html_header().


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@249 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-20 23:24:59 +00:00
gstein
457fa117d4 Add colspan attributes so the main body of the page will extend to the right
hand side (providing more area to fill).

Some minor edits here and there.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@248 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-20 23:14:03 +00:00
gstein
9e55650c62 *) download_url() now adds request.amp_query to all URLs since all callers
did that anyways (except for one spot -- noted below)

*) In download_link(), open the window initially pointing at about:blank
   rather than an *incorrect* URL (it didn't have amp_query). Using
   about:blank will be faster anyways; and the TARGET stuff in the anchor
   will direct it to the proper URL.

*) Add templates/log.ezt for the file-log page

*) Change view_log() to begin using the new template. It is now used for the
   top portion of the file. (e.g. more work to do on the entries and bottom
   portion of the page)

*) ezt.py now allows '/' in the directives (typically, for quoted stuff)
   (this regex stuff really should be tweaked to allow just about anything
   in the quoted portions)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@247 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-20 22:51:56 +00:00
gstein
50e4520d0f Remove obsolete comments. Noted by Peter Funk.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@246 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-20 19:45:48 +00:00
gstein
1dbc6dcb57 Reversing an incorrect fix. The user is supposed to change the .ezt template
rather than use the .conf to affect the output pages.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@245 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-20 19:30:56 +00:00
pefu
c870cc4f23 A quick and little bit ugly, but working fix for SF Bug #473129.
'ezt.py', which belongs to the edna project is not changed.
May there is a cleaner solution possible, but I was unable to
figure out how.

The []-template macros available in directory.ezt should be documented
somewhere, but where?


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@244 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-20 15:57:33 +00:00
pefu
7a0fcf1e9e Added a reference to the project member page on SourceForge.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@243 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-20 12:55:20 +00:00
pefu
bf69d3d2aa Fix viewcvs-Bugs-472766. Sorry. I forgot to copy the file back into the working directory
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@242 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-19 14:05:40 +00:00
gstein
5526c78b4a fix bug #472585: bad revision links in the directory view.
The problem was that I "optimized" some link generation. The mime type for
viewing was moved from within the code to the template. However, that mime
typed keyed download_url() to construct the url a bit differently. And that
alternate link generation was flat out busted. (note that setting
allow_markup to zero in the .conf file would have create the same broken
links)

This change just constructs the URL manually since the net effect of
download_url() is a very simple URL. This is much clearer than the use of
the function (or the prior use of download_link())


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@241 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-19 08:26:03 +00:00
gstein
fe34dc73ad in a dev environment, we need a valid CONF_PATHNAME so that we can find the
templates. compute a real directory, and (temporarily) drop it into a global
for later usage.

eventually, we'll have a complete solution for referring to templates, based
on the configuration file.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@240 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-19 08:20:26 +00:00
gstein
c0859c9dd2 toss some obsolete options
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@239 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-19 07:02:16 +00:00
gstein
ce17dc8180 A minor cleanup of some interim code that was present (the array stuff was
old tech; the objects are new tech).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@238 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-19 04:18:42 +00:00
pefu
fcfada618a * Added a simple navigation aid between the pages. Missing an
important file (like upgrading.html) should be avoided this way.
  Placed a preliminary logo into the upper left corner of each page.
* Added a new file 'contributing.html' based on an EMail from Greg Stein.
* Used the same chalk.jpg background texture for all html files to
  have a more consistent look.
  Changed the absolute path into a relative path, so that viewing the html
  in a local copy (distributed in the tarball) will be easier.
* Moved a paragraph from ../INSTALL into upgrading.html


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@237 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-18 14:59:11 +00:00
pefu
fe17a6c8c6 Placeholder until someon comes up with a real neat logo
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@236 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-18 14:44:33 +00:00
pefu
a8ace27847 Now people upgrading their viewcvs will be warned about the
necessary changes in configuration file


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@235 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-17 07:46:52 +00:00
pefu
55052f1854 Improved error diagnostics. Allow empty module
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@234 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-16 16:41:19 +00:00
pefu
8bb281930b Added a new subsection about upgrading
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@233 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-16 15:52:23 +00:00
timcera
e31eb7859e Removed the ',v' from the title and alt name.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@232 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-16 14:59:49 +00:00
timcera
47b652e457 Needed to figure out the cgi-bin path in case it was in an unusual location.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@231 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-16 14:48:25 +00:00
timcera
44b8620adf Patch from Matthieu Bouthors, '[ #463588 ] (Download) / (View) Correction'
https://sourceforge.net/tracker/index.php?func=detail&aid=463588&group_id=18760&atid=318760
Basically, correctly labeling the links, and making sure the mime-type is correct.
Probably affects all binaries in the repository.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@230 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-16 12:34:04 +00:00
timcera
3db5f61f5e Shouldn't hard code path to cgi-bin.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@229 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-16 12:25:06 +00:00
timcera
ca3e52b05b This is the 'fix' for the problem that occurs when you have both use_cvsgraph
and show_subdir_lastmod.  Viewcvs was not putting data from directory entries
in the correct columns.  Need to decide as a group how to handle a directory
with only subdirectories because currently has blank 'Rev' and 'Graph' columns.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@228 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-16 12:24:08 +00:00
pefu
67fe0ffd7c Untabified.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@227 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-16 09:05:16 +00:00
pefu
58f2c57c33 If the viewcvs.conf file contains in invalid setting of 'default_root',
viewcvs issues a very poor error message.  I've tried to improve that by
adding a simple print statement.

Ted Hobson wrote to the viewcvs users mailing list:
> Hi, I'm hoping I could get a little help here. I've installed viewcvs
[...]
> viewcvs.cgi and was returned the following error messages.
>
>       Python Exception Occurred
>
> Traceback (innermost last):
[...]
> in __init__
>     self.cvsroot = cfg.general.cvs_roots[self.cvsrep]
> KeyError: Development
>
> The lines of code it points to don't really help me at all. Could
> somebody explain what these lines are doing and what may be wrong?


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@226 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-16 08:41:10 +00:00
timcera
0268b877e5 Added imagemap feature to CvsGraph. Now can click on the image to go to that
particular revision, tag, or diff.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@225 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-12 05:17:00 +00:00
timcera
620307a64c Added installation of the ezt.py library, directory.ezt, and cvsgraphmkimg.cgi.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@224 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-12 04:51:19 +00:00
gstein
e833b962b9 Don't try to process virtual hosts if the section is not present in the
configuration file.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@223 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-10-06 00:47:18 +00:00
gstein
f9953b7d87 Remove some obsolete options. Point users at their new location.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@222 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-09-25 10:47:48 +00:00
gstein
0d62e2c0c9 Convert the rest of view_directory() over to use the directory.ezt template.
Directory pages (including the top-level root/module selection page) can now
be completely customized, without code changes.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@221 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-09-25 09:24:11 +00:00
gstein
cf456c5cfb Add double-quote to the regex to allow (quoted) constants in the [is]
directive.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@220 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-09-25 09:15:14 +00:00
timcera
e9dee7ae87 Added use_cvsgraph to default configuration. Set to '0'.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@219 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-09-24 22:39:03 +00:00
gstein
ec99cb429b Shift more output generation from the code (viewcvs.py) into the template
(directory.ezt)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@218 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-09-24 12:02:01 +00:00
gstein
8093438d6b begin a document with information about upgrading.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@217 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-09-24 12:00:50 +00:00
gstein
a0135416b5 add a new directive: [is ref ref] or [is ref "value"]. like an "if"
statement, comparing the two values for equality. runs the first section if
they match, the else-section if they do not.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@216 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-09-24 11:56:21 +00:00
gstein
27bcce39a8 Fix the comment parsing: allow more than simply alphanums in the text. Now
it allows everything but the closing bracket.

Add some commentary for the regex since it is central to the operation of
the templating engine.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@215 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-09-24 10:59:33 +00:00
gstein
4e07d3a2ae remove some unused code (we know it wasn't called cuz "cvsrep" wasn't
defined anywhere)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@214 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-09-24 10:14:16 +00:00
gstein
b8582e57c7 Begin introduction of templates. For now, just the top portion of the
directory page is generated via template.

* viewcvs.conf.dist, config.py: remove [text] options and defaults; those
    values are now simply text within the template.

* viewcvs.py: load the template, define information to pass to it, and
    invoke it.

* directory.ezt: template for the directory page (and top-level root
    selection and module page).

* ezt.py: templating library from the "edna" project. no changes from the
    HEAD in edna's cvs.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@213 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-09-23 12:07:32 +00:00
gstein
5684cd97ad yet another idea
(these should migrate to the SF trackers...)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@212 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-09-22 23:13:25 +00:00
timcera
56695b3f26 Added CvsGraph support including documentation and installation.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@211 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-09-22 06:01:44 +00:00
timcera
352e8203cd Added <tt> </tt> to the side-by-side diffs. The <tt></tt> tags garantees a fixed width font.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@210 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-09-22 05:51:09 +00:00
timcera
350db5250c Added CvsGraph support including documentation and installation.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@209 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-09-22 05:38:32 +00:00
timcera
880690fc89 Minor format change. The '<p>' was ineffective at this point because
the browser doesn't expect HTML.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@208 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-09-22 01:39:06 +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
akr
d29fac8ba9 Fix typo. (overwright -> overwrite)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@206 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-06-18 03:12:03 +00:00
akr
6145ac2213 Fix get_logs to return two dictionaries even when there are only directories.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@205 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-06-18 03:05:05 +00:00
akr
32da3ae204 Don't put a title in menu for branch tags if there is no branch.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@204 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-06-04 10:20:14 +00:00
gstein
cbadda8611 this actually takes two arguments
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@203 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-06-03 18:43:19 +00:00
gstein
451da3e26d Get dbi.py to work with the latest MySQLdb and mxDateTime.
Submitted by: Gottfried.Ganssauge@HAUFE.DE


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@202 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-06-01 21:57:15 +00:00
akr
5130a7347f Read whole data from `co' to avoid SIGPIPE even if it is not used.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@201 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-31 04:37:09 +00:00
akr
2a83c75317 Don't check Attic which is not exist in tarball generation.
Reported by: Koichiro Ohba <koichiro@ctc-g.co.jp>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@200 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-31 02:48:42 +00:00
gstein
8d1daf1787 developing 0.8 now...
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@199 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-30 09:40:04 +00:00
gstein
6c6aee893f reflect release of 0.7
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@198 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-30 09:39:17 +00:00
gstein
02f2243cc7 *) updated for new CVS site
*) use cvs export and require a tag


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@196 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-30 09:19:18 +00:00
gstein
8766cf00ca rolling 0.7
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@195 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-30 09:15:03 +00:00
gstein
ba039d5a8f add a reference to Karl's book. delete a broken link.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@194 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-30 08:54:12 +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
c3d12bb0c8 add a persistent URL format for reaching the HEAD revision
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@192 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-30 08:37:17 +00:00
gstein
d0de5e7ad0 add the two new lib/ modules.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@191 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-30 08:18:28 +00:00
gstein
4a00a0bb4f add an item for the next release
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@190 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-30 08:16:38 +00:00
gstein
abb4a468fc The single/double find stuff was stupid. single would always be <= double.
Looking for a double is simply looking at the character following the '@'.
Removing the second find also solved some cache-thrashing that occurred with
big CHUNK_SIZE values. Plus a general speedup. :-)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@189 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-14 10:49:39 +00:00
gstein
cc3807f964 More speedups.
* avoid lstrip() -- it can take a while on large strings
* use loops instead of more complex ops. loops have a higher per-iteration
  cost, but a lower constant time. since N is small, it is a win.
* avoid "re" altogether; use string.digits in class Parser

(rcsparse is now over 10x faster since I started optimizing)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@188 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-14 08:44:33 +00:00
gstein
3bff6b7378 More performance tweaks.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@187 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-14 05:53:35 +00:00
gstein
fc6d80e2fb Speed up the get() method by being smarter about regular expression use,
avoiding slicing of strings, and more fine-tuned parsing.

(some debug stuff, too; this will disappear soon; just checkpointing now)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@186 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-13 02:52:26 +00:00
gstein
425ae2e8ec Speed up the log extraction by avoiding regular expressions (there are
simple equivalents which are faster).

Add a test function for profiling.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@185 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-13 02:50:24 +00:00
gstein
c2a29c83cd save a little test program for comparing rcsparse vs rlog output parsing
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@184 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-13 00:16:42 +00:00
gstein
799816c21f minor nit: fetch_log's last return value is a list, not a dict.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@183 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-13 00:13:12 +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
gstein
c28afba169 removed unneeded #! marker
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@181 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-12 12:33:17 +00:00
gstein
d790f07d2c Apply a patch from apache.org: watch out (and recover) for files which have
"illegal" timestamps in them.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@180 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-12 12:26:46 +00:00
gstein
edf252fb2f Now, make the appropriate changes to get the split CGI script/library to
actually work: move imports, wrap run_cgi() around the logic in viewcvs.py,
shift around the CONF_PATHNAME stuff, etc.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@179 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-12 12:22:51 +00:00
gstein
6942dd6b4b Slice a big chunk out of viewcvs.cgi and move it to viewcvs.py.
Absolutely no other changes. No additions, no reformat, no nothing...


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@178 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-12 12:05:08 +00:00
gstein
a75f32fc3c Older versions of Python do not like lists passed to mktime(). Ensure that
we pass a tuple.

Fixes bug #421282
Submitted by: mjpieters@users.sourceforge.net


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@177 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-12 11:42:08 +00:00
gstein
e243a0e1ad Record that we couldn't stat the file, or that it is unreadable. This allows
us to actually tell the user about it (and do so!).

Also removed a spurious try/except in generate_tarball; get_file_data()
shouldn't be raising one any more.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@176 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-12 11:34:17 +00:00
gstein
755e4e74c3 In directory views (and tarballs), don't include files or dirs that we
cannot read.

Reported by: Jaime E. Villate <villate@fe.up.pt>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@175 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-12 10:23:59 +00:00
gstein
a46b9dd3ba The (colored) links need to specify the diff_format=h option. Also correct a
spelling/typo and add missing right parents.

Submitted by: Chris Tillman <tillman@azstarnet.com>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@174 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-12 09:25:53 +00:00
gstein
ab987dc6fa *) some updates for the move to SourceForge.
*) add information about ViewCVS' increased security


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@173 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-11 21:21:50 +00:00
akr
a6ac1d1892 handle FreeBSD's rlog output which has extra "----------------------------\n".
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@172 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-11 07:24:15 +00:00
akr
945cb91e38 (link_includes): use sticky parameters for a link.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@171 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-10 09:12:45 +00:00
gstein
262f3569c7 way different nowadays, so make the header reflect current reality. update
commentary, and keep appropriate recognition of Curt's work.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@170 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-09 11:35:54 +00:00
gstein
1b358fc88d switch from a line-oriented processing to buffer-oriented. provides
approximately 3x performance increase.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@169 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-09 11:32:47 +00:00
gstein
455faa1fe6 switch to a TokenStream plus the parser. provides for better isolation of
the token parsing semantics.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@168 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-09 10:30:12 +00:00
gstein
01facd113b commit a checkpoint, with some tools, before doing some heavy lifting
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@167 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-09 09:23:00 +00:00
gstein
67daa9e5e2 Extract the RCS parsing code into a separate module. It now uses a "sink"
model, sending events/info to the blame script.

(this allows the RCS parser to be used in numerous contexts by simply
 switching the Sink that is used)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@166 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-08 19:34:58 +00:00
akr
03a5620947 (_re_rewrite_url): recognize fragment identifier.
http://sourceforge.net/tracker/?func=detail&atid=318760&aid=421284&group_id=18760


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@165 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-06 10:06:23 +00:00
akr
424521d40e (get_file_data): ignore files which causes failures on stat(2) such
as dangling symlinks.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@164 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-06 09:13:01 +00:00
akr
1eeb39f264 (html_time): Since very old timestamp (82 years, 6 months in this case)
causes overflow of plain integer, use long integer.

use `year' correctly for these old timestamps.

http://sourceforge.net/tracker/index.php?func=detail&aid=418428&group_id=1&atid=100001
http://sourceforge.net/tracker/index.php?func=detail&aid=421096&group_id=18760&atid=118760


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@163 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-05 19:52:42 +00:00
akr
7aa5c33589 (urlencode): Don't add redundant '?'.
http://sourceforge.net/tracker/?func=detail&atid=118760&aid=421281&group_id=18760


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@162 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-05 18:02:00 +00:00
gstein
60236803e4 This background will be needed when the website moves to SF.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@161 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-02 19:50:51 +00:00
gstein
a26cfff0ad fix viewcvs-browsing link on the page
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@160 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-02 19:27:36 +00:00
akr
f0c34a715d fixed at viewcvs.cgi:1.57.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@159 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-05-01 05:34:41 +00:00
akr
4cb1282b70 change option name for tarball generation from tarball' to allow_tar'.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@158 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-04-28 10:38:16 +00:00
akr
f34424ca20 make tarball generation configurable.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@157 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-04-28 08:50:28 +00:00
akr
bc6851ea6f separate branch and non-branch tags in tag menu.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@156 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-04-27 09:56:18 +00:00
akr
3b10a1763f tarball generation implemented.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@155 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-04-27 09:25:38 +00:00
akr
329d20633a use state instead of Attic/ to determine file existence if a tag is
specified.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@154 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-04-27 08:26:14 +00:00
akr
5251065e6d fix blame for empty deltatext especially 1.1 to 1.1.1.1.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@153 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-04-27 07:05:49 +00:00
akr
3d6f71ce00 couldn't handle multiple RCS-encoded string in single line.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@152 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-04-27 06:51:36 +00:00
akr
1a69430064 couldn't scan RCS-encoded string ends with @.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@151 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-04-27 06:44:20 +00:00
akr
050ad1f8fe add sticky info to blame link to fix problem with non-default repository.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@150 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-04-27 06:12:33 +00:00
akr
3965ce9221 ignore CVS directory in the repository which is used for fileattr.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@149 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-04-27 06:03:10 +00:00
akr
12003f27b5 branch selection fix. branchpoint entry may precede revisions on the
branch in rlog output.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@148 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-04-27 05:53:46 +00:00
gstein
b0b1b5603e Revamp the "co" output processing to give clearer errors. Be wary of
warnings that may be generated when doing the "co".


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@147 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-04-10 06:08:11 +00:00
gstein
2b8cc9d34c *) ignore a warning from rlog
*) fix the "hide_cvsroot" option flag processing


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@146 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-04-10 05:36:06 +00:00
gstein
4ddb89e053 add the 0.6 references
add (missing) refs to who.html and license-1.html


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@144 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-07-25 12:16:33 +00:00
gstein
c9e782c881 rolling
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@143 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-07-25 12:02:21 +00:00
gstein
7d8f036490 not sure that I like the clickable_path parameters, but this is the quickest
way right now to ensure we get the "/" handled properly.
[ will need future review ]


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@142 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-07-25 12:00:26 +00:00
gstein
02bad3fbe3 duh :-)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@141 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-07-25 11:59:22 +00:00
gstein
892364776e add trailing CR to the error message. use hasattr() rather than "in dir()"
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@139 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-07-02 00:44:05 +00:00
jpaint
8996332950 write error message to stderr instead of printing it so it will show
up in webserver logs


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@138 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-07-01 17:04:48 +00:00
jpaint
eb214de775 check MySQLdb for Timestamp() and friends; exit with a informitive error
of they don't exist.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@137 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-07-01 17:01:45 +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
gstein
ee7abc077a some minor tweaks from a while back
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@134 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-06-26 06:39:50 +00:00
gstein
087db42096 some stuff that had accumulated
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@133 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-06-26 06:39:06 +00:00
jpaint
028b54de90 modifications to accept the comma/command-seperated multiple query
strings


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@132 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-06-11 23:12:48 +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
jpaint
573293bbfc let people know Python 1.5.2 is a requirement for the SQL database part
of ViewCVS


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@130 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-06-01 23:04:48 +00:00
gstein
e6080c8366 execvp() can raise an exception, which means we never get to the sys.exit()
call. by wrapping it with try/except, we can ensure that get there.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@129 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-25 06:57:02 +00:00
gstein
346c91205b oops. parts[0] doesn't always exist.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@128 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-22 08:56:44 +00:00
gstein
3828e969de two changes:
1) try to fix a problem on FreeBSD where it seems the parent process is
     not waiting for the child (piped) processes to complete.
  2) handle the checkout_magic_path better -- it was showing up as the
     request.module and getting caught up in the 'forbidden' processing.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@127 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-22 08:48:07 +00:00
gstein
1a821bda9e add pipe_cmds() to set up a sequence of processes/pipes
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@126 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-22 08:46:04 +00:00
gstein
ddd782a950 The daylight flag should be zero since these values are in UTC. Problem
found by Chris Meyer <cmeyer@gatan.com>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@125 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-17 08:01:53 +00:00
gstein
f2dffceb6d fix bug found by Nick.T.Reinking@supervalu.com
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@124 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-17 06:56:11 +00:00
gstein
8810ab6c57 some fixes for Python 1.5(.1) compatibility. problems found by the help of
Bruce Langlois <bruce@acsp.com>


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@123 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-17 06:42:49 +00:00
gstein
b21597d96d bunch of stuff about 0.5
additional updates, discussion, etc


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@122 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-12 11:07:37 +00:00
gstein
c553401843 roll 0.5
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@121 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-12 10:34:01 +00:00
gstein
ee8a705131 add compilation of lib/ files (running as the web server probably will not
allow a write to lib/, so we do it ahead of time)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@120 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-12 10:26:11 +00:00
gstein
665d46a59d minor tweaks. additional info/notes/etc
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@119 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-12 10:20:56 +00:00
gstein
15d7883bb0 add 'use_enscript' option
change the default allow_annotate to true.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@118 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-12 10:18:17 +00:00
gstein
6ed78e918e fix the links that are generated
the "primordial" revision no longer links to the directory. the user can do
    that from the navbar at the top of the page (a bit more intuitive).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@117 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-12 07:24:13 +00:00
jpaint
5463d8ff1b Updated the docs for the modified installation paths (ie, cgi/ directory
went away).  Maybe we should provide a sample .htaccess file which
instructs the webserver to refuse access to the non-cgi scripts.

Keep in mind I'm a Roxen fan, the the .htaccess files don't have all the
features they have in Apache ;)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@116 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-12 03:23:33 +00:00
jpaint
934209abb9 have rlog.py use the rcs path set in the config file
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@115 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-12 03:19:09 +00:00
jpaint
a19338dd0a first draft of updated INSTALL instructions -- comments/spelling fixed
probably needed


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@114 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-12 02:57:11 +00:00
gstein
ee6c5f5da3 don't create a cgi/ directory.
update the shell-bang line at the top of the executable files with the
    correct python executable path.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@113 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-12 01:56:50 +00:00
jpaint
43d6d82b34 added popen.py to the installer
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@112 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-12 00:25:00 +00:00
jpaint
7ad684b001 let's not broadcast my passwords to the world...
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@111 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-12 00:24:10 +00:00
jpaint
25e4e5d18a Fixed up viewcvs-install script. It includes a few
files, excludes a few we don't use, and added a new field to the install
file list which will prompt before overwriting a file (viewcvs.conf, for
example).


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@110 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-11 23:55:07 +00:00
gstein
2719168ddc be more specific about what kind of markers we look for in a log output.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@109 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-11 22:34:46 +00:00
gstein
31272b7cea use dict.get() to simplify/speed some code.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@108 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-11 22:34:14 +00:00
jpaint
eb940183e3 script to create the MySQL database for the CVSdb part of ViewCVS
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@107 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-11 20:03:45 +00:00
gstein
33356d5a30 fix some previous-revision handling (generally failed on files with just a
single revision in them)
strip out the header/footer stuff from make_html()


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@106 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-11 11:15:54 +00:00
gstein
7ba05d4b43 revise some of the MIME type handling.
improve the header/footer for the annotated files


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@105 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-11 11:09:41 +00:00
gstein
083de4d0c7 initial testing/support for annotation using Curt's new module
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@104 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-11 01:13:23 +00:00
gstein
cbe1f36d8a remove unused code.
slight change to use math.log10()
fix problem with finding the end of a @-delimited token. It didn't work
    when the terminating @ was at the end of a line.
remove the CGI script stuff, but leave a direct-invocation for testing


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@103 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-11 01:12:33 +00:00
gstein
efa434d7fa use new popen.popen() for more security and to deal with filenames that
have quotes in them.
improve the check for "unified" format in diff output
detect and properly handle "\ No newline at end of file" during diff output


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@102 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-10 01:09:16 +00:00
gstein
7fc9018074 allow errors to be captured or tossed.
fix small bug with mode=='w' (use correct file for stdout/stderr)


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@101 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-10 00:58:44 +00:00
gstein
a7fe838521 better version of popen(), which allows us to not worry about quoting the
arguments to the target program.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@100 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-09 22:38:21 +00:00
gstein
a1e7108d76 small tweak to get this working right. 'token' had an empty string, so the
reference to token[-1] raised an error.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@99 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-09 11:48:49 +00:00
gstein
867883e525 untabify. indent changed, too.
despite the size of this diff, there were NO code changes. "cvs diff -b"
    to see that the change was whitespace only.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@98 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-09 11:21:30 +00:00
gstein
2f376b11e3 quicky script to build releases
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@97 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-09 11:00:50 +00:00
gstein
07763938a3 fix typo
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@96 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-09 10:30:29 +00:00
gstein
182aeaa7fa various simplification of the code. use re.sub() rather than line-by-line
replacements for the config variable stuff.
output a bit more information when unknown errors occur.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@95 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-09 10:29:13 +00:00
gstein
75d59eb292 add os.makedirs() compatibility
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@94 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-09 10:28:07 +00:00
gstein
18048c0a80 update the copyright and license information.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@93 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-09 08:36:29 +00:00
gstein
fb262791a1 first draft of the license and the "who" pages.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@92 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-09 02:27:16 +00:00
gstein
b2d9bf88a1 add virtual host capability: each set of vhosts can override the common
settings.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@91 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-09 02:00:56 +00:00
gstein
8e94cc5775 add more complex "forbidden" patterns (requested by Jon Stevens @ ASF)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@90 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-08 23:54:35 +00:00
gstein
e8c829df09 expand the use of enscript. provide for disabling specific languages in case
the local installation of enscript does not support them.
add a footer to the bottom of all "marked up" displays
pass the "guessed" MIME type to markup_stream() so that we can properly
    detect images and display them properly.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@89 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-08 04:57:31 +00:00
gstein
b892974ffe deal with a diff that reports no change
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@88 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-07 13:16:34 +00:00
gstein
78022b0e38 from Tanaka Akira <akr@m17n.org>: add elisp colorization via the "enscript"
program.
  Greg mods: configured with allow_elisp_coloring and enscript_path. read
  and write in chunks rather than slurping in the entire source file.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@87 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-05-07 12:54:02 +00:00
gstein
17c4db41dc initial checkin from Curt.
this currently operates as a CGI, but we will be integrating it as a part
    of viewcvs.cgi; therefore, it is going into lib/ to become a module.
this file is "pure" Curt except for the license in the header (changed per
    Curt's email to the viewcvs-dev list), and some comments about it
    being maintained as part of the ViewCVS project.
    [ change will progress from this snapshot ]


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@86 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-28 14:01:48 +00:00
jpaint
8070b6bba1 import string -- fix bug
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@85 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-27 17:48:05 +00:00
jpaint
c8ebba802e * CVSdb now uses viewcvs.conf
* added licence text for lib/compat.py lib/config.py
* viewcvs-install now installs + sets all the paths and modes for
	installed files


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@84 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-26 22:46:47 +00:00
jpaint
5b24650755 just a little bit more work
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@83 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-25 22:26:59 +00:00
jpaint
8b9a143376 fixed bug where we called the old exit function and it's no longer
there!


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@82 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-25 20:35:13 +00:00
jpaint
741a3daefe working on quick-n-dirty installer in Python which will allow us to get
a release out before too long; I need to make a list of to-do items
so this is easy to get working...


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@81 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-25 18:44:33 +00:00
jpaint
1cf42799f7 fix bug in rlog parser when it unexpectedly comes to the end of the
pipe


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@79 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-24 22:13:41 +00:00
jpaint
fb144dfa9d okay, found the date problem: glibc2.0.7's mktime has problems, so I
re-wrote the time calculation code to side-step those bugs


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@78 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-24 19:53:12 +00:00
jpaint
7963916b11 syntax error...
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@77 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-23 22:54:45 +00:00
jpaint
f79830925a work around more time bugs in MySQLdb
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@76 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-23 22:50:51 +00:00
jpaint
2217f50d1c oh, please let me get this one right
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@75 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-23 22:24:38 +00:00
jpaint
7cd158651d okay, all the MySQLdb dataobject tick-based time handling methods are
broken in various ways -- reconstruct GMT ticks from time module's
mktime...


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@74 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-23 22:09:43 +00:00
jpaint
b35c4f4e9f okay, now time handling is REALLY fixed!
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@73 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-23 20:30:49 +00:00
jpaint
1f5eb1b433 finally fixed up my time handling; now all classes store time in
seconds-from-epoc, GMT


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@72 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-23 18:29:10 +00:00
gstein
0eee32c64c initial checkin. yanked from viewcvs.cgi
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@71 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-23 09:51:45 +00:00
jpaint
61d80c751e *doh* let's not send my passwords out as the default; added the
"cvsdb.enabled" attribute to enable/disable cvsdb support in
viewcvs


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@70 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-23 01:33:14 +00:00
jpaint
db44b541e0 shaved off another 0.5 second on my test RCS file, which has 4800 commits
and now parses in about 7.5 seconds on my K7-500; it was parsing at about
12.0 seconds before profiling


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@69 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-22 19:59:36 +00:00
jpaint
3d2559276c speed improvments to rlog.py by using match.groups() instead of match.group
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@68 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-22 19:05:05 +00:00
gstein
0c963cf529 add CVSdb config entries (these went into config.py, too)
update the URLs that lead to the ViewCVS web site


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@67 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-22 09:27:00 +00:00
gstein
50b3d40958 shift the config code to ../lib/config.py
shift the 1.5.x compatibility code to ../lib/compat.py
update the URL pointing to the ViewCVS web site
revise handle_config() for new config mgmt.
add LIBRARY_DIR and CONF_PATHNAME with notes about install-time behavior.
use the above two values to find our library and config file.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@66 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-22 09:24:53 +00:00
gstein
7bb0ae1b29 initial checkin. yanked out of viewcvs.cgi.
moved defaults into a set_defaults() method.
update the URLs that point to the ViewCVS web site.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@65 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-22 09:22:35 +00:00
gstein
01b472e9fd add these modules -- we probably want to redistribute them.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@64 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-22 08:56:46 +00:00
jpaint
1f7ea22511 okay, I've fixed the file/attic/",v" problem; now RLogData's filename is
always set with the idealized path name for the RCS file: this means no
",v" and no "Attic" directory.  There needs to be a flag set in RLogData
to show it is an Attic file, but it's not there yet


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@63 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-21 22:20:26 +00:00
jpaint
3044ae7fba test for the ",v" before stripping until I get the rlog
logic figured out


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@62 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-21 16:06:49 +00:00
jpaint
fafa768bea don't have RLogData remove the ",v" from the end of the file, in fact, we
may want to manually add it so we have an exact file match


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@61 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-21 16:01:38 +00:00
jpaint
9bc63db2b4 really, really lame queryform.cgi script just to make things work for now
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@60 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-21 15:37:42 +00:00
jpaint
d87876bb54 bug fixes to make logentries for removed files work
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@59 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-21 15:33:22 +00:00
jpaint
cd7aa6b5da moved the RLogData->CommitList converter to cvsdbapi
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@58 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-21 06:32:20 +00:00
jpaint
024ccc6da3 cgi/granny.cgi: CVS annotate a file, and color code it to show how old lines are;
red is newer, blue is older; contributed by Brian Lenahan (brianl@real.com)

various updates to bootstrap the sys.path madness by keeping the root path in the
file /etc/viewcvs/root; this is open to debate, but works for now

html-templates/querytemplate.html: HTML template used by query.cgi, this will change and/or
	be removed in the future as we figure out a sane/cool way to generate the HTML


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@57 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-21 06:23:37 +00:00
jpaint
36684bde60 administration program for CVSdb
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@56 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-21 00:43:46 +00:00
jpaint
d08fb441d7 added loginfo handler for CVSdb updates
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@55 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-21 00:43:04 +00:00
jpaint
ebe4f1cbeb adding CVSdb cgi
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@54 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-21 00:40:54 +00:00
jpaint
0f8b06c9e0 CVSdb library files
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@53 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-21 00:37:20 +00:00
gstein
f707ad1d3c more items.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@52 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-19 22:29:33 +00:00
gstein
186b003a76 small patch to fix the popup windows
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@51 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-04-19 07:31:29 +00:00
gstein
621d08cb9f Zachary Bean <xach@mint.net> reported this.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@50 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-03-25 02:24:24 +00:00
gstein
8288be7f6f one more feature
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@49 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-03-24 12:12:23 +00:00
gstein
95e1ab3303 updates for the 0.4 release
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@48 8cb11bc2-c004-0410-86c3-e597b4017df7
2000-03-24 11:16:41 +00:00
172 changed files with 35954 additions and 2952 deletions

394
CHANGES Normal file
View File

@@ -0,0 +1,394 @@
Version 1.1.12 (released 03-Nov-2011)
* fix path display in patch and certain diff views (issue #485)
* fix broken cvsdb glob searching (issue 486)
* allow svn revision specifiers to have leading r's (issue #441, #448)
* allow environmental override of configuration location (issue #494)
* fix exception HTML-escaping non-string data under WSGI (issue #454)
* add links to root logs from roots view (issue #470)
* use Pygments lexer-guessing functionality (issue #495)
Version 1.1.11 (released 17-May-2011)
* security fix: remove user-reachable override of cvsdb row limit
* fix broken standalone.py -c and -d options handling
* add --help option to standalone.py
* fix stack trace when asked to checkout a directory (issue #478)
* improve memory usage and speed of revision log markup (issue #477)
* fix broken annotation view in CVS keyword-bearing files (issue #479)
* warn users when query results are incomplete (issue #433)
* avoid parsing errors on RCS newphrases in the admin section (issue #483)
* make rlog parsing code more robust in certain error cases (issue #444)
Version 1.1.10 (released 15-Mar-2011)
* fix stack trace in Subversion revision info logic (issue #475, issue #476)
Version 1.1.9 (released 18-Feb-2011)
* vcauth universal access determinations (issue #425)
* rework svn revision info cache for performance
* make revision log "extra pages" count configurable
* fix Subversion 1.4.x revision log compatibility code regression
* display sanitized error when authzfile is malformed
* handle file:/// Subversion rootpaths as local roots (issue #446)
* restore markup of URLs in file contents (issue #455)
* optionally display last-committed metadata in roots view (issue #457)
Version 1.1.8 (released 02-Dec-2010)
* fix slowness triggered by allow_compress=1 configuration (issue #467)
* allow use of 'fcrypt' for Windows standalone.py authn support (issue #471)
* yield more useful error on directory markup/annotate request (issue #472)
Version 1.1.7 (released 09-Sep-2010)
* display Subversion revision properties in the revision view (issue #453)
* fix exception in 'standalone.py -r REPOS' when run without a config file
* fix standalone.py server root deployments (--script-alias='')
* add Basic authentication support to standalone.py (Unix only) (issue #49)
* fix obscure "unexpected NULL parent pool" Subversion bindings error
* enable path info / link display in remote Subversion root revision view
* fix vhost name case handling inconsistency (issue #466)
* use svn:mime-type property charset param as encoding hint
* markup Subversion revision references in log messages (issue #313)
* add rudimentary support for FastCGI-based deployments (issue #464)
* fix query script WSGI deployment
* add configuration to fix query script cross-linking to ViewVC
Version 1.1.6 (released 02-Jun-2010)
* add rudimentary support for WSGI-based deployments (issue #397)
* fix exception caused by trying to HTML-escape non-string data (issue #454)
* fix incorrect RSS feed Content-Type header (issue #449)
* fix RSS <title> encoding problem (issue #451)
* allow 'svndbadmin purge' to work on missing repositories (issue #452)
Version 1.1.5 (released 29-Mar-2010)
* security fix: escape user-provided search_re input to avoid XSS attack
Version 1.1.4 (released 10-Mar-2010)
* security fix: escape user-provided query form input to avoid XSS attack
* fix standalone.py failure (when per-root options aren't used) (issue #445)
* fix annotate failure caused by ignored svn_config_dir (issue #447)
Version 1.1.3 (released 22-Dec-2009)
* security fix: add root listing support of per-root authz config
* security fix: query.py requires 'forbidden' authorizer (or none) in config
* fix URL-ification of truncated log messages (issue #3)
* fix regexp input validation (issue #426, #427, #440)
* add support for configurable tab-to-spaces conversion
* fix not-a-sequence error in diff view
* allow viewvc-install to work when templates-contrib is absent
* minor template improvements/corrections
* expose revision metadata in diff view (issue #431)
* markup file/directory item property URLs and email addresses (issue #434)
* make ViewVC cross copies in Subversion history by default
* fix bug that caused standalone.py failure under Python 1.5.2 (issue #442)
* fix support for per-vhost overrides of authorizer parameters (issue #411)
* fix root name identification in query.py interface
Version 1.1.2 (released 11-Aug-2009)
* security fix: validate the 'view' parameter to avoid XSS attack
* security fix: avoid printing illegal parameter names and values
* add optional support for character encoding detection (issue #400)
* fix username case handling in svnauthz module (issue #419)
* fix cvsdbadmin/svnadmin rebuild error on missing repos (issue #420)
* don't drop leading blank lines from colorized file contents (issue #422)
* add file.ezt template logic for optionally hiding binary file contents
Version 1.1.1 (released 03-Jun-2009)
* fix broken query form (missing required template variables) (issue #416)
* fix bug in cvsdb which caused rebuild operations to lose data (issue #417)
* fix cvsdb purge/rebuild repos lookup to error on missing repos
* fix misleading file contents view page title
Version 1.1.0 (released 13-May-2009)
* add support for full content diffs (issue #153)
* make many more data dictionary items available to all views
* various rcsparse and tparse module fixes
* add daemon mode to standalone.py (issue #235)
* rework helper application configuration options (issues #229, #62)
* teach standalone.py to recognize Subversion repositories via -r option
* now interpret relative paths in "viewvc.conf" as relative to that file
* add 'purge' subcommand to cvsdbadmin and svndbadmin (issue #271)
* fix orphaned data bug in cvsdbadmin/svndbadmin rebuild (issue #271)
* add support for query by log message (issues #22, #121)
* fix bug parsing 'svn blame' output with too-long author names (issue #221)
* fix default standalone.py port to be within private IANA range (issue #234)
* add unified configury of allowed views; checkout view disabled by default
* add support for ranges of revisions to svndbadmin (issue #224)
* make the query handling more forgiving of malformatted subdirs (issue #244)
* add support for per-root configuration overrides (issue #371)
* add support for optional email address mangling (issue #290)
* extensible path-based authorization subsystem (issue #268), supporting:
- Subversion authz files (new)
- regexp-based path hiding (for compat with 1.0.x)
- file glob top-level directory hiding (for compat with 1.0.x)
* allow default file view to be "markup" (issue #305)
* add support for displaying file/directory properties (issue #39)
* pagination improvements
* add gzip output encoding support for template-driven pages
* fix cache control bugs (issue #259)
* add RSS feed URL generation for file history
* add support for remote creation of ViewVC checkins database
* add integration with Pygments for syntax highlighting
* preserve executability of Subversion files in tarballs (issue #233)
* add ability to set Subversion runtime config dir (issue #351, issue #339)
* show RSS/query links only for roots found in commits database (issue #357)
* recognize Subversion svn:mime-type property values (issue #364)
* hide CVS files when viewing tags/branches on which they don't exist
* allow hiding of errorful entries from the directory view (issue #105)
* fix directory view sorting UI
* tolerate malformed Accept-Language headers (issue #396)
* allow MIME type mapping overrides in ViewVC configuration (issue #401)
* fix exception in rev-sorted remote Subversion directory views (issue #409)
* allow setting of page sizes for log and dir views individually (issue #402)
Version 1.0.9 (released 11-Aug-2009)
* security fix: validate the 'view' parameter to avoid XSS attack
* security fix: avoid printing illegal parameter names and values
Version 1.0.8 (released 05-May-2009)
* fix directory view sorting UI
* tolerate malformed Accept-Language headers (issue #396)
* fix directory log views in revision-less Subversion repositories
* fix exception in rev-sorted remote Subversion directory views (issue #409)
Version 1.0.7 (released 14-Oct-2008)
* fix regression in the 'as text' download view (issue #373)
Version 1.0.6 (released 16-Sep-2008)
* security fix: ignore arbitrary user-provided MIME types (issue #354)
* fix bug in regexp search filter when used with sticky tag (issue #346)
* fix bug in handling of certain 'co' output (issue #348)
* fix regexp search filter template bug
* fix annotate code syntax error
* fix mod_python import cycle (issue #369)
Version 1.0.5 (released 28-Feb-2008)
* security fix: omit commits of all-forbidden files from query results
* security fix: disallow direct URL navigation to hidden CVSROOT folder
* security fix: strip forbidden paths from revision view
* security fix: don't traverse log history thru forbidden locations
* security fix: honor forbiddenness via diff view path parameters
* new 'forbiddenre' regexp-based path authorization feature
* fix root name conflict resolution inconsistencies (issue #287)
* fix an oversight in the CVS 1.12.9 loginfo-handler support
* fix RSS feed content type to be more specific (issue #306)
* fix entity escaping problems in RSS feed data (issue #238)
* fix bug in tarball generation for remote Subversion repositories
* fix query interface file-count-limiting logic
* fix query results plus/minus count to ignore forbidden files
* fix blame error caused by 'svn' unable to create runtime config dir
Version 1.0.4 (released 10-Apr-2007)
* fix some markup bugs in query views (issue #266)
* fix loginfo-handler's support for CVS 1.12.9 (issues #151, #257)
* make viewvc-install able to run from an arbitrary location
* update viewvc-install's output for readability
* fix bug writing commits to non-MyISAM databases (issue #262)
* allow long paths in generated tarballs (issue #12)
* fix bug interpreting EZT substitute patterns
* fix broken markup view disablement
* fix broken directory view link generation in directory log view
* fix Windows-specific viewvc-install bugs
* fix broke query result links for Subversion deleted items (issue #296)
* fix some output XHTML validation buglets
* fix database query cache staleness problems (issue #180)
Version 1.0.3 (released 13-Oct-2006)
* fix bug in path shown for Subversion deleted-under-copy items (issue #265)
* security fix: declare charset for views to avoid IE UTF7 XSS attack
Version 1.0.2 (released 29-Sep-2006)
* minor documentation fixes
* fix Subversion annotate functionality on Windows (issue #18)
* fix annotate assertions on uncanonicalized #include paths (issue #208)
* make RSS URL method match the method used to generate it (issue #245)
* fix Subversion annotation to run non-interactively, preventing hangs
* fix bug in custom syntax highlighter fallback logic
* fix bug in PHP CGI hack to avoid force-cgi-redirect errors
Version 1.0.1 (released 20-Jul-2006)
* fix exception on log page when use_pagesize is enabled
* fix an XHTML validation bug in the footer template (issue #239)
* fix handling of single-component CVS revision numbers (issue #237)
* fix bug in download-as-text URL link generation (issue #241)
* fix query.cgi bug, missing 'rss_href' template data item (issue #249)
* no longer omit empty Subversion directories from tarballs (issue #250)
* use actual modification time for Subversion directories in tarballs
Version 1.0 (released 01-May-2006)
* add support for viewing Subversion repositories
* add support for running on MS Windows
* generate strict XHTML output
* add support for caching by sending "Last-Modified", "Expires",
"ETag", and "Cache-Control" headers
* add support for Mod_Python on Apache 2.x and ASP on IIS
* Several changes to standalone.py:
- -h commandline option to specify hostname for non local use.
- -r commandline option may be repeated to use more than repository
before actually installing ViewCVS.
- New GUI field to test paging.
* add new, better-integrated query interface
* add integrated RSS feeds
* add new "root_as_url_component" option to embed root names as
path components in ViewCVS URLs for a more natural URL scheme
in ViewCVS configurations with multiple repositories.
* add new "use_localtime" option to display local times instead of UTC times
* add new "root_parents" option to make it possible to add and
remove repositories without modifying the ViewCVS configuration
* add new "template_dir" option to facilitate switching between sets of
templates
* add new "sort_group_dirs" option to disable grouping of
directories in directory listings
* add new "port" option to connect to a MySQL database on a nonstandard port
* make "default_root" option optional. When no root is specified,
show a page listing all available repositories
* add "default_file_view" option to make it possible for relative
links and image paths in checked out HTML files to work without
the need for special /*checkout*/ prefixes in URLs. Deprecate
"checkout_magic" option and disable by default
* add "limit_changes" option to limit number of changed files shown per
commit by default in query results and in the Subversion revision view
* hide CVS "Attic" directories and add simple toggle for showing
dead files in directory listings
* show Unified, Context and Side-by-side diffs in HTML instead of
in bare text pages
* make View/Download links work the same for all file types
* add links to tip of selected branch on log page
* allow use of "Highlight" program for colorizing
* enable enscript colorizing for more file types
* add sorting arrows for directory views
* get rid of popup windows for checkout links
* obfuscate email addresses in html output by encoding @ symbol
with an HTML character reference
* add paging capability
* Improvements to templates
- add new template authoring guide
- increase coverage, use templates to produce HTML for diff pages,
markup pages, annotate pages, and error pages
- move more common page elements into includes
- add new template variables providing ViewCVS URLs for more
links between related pages and less URL generation inside
templates
* add new [define] EZT directive for assigning variables within templates
* add command line argument parsing to install script to allow
non-interactive installs
* add stricter parameter validation to lower likelihood of cross-site
scripting vulnerabilities
* add support for cvsweb's "mime_type=text/x-cvsweb-markup" URLs
* fix incompatibility with enscript 1.6.3
* fix bug in parsing FreeBSD rlog output
* work around rlog assumption all two digit years in RCS files are
relative to the year 1900.
* change loginfo-handler to cope with spaces in filenames and
support a simpler command line invocation from CVS
* make cvsdbadmin work properly when invoked on CVS subdirectory
paths instead of top-level CVS root paths
* show diff error when comparing two binary files
* make regular expression search skip binary files
* make regular expression search skip nonversioned files in CVS
directories instead of choking on them
* fix tarball generator so it doesn't include forbidden modules
* output "404 Not Found" errors instead of "403 Forbidden" errors
to not reveal whether forbidden paths exist
* fix sorting bug in directory view
* reset log and directory page numbers when leaving those pages
* reset sort direction in directory listing when clicking new columns
* fix "Accept-Language" handling for Netscape 4.x browsers
* fix file descriptor leak in standalone server
* clean up zombie processes from running enscript
* fix mysql "Too many connections" error in cvsdbadmin
* get rid of mxDateTime dependency for query database
* store query database times in UTC instead of local time
* fix daylight saving time bugs in various parts of the code
Version 0.9.4 (released 17-Aug-2005)
* security fix: omit forbidden/hidden modules from query results.
Version 0.9.3 (released 17-May-2005)
* security fix: disallow bad "content-type" input [CAN-2004-1062]
* security fix: disallow bad "sortby" and "cvsroot" input [CAN-2002-0771]
* security fix: omit forbidden/hidden modules from tarballs [CAN-2004-0915]
Version 0.9.2 (released 15-Jan-2002)
* fix redirects to Attic for diffs
* fix diffs that have no changes (causing an infinite loop)
Version 0.9.1 (released 26-Dec-2001)
* fix a problem with some syntax in ndiff.py which isn't compatible
with Python 1.5.2 (causing problems at install time)
* remove a debug statement left in the code which continues to
append lines to /tmp/log
Version 0.9 (released 23-Dec-2001)
* create templates for the rest of the pages: markup pages, graphs,
annotation, and diff.
* add multiple language support and dynamic selection based on the
Accept-Language request header
* add support for key/value files to provide a way for user-defined
variables within templates
* add optional regex searching for file contents
* add new templates for the navigation header and the footer
* EZT changes:
- add formatting into print directives
- add parameters to [include] directives
- relax what can go in double quotes
- [include] directives are now relative to the current template
- throw an exception for unclosed blocks
* changes to standalone.py: add flag for regex search
* add more help pages
* change installer to optionally show diffs
* fix to log.ezt and log_table.ezt to select "Side by Side" properly
* create dir_alternate.ezt for the flipped rev/name links
* various UI tweaks for the directory pages
Version 0.8 (released 10-Dec-2001)
* add EZT templating mechanism for generating output pages
* big update of cvs commit database
- updated MySQL support
- new CGI
- better database caching
- switch from old templates to new EZT templates (and integration
of look-and-feel)
* optional usage of CVSGraph is now builtin
* standalone server (for testing) is now provided
* shifted some options from viewcvs.conf to the templates
* the help at the top of the pages has been shifted to separate help
pages, so experienced users don't have to keep seeing it
* paths in viewcvs.conf don't require trailing slashes any more
* tweak the colorizing for Pascal and Fortran files
* fix file readability problem where the user had access via the
group, but the process' group did not match that group
* some Daylight Savings Time fixes in the CVS commit database
* fix tarball generation (the file name) for the root dir
* changed default human-readable-diff colors to "stoplight" metaphor
* web site and doc revamps
* fix the mime types on the download, view, etc links
* improved error response when the cvs root is missing
* don't try to process vhosts if the config section is not present
* various bug fixes and UI tweaks

28
COMMITTERS Normal file
View File

@@ -0,0 +1,28 @@
The following people have commit access to the ViewVC sources.
Note that this is not a full list of ViewVC's authors, however --
for that, you'd need to look over the log messages to see all the
patch contributors.
If you have a question or comment, it's probably best to mail
dev@viewvc.tigris.org, rather than mailing any of these people
directly.
gstein Greg Stein <gstein@lyra.org>
jpaint Jay Painter <???>
akr Tanaka Akira <???>
timcera Tim Cera <???>
pefu Peter Funk <???>
lbruand Lucas Bruand <???>
cmpilato C. Michael Pilato <cmpilato@collab.net>
rey4 Russell Yanofsky <rey4@columbia.edu>
mharig Mark Harig <???>
northeye Takuo Kitame <???>
jamesh James Henstridge <???>
maxb Max Bowsher <maxb1@ukf.net>
eh Erik Hülsmann <e.huelsmann@gmx.net>
mhagger Michael Haggerty <mhagger@alum.mit.edu>
## Local Variables:
## coding:utf-8
## End:
## vim:encoding=utf8

640
INSTALL
View File

@@ -1,88 +1,600 @@
INSTALLING VIEWCVS
CONTENTS
--------
TO THE IMPATIENT
SECURITY INFORMATION
INSTALLING VIEWVC
APACHE CONFIGURATION
UPGRADING VIEWVC
SQL CHECKIN DATABASE
ENABLING SYNTAX COLORATION
CVSGRAPH CONFIGURATION
IF YOU HAVE PROBLEMS...
TO THE IMPATIENT
----------------
Congratulations on getting this far. :-)
Required Software And Configuration Needed To Run ViewVC:
For CVS Support:
* Python 1.5.2 or later (sorry, no 3.x support yet)
(http://www.python.org/)
* RCS, Revision Control System
(http://www.cs.purdue.edu/homes/trinkle/RCS/)
* GNU-diff to replace diff implementations without the -u option
(http://www.gnu.org/software/diffutils/diffutils.html)
* read-only, physical access to a CVS repository
(See http://www.cvshome.org/ for more information)
For Subversion Support:
* Python 2.0 or later (sorry, no 3.x support yet)
(http://www.python.org/)
* Subversion, Version Control System, 1.3.1 or later
(binary installation and Python bindings)
(http://subversion.apache.org/)
Optional:
* a web server capable of running CGI programs
(for example, Apache at http://httpd.apache.org/)
* MySQL 3.22 and MySQLdb 0.9.0 or later to create a commit database
(http://www.mysql.com/)
(http://sourceforge.net/projects/mysql-python)
* Pygments 0.9 or later, syntax highlighting engine
(http://pygments.org)
* CvsGraph 1.5.0 or later, graphical CVS revision tree generator
(http://www.akhphd.au.dk/~bertho/cvsgraph/)
Quick sanity check:
If you just want to see what your repository looks like when seen
through ViewVC, type:
$ bin/standalone.py -r /PATH/TO/REPOSITORY
This will start a tiny ViewVC server at http://localhost:49152/viewvc/,
to which you can connect with your browser.
Standard operation:
To start installing right away (on UNIX): type "./viewvc-install"
in the current directory and answer the prompts. When it
finishes, edit the file viewvc.conf in the installation directory
to tell ViewVC the paths to your CVS and Subversion repositories.
Next, configure your web server (in the way appropriate to that browser)
to run <VIEWVC_INSTALLATION_DIRECTORY>/bin/cgi/viewvc.cgi. The section
`INSTALLING VIEWVC' below is still recommended reading.
SECURITY INFORMATION
--------------------
ViewVC provides a feature which allows version controlled content to
be served to web browsers just like static web server content. So, if
you have a directory full of interrelated HTML files that is housed in
your version control repository, ViewVC can serve those files as HTML.
You'll see in your web browser what you'd see if the files were part
of your website, with working references to stylesheets and images and
links to other pages.
It is important to realize, however, that as useful as that feature
is, there is some risk security-wise in its use. Essentially, anyone
with commit access to the CVS or Subversion repositories served by
ViewVC has the ability to affect site content. If a discontented or
ignorant user commits malicious HTML to a version controlled file
(perhaps just by way of documenting examples of such), that malicious
HTML is effectively published and live on your ViewVC instance.
Visitors viewing those versioned controlled documents get the
malicious code, too, which might not be what the original author
intended.
For this reason, ViewVC's "checkout" view is disabled by default. If
you wish to enable it, simply add "co" to the list of views enabled in
the allowed_views configuration option.
INSTALLING VIEWVC
------------------
1) To get viewcvs.cgi to work, make sure that you have Python 1.5
installed and a webserver which is capable of executing cgi-scripts
(either based on the .cgi extension, or by placing the script
within a specific directory).
NOTE: Windows users can refer to windows/README for Windows-specific
installation instructions.
You need to have RCS installed. Specifically, "rlog", "rcsdiff",
and "co". This script was tested against RedHat's rcs-5.7-10.rpm
1) To get viewvc.cgi to work, make sure that you have Python installed
and a webserver which is capable of executing CGI scripts (either
based on the .cgi extension, or by placing the script within a specific
directory).
Note, that the viewcvs.cgi-script needs to have READ-ONLY, physical
access to the repository (or a copy of it). Therefore, rsh/ssh or
pserver access doesn't work yet.
Note that to browse CVS repositories, the viewvc.cgi script needs to
have READ-ONLY, physical access to the repository (or a copy of it).
Therefore, rsh/ssh or pserver access to the repository will not work.
And you need to have the RCS utilities installed, specifically "rlog",
"rcsdiff", and "co".
2) Copy viewcvs.cgi to the cgi-script location of your web server.
2) Installation is handled by the ./viewvc-install script. Run this
script and you will be prompted for a installation root path.
The default is /usr/local/viewvc-VERSION, where VERSION is
the version of this ViewVC release. The installer sets the install
path in some of the files, and ViewVC cannot be moved to a
different path after the install.
If Python is not located in /usr/local/bin, then you'll need to
edit the first line of viewcvs.cgi.
Note: while 'root' is usually required to create /usr/local/viewvc,
ViewVC does not have to be installed as root, nor does it run as root.
It is just as valid to place ViewVC in a home directory, too.
3) Copy viewcvs.conf.dist to the same directory and RENAME it to
viewcvs.conf
Note: viewvc-install will create directories if needed. It will
prompt before overwriting files that may have been modified (such
as viewvc.conf), thus making it safe to install over the top of
a previous installation. It will always overwrite program files,
however.
4) Edit viewcvs.conf for your specific configuration. In particular,
examine the following configuration options:
3) Edit <VIEWVC_INSTALLATION_DIRECTORY>/viewvc.conf for your specific
configuration. In particular, examine the following configuration options:
cvs_roots
cvs_roots (for CVS)
svn_roots (for Subversion)
root_parents (for CVS or Subversion)
default_root
rcs_path
mime_types_file
root_as_url_component
rcs_dir
mime_types_files
There are some other options that are usually nice to change. See
viewcvs.conf for more information.
viewvc.conf for more information. ViewVC provides a working,
default look. However, if you want to customize the look of ViewVC
then edit the files in <VIEWVC_INSTALLATION_DIRECTORY>/templates.
You need knowledge about HTML to edit the templates.
5) That's it. Try it out.
4) The CGI programs are in <VIEWVC_INSTALLATION_DIRECTORY>/bin/cgi/. You can
symlink to this directory from somewhere in your published HTTP server
path if your webserver is configured to follow symbolic links. You can
also copy the installed <VIEWVC_INSTALLATION_DIRECTORY>/bin/cgi/*.cgi
scripts after the install (unlike the other files in ViewVC, the scripts
under bin/ can be moved).
Warning: ViewCVS has not been tested on web servers operating on the
Win32 platform.
If you are using Apache, then see below at the section titled
APACHE CONFIGURATION.
NOTE: for security reasons, it is not advisable to install ViewVC
directly into your published HTTP directory tree (due to the MySQL
passwords in viewvc.conf).
That's it for repository browsing. Instructions for getting the SQL
checkin database working are below.
APACHE CONFIGURATION
--------------------
1) Locate your Apache configuration file(s).
Typical locations are /etc/httpd/httpd.conf,
/etc/httpd/conf/httpd.conf, and /etc/apache/httpd.conf. Depending
on how Apache was installed, you may also look under /usr/local/etc
or /etc/local. Use the vendor documentation or the find utility if
in doubt.
2) Depending on how your Apache configuration is setup by default, you
might need to explicitly allow high-level access to the ViewVC
install location.
<Directory <VIEWVC_INSTALLATION_DIRECTORY>>
Order allow,deny
Allow from all
</Directory>
For example, if ViewVC is installed in /usr/local/viewvc-1.0 on
your system:
<Directory /usr/local/viewvc-1.0>
Order allow,deny
Allow from all
</Directory>
3) Configure Apache to expose ViewVC to users at the URL of your choice.
ViewVC provides several different ways to do this. Choose one of
the following methods:
-----------------------------------
METHOD A: CGI mode via ScriptAlias
-----------------------------------
The ScriptAlias directive is very useful for pointing
directly to the viewvc.cgi script. Simply insert a line containing
ScriptAlias /viewvc <VIEWVC_INSTALLATION_DIRECTORY>/bin/cgi/viewvc.cgi
into your httpd.conf file. Choose the location in httpd.conf where
also the other ScriptAlias lines reside. Some examples:
ScriptAlias /viewvc /usr/local/viewvc-1.0/bin/cgi/viewvc.cgi
ScriptAlias /query /usr/local/viewvc-1.0/bin/cgi/query.cgi
----------------------------------------
METHOD B: CGI mode in cgi-bin directory
----------------------------------------
Copy the CGI scripts from
<VIEWVC_INSTALLATION_DIRECTORY>/bin/cgi/*.cgi
to the /cgi-bin/ directory configured in your httpd.conf file.
You can override configuration file location using:
SetEnv VIEWVC_CONF_PATHNAME /etc/viewvc.conf
------------------------------------------
METHOD C: CGI mode in ExecCGI'd directory
------------------------------------------
Copy the CGI scripts from
<VIEWVC_INSTALLATION_DIRECTORY>/bin/cgi/*.cgi
to the directory of your choosing in the Document Root adding the following
Apache directives for the directory in httpd.conf or an .htaccess file:
Options +ExecCGI
AddHandler cgi-script .cgi
Note: For this to work mod_cgi has to be loaded. And for the .htaccess file
to be effective, "AllowOverride All" or "AllowOverride Options FileInfo"
needs to have been specified for the directory.
------------------------------------------
METHOD D: Using mod_python (if installed)
------------------------------------------
Copy the Python scripts and .htaccess file from
<VIEWVC_INSTALLATION_DIRECTORY>/bin/mod_python/
to a directory being served by Apache.
In httpd.conf, make sure that "AllowOverride All" or at least
"AllowOverride FileInfo Options" are enabled for the directory
you copied the files to.
You can override configuration file location using:
SetEnv VIEWVC_CONF_PATHNAME /etc/viewvc.conf
Note: If you are using Mod_Python under Apache 1.3 the tarball generation
feature may not work because it uses multithreading. This works fine
under Apache 2.
----------------------------------------
METHOD E: Using mod_wsgi (if installed)
----------------------------------------
Copy the Python scripts file from
<VIEWVC_INSTALLATION_DIRECTORY>/bin/mod_python/
to the directory of your choosing. Modify httpd.conf with the
following directives:
WSGIScriptAlias /viewvc <VIEWVC_INSTALLATION_DIRECTORY>/bin/wsgi/viewvc.wsgi
WSGIScriptAlias /query <VIEWVC_INSTALLATION_DIRECTORY>/bin/wsgi/query.wsgi
You'll probably also need the following directive because of the
not-quite-sanctioned way that ViewVC manipulates Python objects.
WSGIApplicationGroup %{GLOBAL}
Note: WSGI support in ViewVC is at this time quite rudimentary,
bordering on downright experimental. Your mileage may vary.
-----------------------------------------
METHOD F: Using mod_fcgid (if installed)
-----------------------------------------
This uses ViewVC's WSGI support (from above), but supports using FastCGI,
and is a somewhat hybrid approach of several of the above methods.
Especially if fcgi is already being used for other purposes, e.g. PHP,
also using fcgi can prevent the need for including additional modules
(e.g. mod_python or mod_wsgi) within Apache, which may help lessen Apache's
memory usage and/or help improve performance.
This depends on mod_fcgid:
http://httpd.apache.org/mod_fcgid/
as well as the fcgi server from Python's flup package:
http://pypi.python.org/pypi/flup
http://trac.saddi.com/flup
The following are some example httpd.conf fragments you can use to
support this configuration:
ScriptAlias /viewvc /usr/local/viewvc/bin/wsgi/viewvc.fcgi
ScriptAlias /query /usr/local/viewvc/bin/wsgi/query.fcgi
4) [Optional] Add access control.
In your httpd.conf you can control access to certain modules by
adding directives like this:
<Location "<url to viewvc.cgi>/<modname_you_wish_to_access_ctl>">
AllowOverride None
AuthUserFile /path/to/passwd/file
AuthName "Client Access"
AuthType Basic
require valid-user
</Location>
WARNING: If you enable the "checkout_magic" or "allow_tar" options, you
will need to add additional location directives to prevent people
from sneaking in with URLs like:
http://<server_name>/viewvc/*checkout*/<module_name>
http://<server_name>/viewvc/~checkout~/<module_name>
http://<server_name>/viewvc/<module_name>.tar.gz?view=tar
5) Restart Apache.
The commands to do this vary. "httpd -k restart" and "apache -k
restart" are two common variants. On RedHat Linux it is done using
the command "/sbin/service httpd restart" and on SuSE Linux it is
done with "rcapache restart". Other systems use "apachectl restart".
6) Optional: Protect your ViewVC instance from server-whacking webcrawlers.
As ViewVC is a web-based application which each page containing various
links to other pages and views, you can expect your server's performance
to suffer if a webcrawler finds your ViewVC instance and begins
traversing those links. We highly recommend that you add your ViewVC
location to a site-wide robots.txt file. Visit the Wikipedia page
for Robots.txt (http://en.wikipedia.org/wiki/Robots.txt) for more
information.
UPGRADING VIEWVC
-----------------
Please read the file upgrading-howto.html in the docs/ subdirectory.
SQL CHECKIN DATABASE
--------------------
This feature is a clone of the Mozilla Project's Bonsai database. It
catalogs every commit in the CVS or Subversion repository into a SQL
database. In fact, the databases are 100% compatible.
Various queries can be performed on the database. After installing ViewVC,
there are some additional steps required to get the database working.
1) You need MySQL and MySQLdb (a Python DBAPI 2.0 module) installed.
2) You need to create a MySQL user who has permission to create databases.
Optionally, you can create a second user with read-only access to the
database.
3) Run the <VIEWVC_INSTALLATION_DIRECTORY>/bin/make-database script. It will
prompt you for your MySQL user, password, and the name of database you
want to create. The database name defaults to "ViewVC". This script
creates the database and sets up the empty tables. If you run this on a
existing ViewVC database, you will lose all your data!
4) Edit your <VIEWVC_INSTALLATION_DIRECTORY>/viewvc.conf file.
There is a [cvsdb] section. You will need to set:
enabled = 1 # Whether to enable query support in viewvc.cgi
host = # MySQL database server host
port = # MySQL database server port (default is 3306)
database_name = # name of database you created with make-database
user = # read/write database user
passwd = # password for read/write database user
readonly_user = # read-only database user
readonly_passwd = # password for the read-only user
Note that it's pretty safe in this instance for your read-only user
and your read-write user to be the same.
5) At this point, you need to tell your version control system(s) to
publish their commit information to the database. This is done
using utilities that ViewVC provides.
To publish CVS commits into the database:
Two programs are provided for updating the checkin database from
a CVS repository, cvsdbadmin and loginfo-handler. They serve
two different purposes. The cvsdbadmin program walks through
your CVS repository and adds every commit in every file. This
is commonly used for initializing the database from a repository
which has been in use. The loginfo-handler script is executed
by the CVS server's CVSROOT/loginfo system upon each commit. It
makes real-time updates to the checkin database as commits are
made to the repository.
To build a database of all the commits in the CVS repository
/home/cvs, invoke: "./cvsdbadmin rebuild /home/cvs". If you
want to update the checkin database, invoke: "./cvsdbadmin
update /home/cvs". The update mode checks to see if a commit is
already in the database, and only adds it if it is absent.
To get real-time updates, you'll want to checkout the CVSROOT
module from your CVS repository and edit CVSROOT/loginfo. For
folks running CVS 1.12 or better, add this line:
ALL <VIEWVC_INSTALLATION_DIRECTORY>/bin/loginfo-handler %p %{sVv}
If you are running CVS 1.11 or earlier, you'll want a slightly
different command line in CVSROOT/loginfo:
ALL <VIEWVC_INSTALLATION_DIRECTORY>/bin/loginfo-handler %{sVv}
If you have other scripts invoked by CVSROOT/loginfo, you will
want to make sure to change any running under the "DEFAULT"
keyword to "ALL" like the loginfo handler, and probably
carefully read the execution rules for CVSROOT/loginfo from the
CVS manual.
If you are running the Unix port of CVS-NT, the handler script
need to know about it. CVS-NT delivers commit information to
loginfo scripts differently than the way mainstream CVS does.
Your command line should look like this:
ALL <VIEWVC_INSTALLATION_DIRECTORY>/bin/loginfo-handler %{sVv} cvsnt
To publish Subversion commits into the database:
To build a database of all the commits in the Subversion
repository /home/svn, invoke: "./svndbadmin rebuild /home/svn".
If you want to update the checkin database, invoke:
"./svndbadmin update /home/svn".
To get real time updates, you will need to add a post-commit
hook (for the repository example above, the script should go in
/home/svn/hooks/post-commit). The script should look something
like this:
#!/bin/sh
REPOS="$1"
REV="$2"
<VIEWVC_INSTALLATION_DIRECTORY>/bin/svndbadmin update \
"$REPOS" "$REV"
If you allow revision property changes in your repository,
create a post-revprop-change hook script which uses the same
'svndbadmin update' command as the post-commit script, except
with the addition of the --force option:
#!/bin/sh
REPOS="$1"
REV="$2"
<VIEWVC_INSTALLATION_DIRECTORY>/bin/svndbadmin update --force \
"$REPOS" "$REV"
This will make sure that the checkin database stays consistent
when you change the svn:log, svn:author or svn:date revision
properties.
You should be ready to go. Click one of the "Query revision history"
links in ViewVC directory listings and give it a try.
ENABLING SYNTAX COLORATION
--------------------------
ViewVC uses Pygments (http://pygments.org) for syntax coloration. You
need only install a suitable version of that module, and if ViewVC
finds it in your Python module path, it will use it (unless you
specifically disable the feature by setting use_pygments = 0 in your
viewvc.conf file).
CVSGRAPH CONFIGURATION
----------------------
CvsGraph is a program that can display a clickable, graphical tree
of files in a CVS repository.
WARNING: Under certain circumstances (many revisions of a file
or many branches or both) CvsGraph can generate very huge images.
Especially on thin clients these images may crash the Web-Browser.
Currently there is no known way to avoid this behavior of CvsGraph.
So you have been warned!
Nevertheless, CvsGraph can be quite helpful on repositories with
a reasonable number of revisions and branches.
1) Install CvsGraph using your system's package manager or downloading
from the project home page.
2) Set the 'use_cvsgraph' options in viewvc.conf to 1.
3) You may also need to set the 'cvsgraph_path' option if the
CvsGraph executable is not located on the system PATH.
4) There is a file <VIEWVC_INSTALLATION_DIRECTORY>/cvsgraph.conf that
you may want to edit if desired to set color and font characteristics.
See the cvsgraph.conf documentation. No edits are required in
cvsgraph.conf for operation with ViewVC.
SUBVERSION INTEGRATION
----------------------
Unlike the CVS integration, which simply wraps the RCS and CVS utility
programs, the Subversion integration requires additional Python
libraries. To use ViewVC with Subversion, make sure you have both
Subversion itself and the Subversion Python bindings installed. These
can be obtained through typical package distribution mechanisms, or
may be build from source. (See the files 'INSTALL' and
'subversion/bindings/swig/INSTALL' in the Subversion source tree for
more details on how to build and install Subversion and its Python
bindings.)
Generally speaking, you'll know when your installation of Subversion's
bindings has been successful if you can import the 'svn.core' module
from within your Python interpreter. Here's an example of doing so
which doubles as a quick way to check what version of the Subversion
Python binding you have:
% python
Python 2.2.2 (#1, Oct 29 2002, 02:47:30)
[GCC 2.96 20000731 (Red Hat Linux 7.2 2.96-108.7.2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from svn.core import *
>>> "%s.%s.%s" % (SVN_VER_MAJOR, SVN_VER_MINOR, SVN_VER_PATCH)
'1.3.1'
>>>
Note that by default, Subversion installs its bindings in a location
that is not in Python's default module search path (for example, on
Linux systems the default is usually /usr/local/lib/svn-python). You
need to remedy this, either by adding this path to Python's module
search path, or by relocating the bindings to some place in that
search path.
For example, you might want to create .pth file in your Python
installation directory's site-packages area which tells Python where
to find additional modules (in this case, you Subversion Python
bindings). You would do this as follows (and as root):
$ echo "/path/to/svn/bindings" > /path/to/python/site-packages/svn.pth
(Though, obviously, with the correct paths specified.)
Configuration of the Subversion repositories happens in much the same
way as with CVS repositories, only with the 'svn_roots' configuration
variable instead of the 'cvs_roots' one.
IF YOU HAVE PROBLEMS ...
------------------------
If you've trouble to make viewcvs.cgi work:
If nothing seems to work:
=== If nothing seems to work:
* Check if you can execute CGI-scripts (Apache needs to have an
ScriptAlias /cgi-bin or cgi-script Handler defined). Try to
execute a simple CGI-script that often comes with the distribution
of the webserver; locate the logfiles and try to find hints which
explain the malfunction
o check if you can execute CGI-scripts (Apache needs to have an
ScriptAlias /cgi-bin or cgi-script Handler defined). Try to
execute a simple CGI-script that often comes with the distribution
of the webserver; locate the logfiles and try to find hints
which explain the malfunction
o view the entries in the webserver's error.log
* View the entries in the webserver's error.log
o make sure there is a trailing slash on the URL. for example:
If ViewVC seems to work but doesn't show the expected result (Typical
error: you can't see any files)
* Check whether the CGI-script has read-permissions to your
CVS-Repository. The CGI-script generally runs as the same user
that the web server does, often user 'nobody' or 'httpd'.
* Does ViewVC find your RCS utilities? (edit rcs_dir)
If something else happens or you can't get it to work:
* Check the ViewVC home page:
http://viewvc.org/
* Review the ViewVC mailing list archive to see if somebody else had
the same problem, and it was solved:
http://viewvc.tigris.org/servlets/SummarizeList?listName=users
* Check the ViewVC issue database to see if the problem you are
seeing is the result of a known bug:
http://viewvc.tigris.org/issues/query.cgi
http://www.example.com/cgi-bin/viewcvs.cgi/
(ViewCVS should perform a redirection to ensure this, but a report
has indicated that it doesn't always do this... please send more
of these bug reports if you run into this)
=== If viewcvs seems to work but doesn't show the expected result
(Typical error: you can't see any files)
o check whether the CGI-script has read-permissions to your
CVS-Repository. The CGI-script often runs as the user 'nobody'
or 'httpd' ..
o does viewcvs find your RCS utililties? (edit rcs_path)
=== If something else happens or you can't get it to work:
o check the ViewCVS home page:
http://www.lyra.org/greg/python/viewcvs/
o review the ViewCVS mailing list archive to see if somebody else had
the same problem, and it was solved:
http://mailman.lyra.org/pipermail/viewcvs/
o send mail to the ViewCVS mailing list: viewcvs@lyra.org
NOTE: make sure you provide an accurate description of the problem
and any relevant tracebacks or error logs.
* Send mail to the ViewVC mailing list, users@viewvc.tigris.org.
NOTE: make sure you provide an accurate description of the problem
-- including the version of ViewVC you are using -- and any
relevant tracebacks or error logs.

68
LICENSE.html Normal file
View File

@@ -0,0 +1,68 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>ViewVC: License v1</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<p>The following text constitutes the license agreement for the <a
href="http://www.viewvc.org/">ViewVC</a> software (formerly known
as ViewCVS). It is an agreement between <a
href="http://www.viewvc.org/who.html#sec-viewcvs-group">The ViewCVS
Group</a> and the users of ViewVC.</p>
<blockquote>
<p><strong>Copyright &copy; 1999-2011 The ViewCVS Group. All rights
reserved.</strong></p>
<p>By using ViewVC, you agree to the terms and conditions set forth
below:</p>
<p>Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:</p>
<ol>
<li>Redistributions of source code must retain the above copyright
notice, this list of conditions and the following
disclaimer.</li>
<li>Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.</li>
</ol>
<p>THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.</p>
</blockquote>
<hr />
<p>The following changes have occured to this license over time:</p>
<ul>
<li>May 12, 2001 &mdash; copyright years updated</li>
<li>September 5, 2002 &mdash; copyright years updated</li>
<li>March 17, 2006 &mdash; software renamed from "ViewCVS"</li>
<li>April 10, 2007 &mdash; copyright years updated</li>
<li>February 22, 2008 &mdash; copyright years updated</li>
<li>March 18, 2009 &mdash; copyright years updated</li>
<li>March 29, 2010 &mdash; copyright years updated</li>
<li>February 18, 2011 &mdash; copyright years updated</li>
</ul>
</body>
</html>

6
README Normal file
View File

@@ -0,0 +1,6 @@
ViewVC -- Viewing the content of CVS/SVN repositories with a Webbrowser.
Please read the file INSTALL for more information.
And see windows/README for more information on running ViewVC on
Microsoft Windows.

27
TODO
View File

@@ -1,27 +0,0 @@
TODO ITEMS
----------
*) add Tamminen Eero's comments on how to make Linux directly execute
the Python script. From email on Feb 19.
[ add other examples, such as my /bin/sh hack or the teeny CGI stub
importing the bulk hack ]
*) insert rcs_path into PATH before calling "rcsdiff". rcsdiff might
use "co" and needs to find it on the path.
*) show the "locked" flag (attach it to the LogEntry objects).
Idea from Russell Gordon <russell@hoopscotch.dhs.org>
*) committing with a specific revision number:
http://mailman.lyra.org/pipermail/viewcvs/2000q1/000008.html
KNOWN BUGS
----------
*) from Harri Pasanen, Feb 7: when hideattic is set, files added in a
branch are not visible.
*) from Dieter Deyke, Jan 12: if the CVS revisions differ by just a
keyword, then the diff output chokes.
*) no scroll bar in Netscape browser when you click "as text" on an
HTML document.

64
bin/asp/query.asp Normal file
View File

@@ -0,0 +1,64 @@
<%@ LANGUAGE = Python %>
<%
# -*-python-*-
#
# Copyright (C) 1999-2006 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# query.asp: View CVS/SVN commit database by web browser
#
# -----------------------------------------------------------------------
#
# This is a teeny stub to launch the main ViewVC app. It checks the load
# average, then loads the (precompiled) query.py file and runs it.
#
# -----------------------------------------------------------------------
#
#########################################################################
#
# INSTALL-TIME CONFIGURATION
#
# These values will be set during the installation process. During
# development, they will remain None.
#
LIBRARY_DIR = None
CONF_PATHNAME = None
#########################################################################
#
# Adjust sys.path to include our library directory
#
import sys
if LIBRARY_DIR:
if not LIBRARY_DIR in sys.path:
sys.path.insert(0, LIBRARY_DIR)
#########################################################################
import sapi
import viewvc
import query
server = sapi.AspServer(Server, Request, Response, Application)
try:
cfg = viewvc.load_config(CONF_PATHNAME, server)
viewvc_base_url = cfg.query.viewvc_base_url
if viewvc_base_url is None:
viewvc_base_url = "viewvc.asp"
query.main(server, cfg, viewvc_base_url)
finally:
s.close()
%>

65
bin/asp/viewvc.asp Normal file
View File

@@ -0,0 +1,65 @@
<%@ LANGUAGE = Python %>
<%
# -*-python-*-
#
# Copyright (C) 1999-2006 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# viewvc: View CVS/SVN repositories via a web browser
#
# -----------------------------------------------------------------------
#
# This is a teeny stub to launch the main ViewVC app. It checks the load
# average, then loads the (precompiled) viewvc.py file and runs it.
#
# -----------------------------------------------------------------------
#
#########################################################################
#
# INSTALL-TIME CONFIGURATION
#
# These values will be set during the installation process. During
# development, they will remain None.
#
LIBRARY_DIR = None
CONF_PATHNAME = None
#########################################################################
#
# Adjust sys.path to include our library directory
#
import sys
if LIBRARY_DIR:
if not LIBRARY_DIR in sys.path:
sys.path.insert(0, LIBRARY_DIR)
#########################################################################
### add code for checking the load average
#########################################################################
# go do the work
import sapi
import viewvc
server = sapi.AspServer(Server, Request, Response, Application)
try:
cfg = viewvc.load_config(CONF_PATHNAME, server)
viewvc.main(server, cfg)
finally:
s.close()
%>

60
bin/cgi/query.cgi Normal file
View File

@@ -0,0 +1,60 @@
#!/usr/bin/env python
# -*-python-*-
#
# Copyright (C) 1999-2006 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# query.cgi: View CVS/SVN commit database by web browser
#
# -----------------------------------------------------------------------
#
# This is a teeny stub to launch the main ViewVC app. It checks the load
# average, then loads the (precompiled) viewvc.py file and runs it.
#
# -----------------------------------------------------------------------
#
#########################################################################
#
# INSTALL-TIME CONFIGURATION
#
# These values will be set during the installation process. During
# development, they will remain None.
#
LIBRARY_DIR = None
CONF_PATHNAME = None
#########################################################################
#
# Adjust sys.path to include our library directory
#
import sys
import os
if LIBRARY_DIR:
sys.path.insert(0, LIBRARY_DIR)
else:
sys.path.insert(0, os.path.abspath(os.path.join(sys.argv[0],
"../../../lib")))
#########################################################################
import sapi
import viewvc
import query
server = sapi.CgiServer()
cfg = viewvc.load_config(CONF_PATHNAME, server)
viewvc_base_url = cfg.query.viewvc_base_url
if viewvc_base_url is None:
viewvc_base_url = "viewvc.cgi"
query.main(server, cfg, viewvc_base_url)

8
bin/cgi/viewvc-strace.sh Normal file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
#
# Set this script up with something like:
#
# ScriptAlias /viewvc-strace /home/gstein/src/viewvc/cgi/viewvc-strace.sh
#
thisdir="`dirname $0`"
exec strace -q -r -o /tmp/v-strace.log "${thisdir}/viewvc.cgi"

61
bin/cgi/viewvc.cgi Normal file
View File

@@ -0,0 +1,61 @@
#!/usr/bin/env python
# -*-python-*-
#
# Copyright (C) 1999-2006 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# viewvc: View CVS/SVN repositories via a web browser
#
# -----------------------------------------------------------------------
#
# This is a teeny stub to launch the main ViewVC app. It checks the load
# average, then loads the (precompiled) viewvc.py file and runs it.
#
# -----------------------------------------------------------------------
#
#########################################################################
#
# INSTALL-TIME CONFIGURATION
#
# These values will be set during the installation process. During
# development, they will remain None.
#
LIBRARY_DIR = None
CONF_PATHNAME = None
#########################################################################
#
# Adjust sys.path to include our library directory
#
import sys
import os
if LIBRARY_DIR:
sys.path.insert(0, LIBRARY_DIR)
else:
sys.path.insert(0, os.path.abspath(os.path.join(sys.argv[0],
"../../../lib")))
#########################################################################
### add code for checking the load average
#########################################################################
# go do the work
import sapi
import viewvc
server = sapi.CgiServer()
cfg = viewvc.load_config(CONF_PATHNAME, server)
viewvc.main(server, cfg)

196
bin/cvsdbadmin Executable file
View File

@@ -0,0 +1,196 @@
#!/usr/bin/env python
# -*-python-*-
#
# Copyright (C) 1999-2008 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# administrative program for CVSdb; this is primarily
# used to add/rebuild CVS repositories to the database
#
# -----------------------------------------------------------------------
#
#########################################################################
#
# INSTALL-TIME CONFIGURATION
#
# These values will be set during the installation process. During
# development, they will remain None.
#
LIBRARY_DIR = None
CONF_PATHNAME = None
# Adjust sys.path to include our library directory
import sys
import os
if LIBRARY_DIR:
sys.path.insert(0, LIBRARY_DIR)
else:
sys.path.insert(0, os.path.abspath(os.path.join(sys.argv[0], "../../lib")))
#########################################################################
import os
import string
import cvsdb
import viewvc
import vclib.ccvs
def UpdateFile(db, repository, path, update, quiet_level):
try:
if update:
commit_list = cvsdb.GetUnrecordedCommitList(repository, path, db)
else:
commit_list = cvsdb.GetCommitListFromRCSFile(repository, path)
except cvsdb.error, e:
print '[ERROR] %s' % (e)
return
file = string.join(path, "/")
printing = 0
if update:
if quiet_level < 1 or (quiet_level < 2 and len(commit_list)):
printing = 1
print '[%s [%d new commits]]' % (file, len(commit_list)),
else:
if quiet_level < 2:
printing = 1
print '[%s [%d commits]]' % (file, len(commit_list)),
## add the commits into the database
for commit in commit_list:
db.AddCommit(commit)
if printing:
sys.stdout.write('.')
sys.stdout.flush()
if printing:
print
def RecurseUpdate(db, repository, directory, update, quiet_level):
for entry in repository.listdir(directory, None, {}):
path = directory + [entry.name]
if entry.errors:
continue
if entry.kind is vclib.DIR:
RecurseUpdate(db, repository, path, update, quiet_level)
continue
if entry.kind is vclib.FILE:
UpdateFile(db, repository, path, update, quiet_level)
def RootPath(path, quiet_level):
"""Break os path into cvs root path and other parts"""
root = os.path.abspath(path)
path_parts = []
p = root
while 1:
if os.path.exists(os.path.join(p, 'CVSROOT')):
root = p
if quiet_level < 2:
print "Using repository root `%s'" % root
break
p, pdir = os.path.split(p)
if not pdir:
del path_parts[:]
if quiet_level < 1:
print "Using repository root `%s'" % root
print "Warning: CVSROOT directory not found."
break
path_parts.append(pdir)
root = cvsdb.CleanRepository(root)
path_parts.reverse()
return root, path_parts
def usage():
cmd = os.path.basename(sys.argv[0])
sys.stderr.write(
"""Administer the ViewVC checkins database data for the CVS repository
located at REPOS-PATH.
Usage: 1. %s [[-q] -q] rebuild REPOS-PATH
2. %s [[-q] -q] update REPOS-PATH
3. %s [[-q] -q] purge REPOS-PATH
1. Rebuild the commit database information for the repository located
at REPOS-PATH, after first purging information specific to that
repository (if any).
2. Update the commit database information for all unrecorded commits
in the repository located at REPOS-PATH.
3. Purge information specific to the repository located at REPOS-PATH
from the database.
Use the -q flag to cause this script to be less verbose; use it twice to
invoke a peaceful state of noiselessness.
""" % (cmd, cmd, cmd))
sys.exit(1)
## main
if __name__ == '__main__':
args = sys.argv
# check the quietness level (0 = verbose, 1 = new commits, 2 = silent)
quiet_level = 0
while 1:
try:
index = args.index('-q')
quiet_level = quiet_level + 1
del args[index]
except ValueError:
break
# validate the command
if len(args) <= 2:
usage()
command = args[1].lower()
if command not in ('rebuild', 'update', 'purge'):
sys.stderr.write('ERROR: unknown command %s\n' % command)
usage()
# get repository and path, and do the work
root, path_parts = RootPath(args[2], quiet_level)
rootpath = vclib.ccvs.canonicalize_rootpath(root)
try:
cfg = viewvc.load_config(CONF_PATHNAME)
db = cvsdb.ConnectDatabase(cfg)
if command in ('rebuild', 'purge'):
if quiet_level < 2:
print "Purging existing data for repository root `%s'" % root
try:
db.PurgeRepository(root)
except cvsdb.UnknownRepositoryError, e:
if command == 'purge':
sys.stderr.write("ERROR: " + str(e) + "\n")
sys.exit(1)
if command in ('rebuild', 'update'):
repository = vclib.ccvs.CVSRepository(None, rootpath, None,
cfg.utilities, 0)
RecurseUpdate(db, repository, path_parts,
command == 'update', quiet_level)
except KeyboardInterrupt:
print
print '** break **'
sys.exit(0)

318
bin/loginfo-handler Executable file
View File

@@ -0,0 +1,318 @@
#!/usr/bin/env python
# -*-python-*-
#
# Copyright (C) 1999-2008 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# updates SQL database with new commit records
#
# -----------------------------------------------------------------------
#
#########################################################################
#
# INSTALL-TIME CONFIGURATION
#
# These values will be set during the installation process. During
# development, they will remain None.
#
LIBRARY_DIR = None
CONF_PATHNAME = None
# Adjust sys.path to include our library directory
import sys
import os
if LIBRARY_DIR:
sys.path.insert(0, LIBRARY_DIR)
else:
sys.path.insert(0, os.path.abspath(os.path.join(sys.argv[0], "../../lib")))
#########################################################################
import os
import string
import getopt
import re
import cvsdb
import viewvc
import vclib.ccvs
DEBUG_FLAG = 0
## output functions
def debug(text):
if DEBUG_FLAG:
if type(text) != (type([])):
text = [text]
for line in text:
line = line.rstrip('\n\r')
print 'DEBUG(viewvc-loginfo):', line
def warning(text):
print 'WARNING(viewvc-loginfo):', text
def error(text):
print 'ERROR(viewvc-loginfo):', text
sys.exit(1)
_re_revisions = re.compile(
r",(?P<old>(?:\d+\.\d+)(?:\.\d+\.\d+)*|NONE)" # comma and first revision
r",(?P<new>(?:\d+\.\d+)(?:\.\d+\.\d+)*|NONE)" # comma and second revision
r"(?:$| )" # space or end of string
)
def Cvs1Dot12ArgParse(args):
"""CVS 1.12 introduced a new loginfo format while provides the various
pieces of interesting version information to the handler script as
individual arguments instead of as a single string."""
if args[1] == '- New directory':
return None, None
elif args[1] == '- Imported sources':
return None, None
else:
directory = args.pop(0)
files = []
while len(args) >= 3:
files.append(args[0:3])
args = args[3:]
return directory, files
def HeuristicArgParse(s, repository):
"""Older versions of CVS (except for CVSNT) do not escape spaces in file
and directory names that are passed to the loginfo handler. Since the input
to loginfo is a space separated string, this can lead to ambiguities. This
function attempts to guess intelligently which spaces are separators and
which are part of file or directory names. It disambiguates spaces in
filenames from the separator spaces between files by assuming that every
space which is preceded by two well-formed revision numbers is in fact a
separator. It disambiguates the first separator space from spaces in the
directory name by choosing the longest possible directory name that
actually exists in the repository"""
if (s[-16:] == ' - New directory'
or s[:26] == ' - New directory,NONE,NONE'):
return None, None
if (s[-19:] == ' - Imported sources'
or s[-29:] == ' - Imported sources,NONE,NONE'):
return None, None
file_data_list = []
start = 0
while 1:
m = _re_revisions.search(s, start)
if start == 0:
if m is None:
error('Argument "%s" does not contain any revision numbers' \
% s)
directory, filename = FindLongestDirectory(s[:m.start()],
repository)
if directory is None:
error('Argument "%s" does not start with a valid directory' \
% s)
debug('Directory name is "%s"' % directory)
else:
if m is None:
warning('Failed to interpret past position %i in the loginfo '
'argument, leftover string is "%s"' \
% start, pos[start:])
filename = s[start:m.start()]
old_version, new_version = m.group('old', 'new')
file_data_list.append((filename, old_version, new_version))
debug('File "%s", old revision %s, new revision %s'
% (filename, old_version, new_version))
start = m.end()
if start == len(s): break
return directory, file_data_list
def FindLongestDirectory(s, repository):
"""Splits the first part of the argument string into a directory name
and a file name, either of which may contain spaces. Returns the longest
possible directory name that actually exists"""
parts = string.split(s, " ")
for i in range(len(parts)-1, 0, -1):
directory = string.join(parts[:i])
filename = string.join(parts[i:])
if os.path.isdir(os.path.join(repository, directory)):
return directory, filename
return None, None
_re_cvsnt_revisions = re.compile(
r"(?P<filename>.*)" # comma and first revision
r",(?P<old>(?:\d+\.\d+)(?:\.\d+\.\d+)*|NONE)" # comma and first revision
r",(?P<new>(?:\d+\.\d+)(?:\.\d+\.\d+)*|NONE)" # comma and second revision
r"$" # end of string
)
def CvsNtArgParse(s, repository):
"""CVSNT escapes all spaces in filenames and directory names with
backslashes"""
if s[-18:] == r' -\ New\ directory':
return None, None
if s[-21:] == r' -\ Imported\ sources':
return None, None
file_data_list = []
directory, pos = NextFile(s)
debug('Directory name is "%s"' % directory)
while 1:
fileinfo, pos = NextFile(s, pos)
if fileinfo is None:
break
m = _re_cvsnt_revisions.match(fileinfo)
if m is None:
warning('Can\'t parse file information in "%s"' % fileinfo)
continue
file_data = m.group('filename', 'old', 'new')
file_data_list.append(file_data)
debug('File "%s", old revision %s, new revision %s' % file_data)
return directory, file_data_list
def NextFile(s, pos = 0):
escaped = 0
ret = ''
i = pos
while i < len(s):
c = s[i]
if escaped:
ret += c
escaped = 0
elif c == '\\':
escaped = 1
elif c == ' ':
return ret, i + 1
else:
ret += c
i += 1
return ret or None, i
def ProcessLoginfo(rootpath, directory, files):
cfg = viewvc.load_config(CONF_PATHNAME)
db = cvsdb.ConnectDatabase(cfg)
repository = vclib.ccvs.CVSRepository(None, rootpath, None,
cfg.utilities, 0)
# split up the directory components
dirpath = filter(None, string.split(os.path.normpath(directory), os.sep))
## build a list of Commit objects
commit_list = []
for filename, old_version, new_version in files:
filepath = dirpath + [filename]
## XXX: this is nasty: in the case of a removed file, we are not
## given enough information to find it in the rlog output!
## So instead, we rlog everything in the removed file, and
## add any commits not already in the database
if new_version == 'NONE':
commits = cvsdb.GetUnrecordedCommitList(repository, filepath, db)
else:
commits = cvsdb.GetCommitListFromRCSFile(repository, filepath,
new_version)
commit_list.extend(commits)
## add to the database
db.AddCommitList(commit_list)
## MAIN
if __name__ == '__main__':
## get the repository from the environment
try:
repository = os.environ['CVSROOT']
except KeyError:
error('CVSROOT not in environment')
debug('Repository name is "%s"' % repository)
## parse arguments
argc = len(sys.argv)
debug('Got %d arguments:' % (argc))
debug(map(lambda x: ' ' + x, sys.argv))
# if we have more than 3 arguments, we are likely using the
# newer loginfo format introduced in CVS 1.12:
#
# ALL <path>/bin/loginfo-handler %p %{sVv}
if argc > 3:
directory, files = Cvs1Dot12ArgParse(sys.argv[1:])
else:
if len(sys.argv) > 1:
# the first argument should contain file version information
arg = sys.argv[1]
else:
# if there are no arguments, read version information from
# first line of input like old versions of ViewCVS did
arg = string.rstrip(sys.stdin.readline())
if len(sys.argv) > 2:
# if there is a second argument it indicates which parser
# should be used to interpret the version information
if sys.argv[2] == 'cvs':
fun = HeuristicArgParse
elif sys.argv[2] == 'cvsnt':
fun = CvsNtArgParse
else:
error('Bad arguments')
else:
# if there is no second argument, guess which parser to use based
# on the operating system. Since CVSNT now runs on Windows and
# Linux, the guess isn't necessarily correct
if sys.platform == "win32":
fun = CvsNtArgParse
else:
fun = HeuristicArgParse
directory, files = fun(arg, repository)
debug('Discarded from stdin:')
debug(map(lambda x: ' ' + x, sys.stdin.readlines())) # consume stdin
repository = cvsdb.CleanRepository(repository)
debug('Repository: %s' % (repository))
debug('Directory: %s' % (directory))
debug('Files: %s' % (str(files)))
if files is None:
debug('Not a checkin, nothing to do')
else:
ProcessLoginfo(repository, directory, files)
sys.exit(0)

346
bin/make-database Executable file
View File

@@ -0,0 +1,346 @@
#!/usr/bin/env python
# -*-python-*-
#
# Copyright (C) 1999-2009 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# administrative program for CVSdb; creates a clean database in
# MySQL 3.22 or later
#
# -----------------------------------------------------------------------
import os, sys, string
import popen2
import getopt
## ------------------------------------------------------------------------
## Stuff common to all schemas
##
DATABASE_SCRIPT_COMMON="""\
DROP DATABASE IF EXISTS <dbname>;
CREATE DATABASE <dbname>;
USE <dbname>;
"""
## ------------------------------------------------------------------------
## Version 0: The original, Bonsai-compatible schema.
##
DATABASE_SCRIPT_VERSION_0="""\
DROP TABLE IF EXISTS branches;
CREATE TABLE branches (
id mediumint(9) NOT NULL auto_increment,
branch varchar(64) binary DEFAULT '' NOT NULL,
PRIMARY KEY (id),
UNIQUE branch (branch)
) TYPE=MyISAM;
DROP TABLE IF EXISTS checkins;
CREATE TABLE checkins (
type enum('Change','Add','Remove'),
ci_when datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
whoid mediumint(9) DEFAULT '0' NOT NULL,
repositoryid mediumint(9) DEFAULT '0' NOT NULL,
dirid mediumint(9) DEFAULT '0' NOT NULL,
fileid mediumint(9) DEFAULT '0' NOT NULL,
revision varchar(32) binary DEFAULT '' NOT NULL,
stickytag varchar(255) binary DEFAULT '' NOT NULL,
branchid mediumint(9) DEFAULT '0' NOT NULL,
addedlines int(11) DEFAULT '0' NOT NULL,
removedlines int(11) DEFAULT '0' NOT NULL,
descid mediumint(9),
UNIQUE repositoryid (repositoryid,dirid,fileid,revision),
KEY ci_when (ci_when),
KEY whoid (whoid),
KEY repositoryid_2 (repositoryid),
KEY dirid (dirid),
KEY fileid (fileid),
KEY branchid (branchid)
) TYPE=MyISAM;
DROP TABLE IF EXISTS descs;
CREATE TABLE descs (
id mediumint(9) NOT NULL auto_increment,
description text,
hash bigint(20) DEFAULT '0' NOT NULL,
PRIMARY KEY (id),
KEY hash (hash)
) TYPE=MyISAM;
DROP TABLE IF EXISTS dirs;
CREATE TABLE dirs (
id mediumint(9) NOT NULL auto_increment,
dir varchar(255) binary DEFAULT '' NOT NULL,
PRIMARY KEY (id),
UNIQUE dir (dir)
) TYPE=MyISAM;
DROP TABLE IF EXISTS files;
CREATE TABLE files (
id mediumint(9) NOT NULL auto_increment,
file varchar(255) binary DEFAULT '' NOT NULL,
PRIMARY KEY (id),
UNIQUE file (file)
) TYPE=MyISAM;
DROP TABLE IF EXISTS people;
CREATE TABLE people (
id mediumint(9) NOT NULL auto_increment,
who varchar(128) binary DEFAULT '' NOT NULL,
PRIMARY KEY (id),
UNIQUE who (who)
) TYPE=MyISAM;
DROP TABLE IF EXISTS repositories;
CREATE TABLE repositories (
id mediumint(9) NOT NULL auto_increment,
repository varchar(64) binary DEFAULT '' NOT NULL,
PRIMARY KEY (id),
UNIQUE repository (repository)
) TYPE=MyISAM;
DROP TABLE IF EXISTS tags;
CREATE TABLE tags (
repositoryid mediumint(9) DEFAULT '0' NOT NULL,
branchid mediumint(9) DEFAULT '0' NOT NULL,
dirid mediumint(9) DEFAULT '0' NOT NULL,
fileid mediumint(9) DEFAULT '0' NOT NULL,
revision varchar(32) binary DEFAULT '' NOT NULL,
UNIQUE repositoryid (repositoryid,dirid,fileid,branchid,revision),
KEY repositoryid_2 (repositoryid),
KEY dirid (dirid),
KEY fileid (fileid),
KEY branchid (branchid)
) TYPE=MyISAM;
"""
## ------------------------------------------------------------------------
## Version 1: Adds the 'metadata' table. Adds 'descid' index to
## 'checkins' table, and renames that table to 'commits'.
##
DATABASE_SCRIPT_VERSION_1="""\
DROP TABLE IF EXISTS branches;
CREATE TABLE branches (
id mediumint(9) NOT NULL auto_increment,
branch varchar(64) binary DEFAULT '' NOT NULL,
PRIMARY KEY (id),
UNIQUE branch (branch)
) TYPE=MyISAM;
DROP TABLE IF EXISTS commits;
CREATE TABLE commits (
type enum('Change','Add','Remove'),
ci_when datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
whoid mediumint(9) DEFAULT '0' NOT NULL,
repositoryid mediumint(9) DEFAULT '0' NOT NULL,
dirid mediumint(9) DEFAULT '0' NOT NULL,
fileid mediumint(9) DEFAULT '0' NOT NULL,
revision varchar(32) binary DEFAULT '' NOT NULL,
stickytag varchar(255) binary DEFAULT '' NOT NULL,
branchid mediumint(9) DEFAULT '0' NOT NULL,
addedlines int(11) DEFAULT '0' NOT NULL,
removedlines int(11) DEFAULT '0' NOT NULL,
descid mediumint(9),
UNIQUE repositoryid (repositoryid,dirid,fileid,revision),
KEY ci_when (ci_when),
KEY whoid (whoid),
KEY repositoryid_2 (repositoryid),
KEY dirid (dirid),
KEY fileid (fileid),
KEY branchid (branchid),
KEY descid (descid)
) TYPE=MyISAM;
DROP TABLE IF EXISTS descs;
CREATE TABLE descs (
id mediumint(9) NOT NULL auto_increment,
description text,
hash bigint(20) DEFAULT '0' NOT NULL,
PRIMARY KEY (id),
KEY hash (hash)
) TYPE=MyISAM;
DROP TABLE IF EXISTS dirs;
CREATE TABLE dirs (
id mediumint(9) NOT NULL auto_increment,
dir varchar(255) binary DEFAULT '' NOT NULL,
PRIMARY KEY (id),
UNIQUE dir (dir)
) TYPE=MyISAM;
DROP TABLE IF EXISTS files;
CREATE TABLE files (
id mediumint(9) NOT NULL auto_increment,
file varchar(255) binary DEFAULT '' NOT NULL,
PRIMARY KEY (id),
UNIQUE file (file)
) TYPE=MyISAM;
DROP TABLE IF EXISTS people;
CREATE TABLE people (
id mediumint(9) NOT NULL auto_increment,
who varchar(128) binary DEFAULT '' NOT NULL,
PRIMARY KEY (id),
UNIQUE who (who)
) TYPE=MyISAM;
DROP TABLE IF EXISTS repositories;
CREATE TABLE repositories (
id mediumint(9) NOT NULL auto_increment,
repository varchar(64) binary DEFAULT '' NOT NULL,
PRIMARY KEY (id),
UNIQUE repository (repository)
) TYPE=MyISAM;
DROP TABLE IF EXISTS tags;
CREATE TABLE tags (
repositoryid mediumint(9) DEFAULT '0' NOT NULL,
branchid mediumint(9) DEFAULT '0' NOT NULL,
dirid mediumint(9) DEFAULT '0' NOT NULL,
fileid mediumint(9) DEFAULT '0' NOT NULL,
revision varchar(32) binary DEFAULT '' NOT NULL,
UNIQUE repositoryid (repositoryid,dirid,fileid,branchid,revision),
KEY repositoryid_2 (repositoryid),
KEY dirid (dirid),
KEY fileid (fileid),
KEY branchid (branchid)
) TYPE=MyISAM;
DROP TABLE IF EXISTS metadata;
CREATE TABLE metadata (
name varchar(255) binary DEFAULT '' NOT NULL,
value text,
PRIMARY KEY (name),
UNIQUE name (name)
) TYPE=MyISAM;
INSERT INTO metadata (name, value) VALUES ('version', '1');
"""
BONSAI_COMPAT="""
WARNING: Creating Bonsai-compatible legacy database version. Some ViewVC
features may not be available, or may not perform especially well.
"""
## ------------------------------------------------------------------------
def usage_and_exit(errmsg=None):
stream = errmsg is None and sys.stdout or sys.stderr
stream.write("""\
Usage: %s [OPTIONS]
This script creates the database and tables in MySQL used by the
ViewVC checkin database. In order to operate correctly, it needs to
know the following: your database server hostname, database user,
database user password, and database name. (You will be prompted for
any of this information that you do not provide via command-line
options.) This script will use the 'mysql' program to create the
database for you. You will then need to set the appropriate
parameters in the [cvsdb] section of your viewvc.conf file.
Options:
--dbname=ARG Use ARG as the ViewVC database name to create.
[Default: ViewVC]
--help Show this usage message.
--hostname=ARG Use ARG as the hostname for the MySQL connection.
[Default: localhost]
--password=ARG Use ARG as the password for the MySQL connection.
--username=ARG Use ARG as the username for the MySQL connection.
--version=ARG Create the database using the schema employed by
version ARG of ViewVC. Valid values are:
[ "1.0" ]
""" % (os.path.basename(sys.argv[0])))
if errmsg is not None:
stream.write("[ERROR] %s.\n" % (errmsg))
sys.exit(1)
sys.exit(0)
if __name__ == "__main__":
try:
# Parse the command-line options, if any.
dbname = version = hostname = username = password = None
opts, args = getopt.getopt(sys.argv[1:], '', [ 'dbname=',
'help',
'hostname=',
'password=',
'username=',
'version=',
])
if len(args) > 0:
usage_and_exit("Unexpected command-line parameters")
for name, value in opts:
if name == '--help':
usage_and_exit(0)
elif name == '--dbname':
dbname = value
elif name == '--hostname':
hostname = value
elif name == '--username':
username = value
elif name == '--password':
password = value
elif name == '--version':
if value in ["1.0"]:
version = value
else:
usage_and_exit("Invalid version specified")
# Prompt for information not provided via command-line options.
if hostname is None:
hostname = raw_input("MySQL Hostname [default: localhost]: ") or ""
if username is None:
username = raw_input("MySQL User: ")
if password is None:
password = raw_input("MySQL Password: ")
if dbname is None:
dbname = raw_input("ViewVC Database Name [default: ViewVC]: ") or "ViewVC"
# Create the database
dscript = string.replace(DATABASE_SCRIPT_COMMON, "<dbname>", dbname)
if version == "1.0":
print BONSAI_COMPAT
dscript = dscript + DATABASE_SCRIPT_VERSION_0
else:
dscript = dscript + DATABASE_SCRIPT_VERSION_1
host_option = hostname and "--host=%s" % (hostname) or ""
if sys.platform == "win32":
cmd = "mysql --user=%s --password=%s %s "\
% (username, password, host_option)
mysql = os.popen(cmd, "w") # popen2.Popen3 is not provided on windows
mysql.write(dscript)
status = mysql.close()
else:
cmd = "{ mysql --user=%s --password=%s %s ; } 2>&1" \
% (username, password, host_option)
pipes = popen2.Popen3(cmd)
pipes.tochild.write(dscript)
pipes.tochild.close()
print pipes.fromchild.read()
status = pipes.wait()
if status:
print "[ERROR] The database did not create sucessfully."
sys.exit(1)
print "Database created successfully. Don't forget to configure the "
print "[cvsdb] section of your viewvc.conf file."
except KeyboardInterrupt:
pass
sys.exit(0)

3
bin/mod_python/.htaccess Normal file
View File

@@ -0,0 +1,3 @@
AddHandler python-program .py
PythonHandler handler
PythonDebug On

31
bin/mod_python/handler.py Normal file
View File

@@ -0,0 +1,31 @@
# -*-python-*-
#
# Copyright (C) 1999-2006 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# Mod_Python handler based on mod_python.publisher
#
# -----------------------------------------------------------------------
from mod_python import apache
import os.path
def handler(req):
path, module_name = os.path.split(req.filename)
module_name, module_ext = os.path.splitext(module_name)
try:
module = apache.import_module(module_name, path=[path])
except ImportError:
raise apache.SERVER_RETURN, apache.HTTP_NOT_FOUND
req.add_common_vars()
module.index(req)
return apache.OK

74
bin/mod_python/query.py Normal file
View File

@@ -0,0 +1,74 @@
# -*-python-*-
#
# Copyright (C) 1999-2010 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# ViewVC: View CVS/SVN repositories via a web browser
#
# -----------------------------------------------------------------------
#
# This is a teeny stub to launch the main ViewVC app. It checks the load
# average, then loads the (precompiled) viewvc.py file and runs it.
#
# -----------------------------------------------------------------------
#
#########################################################################
#
# INSTALL-TIME CONFIGURATION
#
# These values will be set during the installation process. During
# development, they will remain None.
#
LIBRARY_DIR = None
CONF_PATHNAME = None
#########################################################################
#
# Adjust sys.path to include our library directory
#
import sys
if LIBRARY_DIR:
sys.path.insert(0, LIBRARY_DIR)
import sapi
import imp
# Import real ViewVC module
fp, pathname, description = imp.find_module('viewvc', [LIBRARY_DIR])
try:
viewvc = imp.load_module('viewvc', fp, pathname, description)
finally:
if fp:
fp.close()
# Import real ViewVC Query modules
fp, pathname, description = imp.find_module('query', [LIBRARY_DIR])
try:
query = imp.load_module('query', fp, pathname, description)
finally:
if fp:
fp.close()
cfg = viewvc.load_config(CONF_PATHNAME)
def index(req):
server = sapi.ModPythonServer(req)
try:
viewvc_base_url = cfg.query.viewvc_base_url
if viewvc_base_url is None:
viewvc_base_url = "viewvc.py"
query.main(server, cfg, viewvc_base_url)
finally:
server.close()

61
bin/mod_python/viewvc.py Normal file
View File

@@ -0,0 +1,61 @@
# -*-python-*-
#
# Copyright (C) 1999-2008 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# viewvc: View CVS/SVN repositories via a web browser
#
# -----------------------------------------------------------------------
#
# This is a teeny stub to launch the main ViewVC app. It checks the load
# average, then loads the (precompiled) viewvc.py file and runs it.
#
# -----------------------------------------------------------------------
#
#########################################################################
#
# INSTALL-TIME CONFIGURATION
#
# These values will be set during the installation process. During
# development, they will remain None.
#
LIBRARY_DIR = None
CONF_PATHNAME = None
#########################################################################
#
# Adjust sys.path to include our library directory
#
import sys
if LIBRARY_DIR:
sys.path.insert(0, LIBRARY_DIR)
import sapi
import imp
# Import real ViewVC module
fp, pathname, description = imp.find_module('viewvc', [LIBRARY_DIR])
try:
viewvc = imp.load_module('viewvc', fp, pathname, description)
finally:
if fp:
fp.close()
def index(req):
server = sapi.ModPythonServer(req)
cfg = viewvc.load_config(CONF_PATHNAME, server)
try:
viewvc.main(server, cfg)
finally:
server.close()

879
bin/standalone.py Executable file
View File

@@ -0,0 +1,879 @@
#!/usr/bin/env python
# -*-python-*-
#
# Copyright (C) 1999-2010 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
"""Run "standalone.py -p <port>" to start an HTTP server on a given port
on the local machine to generate ViewVC web pages.
"""
__author__ = "Peter Funk <pf@artcom-gmbh.de>"
__date__ = "11 November 2001"
__version__ = "$Revision$"
__credits__ = """Guido van Rossum, for an excellent programming language.
Greg Stein, for writing ViewCVS in the first place.
Ka-Ping Yee, for the GUI code and the framework stolen from pydoc.py.
"""
# INSTALL-TIME CONFIGURATION
#
# These values will be set during the installation process. During
# development, they will remain None.
#
LIBRARY_DIR = None
CONF_PATHNAME = None
import sys
import os
import os.path
import stat
import string
import urllib
import rfc822
import socket
import select
import base64
import BaseHTTPServer
if LIBRARY_DIR:
sys.path.insert(0, LIBRARY_DIR)
else:
sys.path.insert(0, os.path.abspath(os.path.join(sys.argv[0], "../../lib")))
import sapi
import viewvc
import compat; compat.for_standalone()
# The 'crypt' module is only available on Unix platforms. We'll try
# to use 'fcrypt' if it's available (for more information, see
# http://carey.geek.nz/code/python-fcrypt/).
has_crypt = False
try:
import crypt
has_crypt = True
def _check_passwd(user_passwd, real_passwd):
return real_passwd == crypt.crypt(user_passwd, real_passwd[:2])
except ImportError:
try:
import fcrypt
has_crypt = True
def _check_passwd(user_passwd, real_passwd):
return real_passwd == fcrypt.crypt(user_passwd, real_passwd[:2])
except ImportError:
def _check_passwd(user_passwd, real_passwd):
return False
class Options:
port = 49152 # default TCP/IP port used for the server
repositories = {} # use default repositories specified in config
host = sys.platform == 'mac' and '127.0.0.1' or 'localhost'
script_alias = 'viewvc'
config_file = None
htpasswd_file = None
class StandaloneServer(sapi.CgiServer):
"""Custom sapi interface that uses a BaseHTTPRequestHandler HANDLER
to generate output."""
def __init__(self, handler):
sapi.CgiServer.__init__(self, inheritableOut = sys.platform != "win32")
self.handler = handler
def header(self, content_type='text/html', status=None):
if not self.headerSent:
self.headerSent = 1
if status is None:
statusCode = 200
statusText = 'OK'
else:
p = string.find(status, ' ')
if p < 0:
statusCode = int(status)
statusText = ''
else:
statusCode = int(status[:p])
statusText = status[p+1:]
self.handler.send_response(statusCode, statusText)
self.handler.send_header("Content-type", content_type)
for (name, value) in self.headers:
self.handler.send_header(name, value)
self.handler.end_headers()
class NotViewVCLocationException(Exception):
"""The request location was not aimed at ViewVC."""
pass
class AuthenticationException(Exception):
"""Authentication requirements have not been met."""
pass
class ViewVCHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Custom HTTP request handler for ViewVC."""
def do_GET(self):
"""Serve a GET request."""
self.handle_request('GET')
def do_POST(self):
"""Serve a POST request."""
self.handle_request('POST')
def handle_request(self, method):
"""Handle a request of type METHOD."""
try:
self.run_viewvc()
except NotViewVCLocationException:
# If the request was aimed at the server root, but there's a
# non-empty script_alias, automatically redirect to the
# script_alias. Otherwise, just return a 404 and shrug.
if (not self.path or self.path == "/") and options.script_alias:
new_url = self.server.url + options.script_alias + '/'
self.send_response(301, "Moved Permanently")
self.send_header("Content-type", "text/html")
self.send_header("Location", new_url)
self.end_headers()
self.wfile.write("""<html>
<head>
<meta http-equiv="refresh" content="10; url=%s" />
<title>Moved Temporarily</title>
</head>
<body>
<h1>Redirecting to ViewVC</h1>
<p>You will be automatically redirected to <a href="%s">ViewVC</a>.
If this doesn't work, please click on the link above.</p>
</body>
</html>
""" % (new_url, new_url))
else:
self.send_error(404)
except IOError: # ignore IOError: [Errno 32] Broken pipe
pass
except AuthenticationException:
self.send_response(401, "Unauthorized")
self.send_header("WWW-Authenticate", 'Basic realm="ViewVC"')
self.send_header("Content-type", "text/html")
self.end_headers()
self.wfile.write("""<html>
<head>
<title>Authentication failed</title>
</head>
<body>
<h1>Authentication failed</h1>
<p>Authentication has failed. Please retry with the correct username
and password.</p>
</body>
</html>""")
def is_viewvc(self):
"""Check whether self.path is, or is a child of, the ScriptAlias"""
if not options.script_alias:
return 1
if self.path == '/' + options.script_alias:
return 1
alias_len = len(options.script_alias)
if self.path[:alias_len+2] == '/' + options.script_alias + '/':
return 1
if self.path[:alias_len+2] == '/' + options.script_alias + '?':
return 1
return 0
def validate_password(self, htpasswd_file, username, password):
"""Compare USERNAME and PASSWORD against HTPASSWD_FILE."""
try:
lines = open(htpasswd_file, 'r').readlines()
for line in lines:
file_user, file_pass = string.split(line.rstrip(), ':', 1)
if username == file_user:
return _check_passwd(password, file_pass)
except:
pass
return False
def run_viewvc(self):
"""Run ViewVC to field a single request."""
### Much of this is adapter from Python's standard library
### module CGIHTTPServer.
# Is this request even aimed at ViewVC? If not, complain.
if not self.is_viewvc():
raise NotViewVCLocationException()
# If htpasswd authentication is enabled, try to authenticate the user.
self.username = None
if options.htpasswd_file:
authn = self.headers.get('authorization')
if not authn:
raise AuthenticationException()
try:
kind, data = string.split(authn, ' ', 1)
if kind == 'Basic':
data = base64.b64decode(data)
username, password = string.split(data, ':', 1)
except:
raise AuthenticationException()
if not self.validate_password(options.htpasswd_file, username, password):
raise AuthenticationException()
self.username = username
# Setup the environment in preparation of executing ViewVC's core code.
env = os.environ
scriptname = options.script_alias and '/' + options.script_alias or ''
viewvc_url = self.server.url[:-1] + scriptname
rest = self.path[len(scriptname):]
i = string.rfind(rest, '?')
if i >= 0:
rest, query = rest[:i], rest[i+1:]
else:
query = ''
# Since we're going to modify the env in the parent, provide empty
# values to override previously set values
for k in env.keys():
if k[:5] == 'HTTP_':
del env[k]
for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH',
'HTTP_USER_AGENT', 'HTTP_COOKIE'):
if env.has_key(k):
env[k] = ""
# XXX Much of the following could be prepared ahead of time!
env['SERVER_SOFTWARE'] = self.version_string()
env['SERVER_NAME'] = self.server.server_name
env['GATEWAY_INTERFACE'] = 'CGI/1.1'
env['SERVER_PROTOCOL'] = self.protocol_version
env['SERVER_PORT'] = str(self.server.server_port)
env['REQUEST_METHOD'] = self.command
uqrest = urllib.unquote(rest)
env['PATH_INFO'] = uqrest
env['SCRIPT_NAME'] = scriptname
if query:
env['QUERY_STRING'] = query
env['HTTP_HOST'] = self.server.address[0]
host = self.address_string()
if host != self.client_address[0]:
env['REMOTE_HOST'] = host
env['REMOTE_ADDR'] = self.client_address[0]
if self.username:
env['REMOTE_USER'] = self.username
if self.headers.typeheader is None:
env['CONTENT_TYPE'] = self.headers.type
else:
env['CONTENT_TYPE'] = self.headers.typeheader
length = self.headers.getheader('content-length')
if length:
env['CONTENT_LENGTH'] = length
accept = []
for line in self.headers.getallmatchingheaders('accept'):
if line[:1] in string.whitespace:
accept.append(string.strip(line))
else:
accept = accept + string.split(line[7:], ',')
env['HTTP_ACCEPT'] = string.joinfields(accept, ',')
ua = self.headers.getheader('user-agent')
if ua:
env['HTTP_USER_AGENT'] = ua
modified = self.headers.getheader('if-modified-since')
if modified:
env['HTTP_IF_MODIFIED_SINCE'] = modified
etag = self.headers.getheader('if-none-match')
if etag:
env['HTTP_IF_NONE_MATCH'] = etag
# AUTH_TYPE
# REMOTE_IDENT
# XXX Other HTTP_* headers
# Preserve state, because we execute script in current process:
save_argv = sys.argv
save_stdin = sys.stdin
save_stdout = sys.stdout
save_stderr = sys.stderr
# For external tools like enscript we also need to redirect
# the real stdout file descriptor.
#
# FIXME: This code used to carry the following comment:
#
# (On windows, reassigning the sys.stdout variable is sufficient
# because pipe_cmds makes it the standard output for child
# processes.)
#
# But we no longer use pipe_cmds. So at the very least, the
# comment is stale. Is the code okay, though?
if sys.platform != "win32":
save_realstdout = os.dup(1)
try:
try:
sys.stdout = self.wfile
if sys.platform != "win32":
os.dup2(self.wfile.fileno(), 1)
sys.stdin = self.rfile
viewvc.main(StandaloneServer(self), cfg)
finally:
sys.argv = save_argv
sys.stdin = save_stdin
sys.stdout.flush()
if sys.platform != "win32":
os.dup2(save_realstdout, 1)
os.close(save_realstdout)
sys.stdout = save_stdout
sys.stderr = save_stderr
except SystemExit, status:
self.log_error("ViewVC exit status %s", str(status))
else:
self.log_error("ViewVC exited ok")
class ViewVCHTTPServer(BaseHTTPServer.HTTPServer):
"""Customized HTTP server for ViewVC."""
def __init__(self, host, port, callback):
self.address = (host, port)
self.url = 'http://%s:%d/' % (host, port)
self.callback = callback
BaseHTTPServer.HTTPServer.__init__(self, self.address, self.handler)
def serve_until_quit(self):
self.quit = 0
while not self.quit:
rd, wr, ex = select.select([self.socket.fileno()], [], [], 1)
if rd:
self.handle_request()
def server_activate(self):
BaseHTTPServer.HTTPServer.server_activate(self)
if self.callback:
self.callback(self)
def server_bind(self):
# set SO_REUSEADDR (if available on this platform)
if hasattr(socket, 'SOL_SOCKET') and hasattr(socket, 'SO_REUSEADDR'):
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
BaseHTTPServer.HTTPServer.server_bind(self)
def serve(host, port, callback=None):
"""Start an HTTP server for HOST on PORT. Call CALLBACK function
when the server is ready to serve."""
ViewVCHTTPServer.handler = ViewVCHTTPRequestHandler
try:
# XXX Move this code out of this function.
# Early loading of configuration here. Used to allow tinkering
# with some configuration settings:
handle_config(options.config_file)
if options.repositories:
cfg.general.default_root = "Development"
for repo_name in options.repositories.keys():
repo_path = os.path.normpath(options.repositories[repo_name])
if os.path.exists(os.path.join(repo_path, "CVSROOT", "config")):
cfg.general.cvs_roots[repo_name] = repo_path
elif os.path.exists(os.path.join(repo_path, "format")):
cfg.general.svn_roots[repo_name] = repo_path
elif cfg.general.cvs_roots.has_key("Development") and \
not os.path.isdir(cfg.general.cvs_roots["Development"]):
sys.stderr.write("*** No repository found. Please use the -r option.\n")
sys.stderr.write(" Use --help for more info.\n")
raise KeyboardInterrupt # Hack!
os.close(0) # To avoid problems with shell job control
# always use default docroot location
cfg.options.docroot = None
# if cvsnt isn't found, fall back to rcs
if (cfg.conf_path is None and cfg.utilities.cvsnt):
import popen
cvsnt_works = 0
try:
fp = popen.popen(cfg.utilities.cvsnt, ['--version'], 'rt')
try:
while 1:
line = fp.readline()
if not line:
break
if string.find(line, "Concurrent Versions System (CVSNT)") >= 0:
cvsnt_works = 1
while fp.read(4096):
pass
break
finally:
fp.close()
except:
pass
if not cvsnt_works:
cfg.utilities.cvsnt = None
ViewVCHTTPServer(host, port, callback).serve_until_quit()
except (KeyboardInterrupt, select.error):
pass
print 'server stopped'
def handle_config(config_file):
global cfg
cfg = viewvc.load_config(config_file or CONF_PATHNAME)
# --- graphical interface: --------------------------------------------------
def nogui(missing_module):
sys.stderr.write("""\
Sorry! Your Python was compiled without the %s module enabled.
I'm unable to run the GUI part. Please omit the '-g' and '--gui' options,
or install another Python interpreter.
""" % (missing_module))
raise SystemExit, 1
def gui(host, port):
"""Graphical interface (starts web server and pops up a control window)."""
class GUI:
def __init__(self, window, host, port):
self.window = window
self.server = None
self.scanner = None
try:
import Tkinter
except ImportError:
nogui("Tkinter")
self.server_frm = Tkinter.Frame(window)
self.title_lbl = Tkinter.Label(self.server_frm,
text='Starting server...\n ')
self.open_btn = Tkinter.Button(self.server_frm,
text='open browser',
command=self.open,
state='disabled')
self.quit_btn = Tkinter.Button(self.server_frm,
text='quit serving',
command=self.quit,
state='disabled')
self.window.title('ViewVC standalone')
self.window.protocol('WM_DELETE_WINDOW', self.quit)
self.title_lbl.pack(side='top', fill='x')
self.open_btn.pack(side='left', fill='x', expand=1)
self.quit_btn.pack(side='right', fill='x', expand=1)
# Early loading of configuration here. Used to
# allow tinkering with configuration settings through the gui:
handle_config(options.config_file)
if not LIBRARY_DIR:
cfg.options.cvsgraph_conf = "../cgi/cvsgraph.conf.dist"
self.options_frm = Tkinter.Frame(window)
# cvsgraph toggle:
self.cvsgraph_ivar = Tkinter.IntVar()
self.cvsgraph_ivar.set(cfg.options.use_cvsgraph)
self.cvsgraph_toggle = \
Tkinter.Checkbutton(self.options_frm,
text="enable cvsgraph (needs binary)",
var=self.cvsgraph_ivar,
command=self.toggle_use_cvsgraph)
self.cvsgraph_toggle.pack(side='top', anchor='w')
# show_subdir_lastmod toggle:
self.subdirmod_ivar = Tkinter.IntVar()
self.subdirmod_ivar.set(cfg.options.show_subdir_lastmod)
self.subdirmod_toggle = \
Tkinter.Checkbutton(self.options_frm,
text="show subdir last mod (dir view)",
var=self.subdirmod_ivar,
command=self.toggle_subdirmod)
self.subdirmod_toggle.pack(side='top', anchor='w')
# use_re_search toggle:
self.useresearch_ivar = Tkinter.IntVar()
self.useresearch_ivar.set(cfg.options.use_re_search)
self.useresearch_toggle = \
Tkinter.Checkbutton(self.options_frm,
text="allow regular expr search",
var=self.useresearch_ivar,
command=self.toggle_useresearch)
self.useresearch_toggle.pack(side='top', anchor='w')
# use_localtime toggle:
self.use_localtime_ivar = Tkinter.IntVar()
self.use_localtime_ivar.set(cfg.options.use_localtime)
self.use_localtime_toggle = \
Tkinter.Checkbutton(self.options_frm,
text="use localtime (instead of UTC)",
var=self.use_localtime_ivar,
command=self.toggle_use_localtime)
self.use_localtime_toggle.pack(side='top', anchor='w')
# log_pagesize integer var:
self.log_pagesize_lbl = \
Tkinter.Label(self.options_frm,
text='number of items per log page (0 disables):')
self.log_pagesize_lbl.pack(side='top', anchor='w')
self.log_pagesize_ivar = Tkinter.IntVar()
self.log_pagesize_ivar.set(cfg.options.log_pagesize)
self.log_pagesize_entry = \
Tkinter.Entry(self.options_frm,
width=10,
textvariable=self.log_pagesize_ivar)
self.log_pagesize_entry.bind('<Return>', self.set_log_pagesize)
self.log_pagesize_entry.pack(side='top', anchor='w')
# dir_pagesize integer var:
self.dir_pagesize_lbl = \
Tkinter.Label(self.options_frm,
text='number of items per dir page (0 disables):')
self.dir_pagesize_lbl.pack(side='top', anchor='w')
self.dir_pagesize_ivar = Tkinter.IntVar()
self.dir_pagesize_ivar.set(cfg.options.dir_pagesize)
self.dir_pagesize_entry = \
Tkinter.Entry(self.options_frm,
width=10,
textvariable=self.dir_pagesize_ivar)
self.dir_pagesize_entry.bind('<Return>', self.set_dir_pagesize)
self.dir_pagesize_entry.pack(side='top', anchor='w')
# directory view template:
self.dirtemplate_lbl = \
Tkinter.Label(self.options_frm,
text='Choose HTML Template for the Directory pages:')
self.dirtemplate_lbl.pack(side='top', anchor='w')
self.dirtemplate_svar = Tkinter.StringVar()
self.dirtemplate_svar.set(cfg.templates.directory)
self.dirtemplate_entry = \
Tkinter.Entry(self.options_frm,
width=40,
textvariable=self.dirtemplate_svar)
self.dirtemplate_entry.bind('<Return>', self.set_templates_directory)
self.dirtemplate_entry.pack(side='top', anchor='w')
self.templates_dir = \
Tkinter.Radiobutton(self.options_frm,
text="directory.ezt",
value="templates/directory.ezt",
var=self.dirtemplate_svar,
command=self.set_templates_directory)
self.templates_dir.pack(side='top', anchor='w')
self.templates_dir_alt = \
Tkinter.Radiobutton(self.options_frm,
text="dir_alternate.ezt",
value="templates/dir_alternate.ezt",
var=self.dirtemplate_svar,
command=self.set_templates_directory)
self.templates_dir_alt.pack(side='top', anchor='w')
# log view template:
self.logtemplate_lbl = \
Tkinter.Label(self.options_frm,
text='Choose HTML Template for the Log pages:')
self.logtemplate_lbl.pack(side='top', anchor='w')
self.logtemplate_svar = Tkinter.StringVar()
self.logtemplate_svar.set(cfg.templates.log)
self.logtemplate_entry = \
Tkinter.Entry(self.options_frm,
width=40,
textvariable=self.logtemplate_svar)
self.logtemplate_entry.bind('<Return>', self.set_templates_log)
self.logtemplate_entry.pack(side='top', anchor='w')
self.templates_log = \
Tkinter.Radiobutton(self.options_frm,
text="log.ezt",
value="templates/log.ezt",
var=self.logtemplate_svar,
command=self.set_templates_log)
self.templates_log.pack(side='top', anchor='w')
self.templates_log_table = \
Tkinter.Radiobutton(self.options_frm,
text="log_table.ezt",
value="templates/log_table.ezt",
var=self.logtemplate_svar,
command=self.set_templates_log)
self.templates_log_table.pack(side='top', anchor='w')
# query view template:
self.querytemplate_lbl = \
Tkinter.Label(self.options_frm,
text='Template for the database query page:')
self.querytemplate_lbl.pack(side='top', anchor='w')
self.querytemplate_svar = Tkinter.StringVar()
self.querytemplate_svar.set(cfg.templates.query)
self.querytemplate_entry = \
Tkinter.Entry(self.options_frm,
width=40,
textvariable=self.querytemplate_svar)
self.querytemplate_entry.bind('<Return>', self.set_templates_query)
self.querytemplate_entry.pack(side='top', anchor='w')
self.templates_query = \
Tkinter.Radiobutton(self.options_frm,
text="query.ezt",
value="templates/query.ezt",
var=self.querytemplate_svar,
command=self.set_templates_query)
self.templates_query.pack(side='top', anchor='w')
# pack and set window manager hints:
self.server_frm.pack(side='top', fill='x')
self.options_frm.pack(side='top', fill='x')
self.window.update()
self.minwidth = self.window.winfo_width()
self.minheight = self.window.winfo_height()
self.expanded = 0
self.window.wm_geometry('%dx%d' % (self.minwidth, self.minheight))
self.window.wm_minsize(self.minwidth, self.minheight)
try:
import threading
except ImportError:
nogui("thread")
threading.Thread(target=serve, args=(host, port, self.ready)).start()
def toggle_use_cvsgraph(self, event=None):
cfg.options.use_cvsgraph = self.cvsgraph_ivar.get()
def toggle_use_localtime(self, event=None):
cfg.options.use_localtime = self.use_localtime_ivar.get()
def toggle_subdirmod(self, event=None):
cfg.options.show_subdir_lastmod = self.subdirmod_ivar.get()
def toggle_useresearch(self, event=None):
cfg.options.use_re_search = self.useresearch_ivar.get()
def set_log_pagesize(self, event=None):
cfg.options.log_pagesize = self.log_pagesize_ivar.get()
def set_dir_pagesize(self, event=None):
cfg.options.dir_pagesize = self.dir_pagesize_ivar.get()
def set_templates_log(self, event=None):
cfg.templates.log = self.logtemplate_svar.get()
def set_templates_directory(self, event=None):
cfg.templates.directory = self.dirtemplate_svar.get()
def set_templates_query(self, event=None):
cfg.templates.query = self.querytemplate_svar.get()
def ready(self, server):
"""used as callback parameter to the serve() function"""
self.server = server
self.title_lbl.config(text='ViewVC standalone server at\n' + server.url)
self.open_btn.config(state='normal')
self.quit_btn.config(state='normal')
def open(self, event=None, url=None):
"""opens a browser window on the local machine"""
url = url or self.server.url
try:
import webbrowser
webbrowser.open(url)
except ImportError: # pre-webbrowser.py compatibility
if sys.platform == 'win32':
os.system('start "%s"' % url)
elif sys.platform == 'mac':
try:
import ic
ic.launchurl(url)
except ImportError: pass
else:
rc = os.system('netscape -remote "openURL(%s)" &' % url)
if rc:
os.system('netscape "%s" &' % url)
def quit(self, event=None):
if self.server:
self.server.quit = 1
self.window.quit()
import Tkinter
try:
gui = GUI(Tkinter.Tk(), host, port)
Tkinter.mainloop()
except KeyboardInterrupt:
pass
# --- command-line interface: ----------------------------------------------
def usage():
clean_options = Options()
cmd = os.path.basename(sys.argv[0])
port = clean_options.port
host = clean_options.host
script_alias = clean_options.script_alias
sys.stderr.write("""Usage: %(cmd)s [OPTIONS]
Run a simple, standalone HTTP server configured to serve up ViewVC requests.
Options:
--config-file=FILE (-c) Read configuration options from FILE. If not
specified, ViewVC will look for a configuration
file in its installation tree, falling back to
built-in default values. (Not valid in GUI mode.)
--daemon (-d) Background the server process.
--gui (-g) Pop up a graphical configuration interface.
Requires a valid X11 display connection.
--help Show this usage message and exit.
--host=HOSTNAME (-h) Listen on HOSTNAME. Required for access from a
remote machine. [default: %(host)s]
--htpasswd-file=FILE Authenticate incoming requests, validating against
against FILE, which is an Apache HTTP Server
htpasswd file. (CRYPT only; no DIGEST support.)
--port=PORT (-p) Listen on PORT. [default: %(port)d]
--repository=PATH (-r) Serve the Subversion or CVS repository located
at PATH. This option may be used more than once.
--script-alias=PATH (-s) Use PATH as the virtual script location (similar
to Apache HTTP Server's ScriptAlias directive).
For example, "--script-alias=repo/view" will serve
ViewVC at "http://HOSTNAME:PORT/repo/view".
[default: %(script_alias)s]
""" % locals())
sys.exit(0)
def badusage(errstr):
cmd = os.path.basename(sys.argv[0])
sys.stderr.write("ERROR: %s\n\n"
"Try '%s --help' for detailed usage information.\n"
% (errstr, cmd))
sys.exit(1)
def main(argv):
"""Command-line interface (looks at argv to decide what to do)."""
import getopt
short_opts = string.join(['c:',
'd',
'g',
'h:',
'p:',
'r:',
's:',
], '')
long_opts = ['daemon',
'config-file=',
'gui',
'help',
'host=',
'htpasswd-file=',
'port=',
'repository=',
'script-alias=',
]
opt_daemon = 0
opt_gui = 0
opt_host = None
opt_port = None
opt_htpasswd_file = None
opt_config_file = None
opt_script_alias = None
opt_repositories = []
# Parse command-line options.
try:
opts, args = getopt.getopt(argv[1:], short_opts, long_opts)
for opt, val in opts:
if opt in ['--help']:
usage()
elif opt in ['-g', '--gui']:
opt_gui = 1
elif opt in ['-r', '--repository']: # may be used more than once
opt_repositories.append(val)
elif opt in ['-d', '--daemon']:
opt_daemon = 1
elif opt in ['-p', '--port']:
opt_port = val
elif opt in ['-h', '--host']:
opt_host = val
elif opt in ['-s', '--script-alias']:
opt_script_alias = val
elif opt in ['-c', '--config-file']:
opt_config_file = val
elif opt in ['--htpasswd-file']:
opt_htpasswd_file = val
except getopt.error, err:
badusage(str(err))
# Validate options that need validating.
class BadUsage(Exception): pass
try:
if opt_port is not None:
try:
options.port = int(opt_port)
except ValueError:
raise BadUsage("Port '%s' is not a valid port number" % (opt_port))
if not options.port:
raise BadUsage("You must supply a valid port.")
if opt_htpasswd_file is not None:
if not os.path.isfile(opt_htpasswd_file):
raise BadUsage("'%s' does not appear to be a valid htpasswd file."
% (opt_htpasswd_file))
if not has_crypt:
raise BadUsage("Unable to locate suitable `crypt' module for use "
"with --htpasswd-file option. If your Python "
"distribution does not include this module (as is "
"the case on many non-Unix platforms), consider "
"installing the `fcrypt' module instead (see "
"http://carey.geek.nz/code/python-fcrypt/).")
options.htpasswd_file = opt_htpasswd_file
if opt_config_file is not None:
if not os.path.isfile(opt_config_file):
raise BadUsage("'%s' does not appear to be a valid configuration file."
% (opt_config_file))
options.config_file = opt_config_file
if opt_host is not None:
options.host = opt_host
if opt_script_alias is not None:
options.script_alias = string.join(filter(None,
string.split(opt_script_alias,
'/')),
'/')
for repository in opt_repositories:
if not options.repositories.has_key('Development'):
rootname = 'Development'
else:
rootname = 'Repository%d' % (len(options.repositories.keys()) + 1)
options.repositories[rootname] = repository
except BadUsage, err:
badusage(str(err))
# Fork if we're in daemon mode.
if opt_daemon:
pid = os.fork()
if pid != 0:
sys.exit()
# Finaly, start the server.
if opt_gui:
gui(options.host, options.port)
else:
def ready(server):
print 'server ready at %s%s' % (server.url, options.script_alias)
serve(options.host, options.port, ready)
if __name__ == '__main__':
options = Options()
main(sys.argv)

368
bin/svndbadmin Executable file
View File

@@ -0,0 +1,368 @@
#!/usr/bin/env python
# -*-python-*-
#
# Copyright (C) 2004-2008 The ViewCVS Group. All Rights Reserved.
# Copyright (C) 2004-2007 James Henstridge
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# administrative program for loading Subversion revision information
# into the checkin database. It can be used to add a single revision
# to the database, or rebuild/update all revisions.
#
# To add all the checkins from a Subversion repository to the checkin
# database, run the following:
# /path/to/svndbadmin rebuild /path/to/repo
#
# This script can also be called from the Subversion post-commit hook,
# something like this:
# REPOS="$1"
# REV="$2"
# /path/to/svndbadmin update "$REPOS" "$REV"
#
# If you allow changes to revision properties in your repository, you
# might also want to set up something similar in the
# post-revprop-change hook using "update" with the --force option to
# keep the checkin database consistent with the repository.
#
# -----------------------------------------------------------------------
#
#########################################################################
#
# INSTALL-TIME CONFIGURATION
#
# These values will be set during the installation process. During
# development, they will remain None.
#
LIBRARY_DIR = None
CONF_PATHNAME = None
# Adjust sys.path to include our library directory
import sys
import os
if LIBRARY_DIR:
sys.path.insert(0, LIBRARY_DIR)
else:
sys.path.insert(0, os.path.abspath(os.path.join(sys.argv[0], "../../lib")))
#########################################################################
import os
import string
import re
import svn.core
import svn.repos
import svn.fs
import svn.delta
import cvsdb
import viewvc
import vclib
class SvnRepo:
"""Class used to manage a connection to a SVN repository."""
def __init__(self, path):
self.path = path
self.repo = svn.repos.svn_repos_open(path)
self.fs = svn.repos.svn_repos_fs(self.repo)
self.rev_max = svn.fs.youngest_rev(self.fs)
def __getitem__(self, rev):
if rev is None:
rev = self.rev_max
elif rev < 0:
rev = rev + self.rev_max + 1
assert 0 <= rev <= self.rev_max
rev = SvnRev(self, rev)
return rev
_re_diff_change_command = re.compile('(\d+)(?:,(\d+))?([acd])(\d+)(?:,(\d+))?')
def _get_diff_counts(diff_fp):
"""Calculate the plus/minus counts by parsing the output of a
normal diff. The reasons for choosing Normal diff format are:
- the output is short, so should be quicker to parse.
- only the change commands need be parsed to calculate the counts.
- All file data is prefixed, so won't be mistaken for a change
command.
This code is based on the description of the format found in the
GNU diff manual."""
plus, minus = 0, 0
line = diff_fp.readline()
while line:
match = re.match(_re_diff_change_command, line)
if match:
# size of first range
if match.group(2):
count1 = int(match.group(2)) - int(match.group(1)) + 1
else:
count1 = 1
cmd = match.group(3)
# size of second range
if match.group(5):
count2 = int(match.group(5)) - int(match.group(4)) + 1
else:
count2 = 1
if cmd == 'a':
# LaR - insert after line L of file1 range R of file2
plus = plus + count2
elif cmd == 'c':
# FcT - replace range F of file1 with range T of file2
minus = minus + count1
plus = plus + count2
elif cmd == 'd':
# RdL - remove range R of file1, which would have been
# at line L of file2
minus = minus + count1
line = diff_fp.readline()
return plus, minus
class SvnRev:
"""Class used to hold information about a particular revision of
the repository."""
def __init__(self, repo, rev):
self.repo = repo
self.rev = rev
self.rev_roots = {} # cache of revision roots
# revision properties ...
revprops = svn.fs.revision_proplist(repo.fs, rev)
self.author = str(revprops.get(svn.core.SVN_PROP_REVISION_AUTHOR,''))
self.date = str(revprops.get(svn.core.SVN_PROP_REVISION_DATE, ''))
self.log = str(revprops.get(svn.core.SVN_PROP_REVISION_LOG, ''))
# convert the date string to seconds since epoch ...
try:
self.date = svn.core.svn_time_from_cstring(self.date) / 1000000
except:
self.date = None
# get a root for the current revisions
fsroot = self._get_root_for_rev(rev)
# find changes in the revision
editor = svn.repos.RevisionChangeCollector(repo.fs, rev)
e_ptr, e_baton = svn.delta.make_editor(editor)
svn.repos.svn_repos_replay(fsroot, e_ptr, e_baton)
self.changes = []
for path, change in editor.changes.items():
# skip non-file changes
if change.item_kind != svn.core.svn_node_file:
continue
# deal with the change types we handle
base_root = None
if change.base_path:
base_root = self._get_root_for_rev(change.base_rev)
if not change.path:
action = 'remove'
elif change.added:
action = 'add'
else:
action = 'change'
diffobj = svn.fs.FileDiff(base_root and base_root or None,
base_root and change.base_path or None,
change.path and fsroot or None,
change.path and change.path or None)
diff_fp = diffobj.get_pipe()
plus, minus = _get_diff_counts(diff_fp)
self.changes.append((path, action, plus, minus))
def _get_root_for_rev(self, rev):
"""Fetch a revision root from a cache of such, or a fresh root
(which is then cached for later use."""
if not self.rev_roots.has_key(rev):
self.rev_roots[rev] = svn.fs.revision_root(self.repo.fs, rev)
return self.rev_roots[rev]
def handle_revision(db, command, repo, rev, verbose, force=0):
"""Adds a particular revision of the repository to the checkin database."""
revision = repo[rev]
committed = 0
if verbose: print "Building commit info for revision %d..." % (rev),
if not revision.changes:
if verbose: print "skipped (no changes)."
return
for (path, action, plus, minus) in revision.changes:
directory, file = os.path.split(path)
commit = cvsdb.CreateCommit()
commit.SetRepository(repo.path)
commit.SetDirectory(directory)
commit.SetFile(file)
commit.SetRevision(str(rev))
commit.SetAuthor(revision.author)
commit.SetDescription(revision.log)
commit.SetTime(revision.date)
commit.SetPlusCount(plus)
commit.SetMinusCount(minus)
commit.SetBranch(None)
if action == 'add':
commit.SetTypeAdd()
elif action == 'remove':
commit.SetTypeRemove()
elif action == 'change':
commit.SetTypeChange()
if command == 'update':
result = db.CheckCommit(commit)
if result and not force:
continue # already recorded
# commit to database
db.AddCommit(commit)
committed = 1
if verbose:
if committed:
print "done."
else:
print "skipped (already recorded)."
def main(command, repository, revs=[], verbose=0, force=0):
cfg = viewvc.load_config(CONF_PATHNAME)
db = cvsdb.ConnectDatabase(cfg)
# Purge what must be purged.
if command in ('rebuild', 'purge'):
if verbose:
print "Purging commit info for repository root `%s'" % repository
try:
db.PurgeRepository(repository)
except cvsdb.UnknownRepositoryError, e:
if command == 'purge':
sys.stderr.write("ERROR: " + str(e) + "\n")
sys.exit(1)
# Record what must be recorded.
if command in ('rebuild', 'update'):
if not os.path.exists(repository):
sys.stderr.write('ERROR: could not find repository %s\n'
% (repository))
sys.exit(1)
repo = SvnRepo(repository)
if command == 'rebuild' or (command == 'update' and not revs):
for rev in range(repo.rev_max+1):
handle_revision(db, command, repo, rev, verbose)
elif command == 'update':
if revs[0] is None:
revs[0] = repo.rev_max
if revs[1] is None:
revs[1] = repo.rev_max
revs.sort()
for rev in range(revs[0], revs[1]+1):
handle_revision(db, command, repo, rev, verbose, force)
def _rev2int(r):
if r == 'HEAD':
r = None
else:
r = int(r)
if r < 0:
raise ValueError, "invalid revision '%d'" % (r)
return r
def usage():
cmd = os.path.basename(sys.argv[0])
sys.stderr.write(
"""Administer the ViewVC checkins database data for the Subversion repository
located at REPOS-PATH.
Usage: 1. %s [-v] rebuild REPOS-PATH
2. %s [-v] update REPOS-PATH [REV[:REV2]] [--force]
3. %s [-v] purge REPOS-PATH
1. Rebuild the commit database information for the repository located
at REPOS-PATH across all revisions, after first purging
information specific to that repository (if any).
2. Update the commit database information for the repository located
at REPOS-PATH across all revisions or, optionally, only for the
specified revision REV (or revision range REV:REV2). This is just
like rebuilding, except that, unless --force is specified, no
commit information will be stored for commits already present in
the database. If a range is specified, the revisions will be
processed in ascending order, and you may specify "HEAD" to
indicate "the youngest revision currently in the repository".
3. Purge information specific to the repository located at REPOS-PATH
from the database.
Use the -v flag to cause this script to give progress information as it works.
""" % (cmd, cmd, cmd))
sys.exit(1)
if __name__ == '__main__':
verbose = 0
force = 0
args = sys.argv
try:
index = args.index('-v')
verbose = 1
del args[index]
except ValueError:
pass
try:
index = args.index('--force')
force = 1
del args[index]
except ValueError:
pass
if len(args) < 3:
usage()
command = string.lower(args[1])
if command not in ('rebuild', 'update', 'purge'):
sys.stderr.write('ERROR: unknown command %s\n' % command)
usage()
revs = []
if len(sys.argv) > 3:
if command == 'rebuild':
sys.stderr.write('ERROR: rebuild no longer accepts a revision '
'number argument. Usage update --force.')
usage()
elif command != 'update':
usage()
try:
revs = map(lambda x: _rev2int(x), sys.argv[3].split(':'))
if len(revs) > 2:
raise ValueError, "too many revisions in range"
if len(revs) == 1:
revs.append(revs[0])
except ValueError:
sys.stderr.write('ERROR: invalid revision specification "%s"\n' \
% sys.argv[3])
usage()
else:
rev = None
try:
repository = vclib.svn.canonicalize_rootpath(args[2])
repository = cvsdb.CleanRepository(os.path.abspath(repository))
main(command, repository, revs, verbose, force)
except KeyboardInterrupt:
print
print '** break **'
sys.exit(0)

54
bin/wsgi/query.fcgi Normal file
View File

@@ -0,0 +1,54 @@
#!/usr/bin/python
# -*-python-*-
#
# Copyright (C) 1999-2010 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# viewvc: View CVS/SVN repositories via a web browser
#
# -----------------------------------------------------------------------
#
# This is a fcgi entry point for the query ViewVC app. It's appropriate
# for use with mod_fcgid and flup. It defines a single application function
# that is a valid fcgi entry point.
#
# mod_fcgid: http://httpd.apache.org/mod_fcgid/
# flup:
# http://pypi.python.org/pypi/flup
# http://trac.saddi.com/flup
#
# -----------------------------------------------------------------------
import sys, os
LIBRARY_DIR = None
CONF_PATHNAME = None
if LIBRARY_DIR:
sys.path.insert(0, LIBRARY_DIR)
else:
sys.path.insert(0, os.path.abspath(os.path.join(sys.argv[0],
"../../../lib")))
import sapi
import viewvc
import query
from flup.server import fcgi
def application(environ, start_response):
server = sapi.WsgiServer(environ, start_response)
cfg = viewvc.load_config(CONF_PATHNAME, server)
viewvc_base_url = cfg.query.viewvc_base_url
if viewvc_base_url is None:
viewvc_base_url = "viewvc.fcgi"
query.main(server, cfg, viewvc_base_url)
return []
fcgi.WSGIServer(application).run()

45
bin/wsgi/query.wsgi Normal file
View File

@@ -0,0 +1,45 @@
# -*-python-*-
#
# Copyright (C) 1999-2010 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# viewvc: View CVS/SVN repositories via a web browser
#
# -----------------------------------------------------------------------
#
# This is a wsgi entry point for the query ViewVC app. It's appropriate
# for use with mod_wsgi. It defines a single application function that
# is a valid wsgi entry point.
#
# -----------------------------------------------------------------------
import sys, os
LIBRARY_DIR = None
CONF_PATHNAME = None
if LIBRARY_DIR:
sys.path.insert(0, LIBRARY_DIR)
else:
sys.path.insert(0, os.path.abspath(os.path.join(sys.argv[0],
"../../../lib")))
import sapi
import viewvc
import query
def application(environ, start_response):
server = sapi.WsgiServer(environ, start_response)
cfg = viewvc.load_config(CONF_PATHNAME, server)
viewvc_base_url = cfg.query.viewvc_base_url
if viewvc_base_url is None:
viewvc_base_url = "viewvc.wsgi"
query.main(server, cfg, viewvc_base_url)
return []

50
bin/wsgi/viewvc.fcgi Normal file
View File

@@ -0,0 +1,50 @@
#!/usr/bin/python
# -*-python-*-
#
# Copyright (C) 1999-2010 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# viewvc: View CVS/SVN repositories via a web browser
#
# -----------------------------------------------------------------------
#
# This is a fcgi entry point for the main ViewVC app. It's appropriate
# for use with mod_fcgid and flup. It defines a single application function
# that is a valid fcgi entry point.
#
# mod_fcgid: http://httpd.apache.org/mod_fcgid/
# flup:
# http://pypi.python.org/pypi/flup
# http://trac.saddi.com/flup
#
# -----------------------------------------------------------------------
import sys, os
LIBRARY_DIR = None
CONF_PATHNAME = None
if LIBRARY_DIR:
sys.path.insert(0, LIBRARY_DIR)
else:
sys.path.insert(0, os.path.abspath(os.path.join(sys.argv[0],
"../../../lib")))
import sapi
import viewvc
from flup.server import fcgi
def application(environ, start_response):
server = sapi.WsgiServer(environ, start_response)
cfg = viewvc.load_config(CONF_PATHNAME, server)
viewvc.main(server, cfg)
return []
fcgi.WSGIServer(application).run()

41
bin/wsgi/viewvc.wsgi Normal file
View File

@@ -0,0 +1,41 @@
# -*-python-*-
#
# Copyright (C) 1999-2009 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# viewvc: View CVS/SVN repositories via a web browser
#
# -----------------------------------------------------------------------
#
# This is a wsgi entry point for the main ViewVC app. It's appropriate
# for use with mod_wsgi. It defines a single application function that
# is a valid wsgi entry point.
#
# -----------------------------------------------------------------------
import sys, os
LIBRARY_DIR = None
CONF_PATHNAME = None
if LIBRARY_DIR:
sys.path.insert(0, LIBRARY_DIR)
else:
sys.path.insert(0, os.path.abspath(os.path.join(sys.argv[0],
"../../../lib")))
import sapi
import viewvc
def application(environ, start_response):
server = sapi.WsgiServer(environ, start_response)
cfg = viewvc.load_config(CONF_PATHNAME, server)
viewvc.main(server, cfg)
return []

File diff suppressed because it is too large Load Diff

View File

@@ -1,371 +0,0 @@
#---------------------------------------------------------------------------
#
# Configuration file for ViewCVS
#
# Information on ViewCVS is located at the following web site:
# http://www.lyra.org/greg/python/viewcvs/
#
#---------------------------------------------------------------------------
#
# BASIC CONFIGURATION
#
# For correct operation, you will probably need to change the following
# configuration variables:
#
# cvs_roots
# default_root
# rcs_path
# mime_types_file
#
# It is usually desirable to change the following variables:
#
# address
# main_title
# logo
# forbidden
#
# long_intro
# repository_info
#
# For Python source colorization:
#
# py2html_path
#
# If your icons are in a special location:
#
# icons
#
#
# FORMAT INFORMATION
#
# This file is delineated by sections, specified in [brackets]. Within each
# section, are a number of configuration settings. These settings take the
# form of: name = value. Values may be continued on the following line by
# indenting the continued line.
#
# WARNING: indentation *always* means continuation. name=value lines should
# always start in column zero.
#
# Comments should always start in column zero, and are identified with "#".
#
# Certain configuration settings may have multiple values. These should be
# separated by a comma. The settings where this is allowed are noted below.
#
# Any other setting that requires special syntax is noted at that setting.
#
#---------------------------------------------------------------------------
[general]
#
# This setting specifies each of the CVS roots on your system and assigns
# names to them. Each root should be given by a "name: path" value. Multiple
# roots should be separated by commas.
#
cvs_roots =
Development : /home/cvsroot
# this is the name of the default CVS root.
default_root = Development
# uncomment if the RCS binaries are not on the standard path
# NOTE: the trailing slash is required!
#rcs_path = /usr/bin/
#
# This is a pathname to a MIME types file to help viewcvs to guess the
# correct MIME type on checkout.
#
# If you are having problems with the default guess on the MIME type, then
# uncomment this option and point it at a MIME type file.
#
# For example, you can use the mime.types from apache here:
#mime_types_file = /usr/local/apache/conf/mime.types
# This address is shown in the footer. It should contain the CVS maintainer.
address = <a href="mailto:gstein@lyra.org">gstein@lyra.org</a>
# this title is used on the main entry page
main_title = CVS Repository
#
# This should contain a list of modules in the repository that should not be
# displayed (by default or by explicit path specification).
#
forbidden =
# forbidden = example
# forbidden = example1, example2
#---------------------------------------------------------------------------
[images]
#
# All images are defined with three values: URL, WIDTH, HEIGHT
#
# this logo will appear on the page
logo = /icons/apache_pb.gif, 259, 32
#
# these icons represent a back-pointer, a directory (folder), and a file.
# they are normally available in a standard Apache distribution, along
# with larger versions if these are too small for you.
#
back_icon = /icons/small/back.gif, 16, 16
dir_icon = /icons/small/dir.gif, 16, 16
file_icon = /icons/small/text.gif, 16, 16
#---------------------------------------------------------------------------
[colors]
# background color of log entry in markup
markup_log = #ffffff
# color of change-section headings in a diff
diff_heading = #99cccc
# color of "empty" lines
diff_empty = #cccccc
# removed lines
diff_remove = #ff9999
# changed lines
diff_change = #99ff99
# added lines
diff_add = #ccccff
# empty lines in a change block (one part smaller than the other)
diff_dark_change = #99cc99
# even/odd row colors
even_odd = #ccccee, #ffffff
# navigation header (in diff screen, file view, annotation, etc)
nav_header = #9999ee
# color of text on most pages
text = #000000
# color of standard background
background = #ffffff
# color of alternate background (diffs, file view, annotations, etc)
alt_background = #eeeeee
# table header colors (normal and the sorted-by column)
column_header_normal = #cccccc
column_header_sorted = #88ff88
# Uncomment the following line for colored borders in tables
#table_border = #999999
#---------------------------------------------------------------------------
[text]
#
# WARNING: if you continue the text onto multiple lines, then make SURE that
# you indent the continuations.
#
short_intro =
<p>
Click on a directory to enter that directory. Click on a file to display
its revision history and to get a chance to display diffs between
revisions.
</p>
long_intro =
<p>
This is a WWW interface for CVS Repositories.
You can browse the file hierarchy by picking directories
(which have slashes after them, <i>e.g.</i>, <b>src/</b>).
If you pick a file, you will see the revision history
for that file.
Selecting a revision number will download that revision of
the file. There is a link at each revision to display
diffs between that revision and the previous one, and
a form at the bottom of the page that allows you to
display diffs between arbitrary revisions.
</p>
<p>
This script
(<a href="http://www.lyra.org/greg/python/viewcvs/">ViewCVS</a>)
has been written by Greg Stein
&lt;<a href="mailto:gstein@lyra.org">gstein@lyra.org</a>&gt;
based on the
<a href="http://linux.fh-heilbronn.de/~zeller/cgi/cvsweb.cgi">cvsweb</a>
script by Henner Zeller
&lt;<a href="mailto:zeller@think.de">zeller@think.de</a>&gt;;
it is covered by the
<a href="http://www.opensource.org/licenses/bsd-license.html">BSD
Licence</a>.
If you would like to use this CGI script on your own web server and
CVS tree, see Greg's
<a href="http://www.lyra.org/greg/python/viewcvs/">ViewCVS distribution
site</a>.
Please send any suggestions, comments, etc. to
<a href="mailto:gstein@lyra.org">Greg Stein</a>.
</p>
doc_info =
<h3>CVS Documentation</h3>
<blockquote>
<p>
<a href="http://www.loria.fr/~molli/cvs/doc/cvs_toc.html">CVS
User's Guide</a><br>
<a href="http://www.arc.unm.edu/~rsahu/cvs.html">CVS Tutorial</a><br>
<a href="http://cellworks.washington.edu/pub/docs/cvs/tutorial/cvs_tutorial_1.html">Another CVS tutorial</a><br>
<a href="http://www.csc.calpoly.edu/~dbutler/tutorials/winter96/cvs/">Yet
another CVS tutorial (a little old, but nice)</a><br>
<a href="http://www.cs.utah.edu/dept/old/texinfo/cvs/FAQ.txt">An old but
very useful FAQ about CVS</a>
</p>
</blockquote>
repository_info =
<!-- insert repository access instructions here -->
#---------------------------------------------------------------------------
[options]
### DOC
# sort_by: File sort order
# file Sort by filename
# rev Sort by revision number
# date Sort by commit date
# author Sort by author
# log Sort by log message
sort_by = file
# hide_attic: Hide or show files in Attic
# 1 Hide files in Attic
# 0 Show files in Attic
hide_attic = 1
# log_sort: Sort order for CVS logs
# date Sort revisions by date
# rev Sort revision by revision number
# cvs Don't sort them. Same order as CVS/RCS shows them.
log_sort = date
# diff_format: Default diff format
# h Human readable
# u Unified diff
# c Context diff
# s Side by side
# H Long human readable
diff_format = h
# hide_cvsroot: Don't show the CVSROOT directory
# 1 Hide CVSROOT directory
# 0 Show CVSROOT directory
hide_cvsroot = 1
# hide_non_readable: Don't show entries which cannot be read
# 1 Hide non-readable entries
# 0 Show non-readble entries
hide_non_readable = 1
# Show author of last change
show_author = 1
# set to 1 to make lines break at spaces,
# set to 0 to make no-break lines,
# set to a positive integer to make the lines cut at that length
hr_breakable = 1
# give out function names in human readable diffs
# this just makes sense if we have C-files, otherwise
# diff's heuristic doesn't work well ..
# ( '-p' option to diff)
hr_funout = 0
# ignore whitespaces for human readable diffs
# (indendation and stuff ..)
# ( '-w' option to diff)
hr_ignore_white = 1
# ignore diffs which are caused by
# keyword-substitution like $Id - Stuff
# ( '-kk' option to rcsdiff)
hr_ignore_keyword_subst = 1
# allow annotation of files.
# NOTE: this requires rw-access to the CVSROOT/history file, and rw-access to
# the subdirectory to place the lock... so you maybe don't want it
# WARNING: this is not yet implemented!!
allow_annotate = 0
# allow pretty-printed version of files
allow_markup = 1
# allow compression with gzip of output if the Browser accepts it
# (HTTP_ACCEPT_ENCODING=gzip)
# [make sure to have gzip in the path]
allow_compress = 1
# Make use of javascript functions to skip the need for submitting a form.
# For example, this way you can select one of your CVS roots without
# pressing 'Go' (... if you have more than one CVSROOT defined)
use_java_script = 1
# open Download-Links in another window
open_extern_window = 1
# The size of this extern window; this size option needs use_java_script
# to be defined
extern_window_width = 600
extern_window_height = 440
# If you have files which automatically refers to other files
# (such as HTML) then this allows you to browse the checked
# out files as if outside CVS.
checkout_magic = 1
# Show last changelog message for sub directories
# The current implementation makes many assumptions and may show the
# incorrect file at some times. The main assumption is that the last
# modified file has the newest filedate. But some CVS operations
# touches the file without even when a new version is't checked in,
# and TAG based browsing essientially puts this out of order, unless
# the last checkin was on the same tag as you are viewing.
# Enable this if you like the feature, but don't rely on correct results.
show_subdir_lastmod = 0
# show a portion of the most recent log entry in directory listings
show_logs = 1
# Show CVS log when viewing file contents
show_log_in_markup = 1
# == Configuration defaults ==
# Defaults for configuration variables that shouldn't need
# to be configured..
allow_version_select = 1
#
# If you want to use Marc-Andrew Lemburg's py2html (and Just van Rossum's
# PyFontify) to colorize Python files, then you may need to change this
# variable to point to their directory location.
#
# This directory AND the standard Python path will be searched.
#
py2html_path = .
#py2html_path = /usr/local/lib/python1.5/site-python
# the length to which the most recent log entry should be truncated when
# shown in the directory view
short_log_len = 80
table_padding = 2
diff_font_face = Helvetica,Arial
diff_font_size = -1
# the width of the textinput in the request-diff-form
input_text_size = 12
#---------------------------------------------------------------------------

394
conf/cvsgraph.conf.dist Normal file
View File

@@ -0,0 +1,394 @@
# CvsGraph configuration
#
# - Empty lines and whitespace are ignored.
#
# - Comments start with '#' and everything until
# end of line is ignored.
#
# - Strings are C-style strings in which characters
# may be escaped with '\' and written in octal
# and hex escapes. Note that '\' must be escaped
# if it is to be entered as a character.
#
# - Some strings are expanded with printf like
# conversions which start with '%'. Not all
# are applicable at all times, in which case they
# will expand to nothing.
# %c = cvsroot (with trailing '/')
# %C = cvsroot (*without* trailing '/')
# %m = module (with trailing '/')
# %M = module (*without* trailing '/')
# %f = filename without path
# %F = filename without path and with ",v" stripped
# %p = path part of filename (with trailing '/')
# %r = number of revisions
# %b = number of branches
# %% = '%'
# %R = the revision number (e.g. '1.2.4.4')
# %P = previous revision number
# %B = the branch number (e.g. '1.2.4')
# %d = date of revision
# %a = author of revision
# %s = state of revision
# %t = current tag of branch or revision
# %0..%9 = command-line argument -0 .. -9
# %l = HTMLized log entry of the revision
# NOTE: %l is obsolete. See %(%) and cvsgraph.conf(5) for
# more details.
# %L = log entry of revision
# The log entry expansion takes an optional argument to
# specify maximum length of the expansion like %L[25].
# %(...%) = HTMLize the string within the parenthesis.
# ViewVC currently uses the following four command-line arguments to
# pass URL information to cvsgraph:
# -3 link to current file's log page
# -4 link to current file's checkout page minus "rev" parameter
# -5 link to current file's diff page minus "r1" and "r2" parameters
# -6 link to current directory page minus "pathrev" parameter
#
# - Numbers may be entered as octal, decimal or
# hex as in 0117, 79 and 0x4f respectively.
#
# - Fonts are numbered 0..4 (defined as in libgd)
# 0 = tiny
# 1 = small
# 2 = medium (bold)
# 3 = large
# 4 = giant
#
# - Colors are a string like HTML type colors in
# the form "#rrggbb" with parts written in hex
# rr = red (00..ff)
# gg = green (00-ff)
# bb = blue (00-ff)
#
# - There are several reserved words besides of the
# feature-keywords. These additional reserved words
# expand to numerical values:
# * false = 0
# * true = 1
# * not = -1
# * left = 0
# * center = 1
# * right = 2
# * gif = 0
# * png = 1
# * jpeg = 2
# * tiny = 0
# * small = 1
# * medium = 2
# * large = 3
# * giant = 4
#
# - Booleans have three possible arguments: true, false
# and not. `Not' means inverse of what it was (logical
# negation) and is represented by the value -1.
# For the configuration file that means that the default
# value is negated.
#
# cvsroot <string>
# The *absolute* base directory where the
# CVS/RCS repository can be found
# cvsmodule <string>
#
cvsroot = "--unused--"; # unused with ViewVC, will be overridden
cvsmodule = ""; # unused with ViewVC -- please leave it blank
# color_bg <color>
# The background color of the image
# transparent_bg <boolean>
# Make color_bg the transparent color (only useful with PNG)
color_bg = "#ffffff";
transparent_bg = false;
# date_format <string>
# The strftime(3) format string for date and time
date_format = "%d-%b-%Y %H:%M:%S";
# box_shadow <boolean>
# Add a shadow around the boxes
# upside_down <boolean>
# Reverse the order of the revisions
# left_right <boolean>
# Draw the image left to right instead of top down,
# or right to left is upside_down is set simultaneously.
# strip_untagged <boolean>
# Remove all untagged revisions except the first, last and tagged ones
# strip_first_rev <boolean>
# Also remove the first revision if untagged
# auto_stretch <boolean>
# Try to reformat the tree to minimize image size
# use_ttf <boolean>
# Use TrueType fonts for text
# anti_alias <boolean>
# Enable pretty TrueType anti-alias drawing
# thick_lines <number>
# Draw all connector lines thicker (range: 1..11)
box_shadow = true;
upside_down = false;
left_right = false;
strip_untagged = false;
strip_first_rev = false;
#auto_stretch = true; # not yet stable.
use_ttf = false;
anti_alias = true;
thick_lines = 1;
# msg_color <color>
# Sets the error/warning message color
# msg_font <number>
# msg_ttfont <string>
# msg_ttsize <float>
# Sets the error/warning message font
msg_color = "#800000";
msg_font = medium;
msg_ttfont = "/dos/windows/fonts/ariali.ttf";
msg_ttsize = 11.0;
# parse_logs <boolean>
# Enable the parsing of the *entire* ,v file to read the
# log-entries between revisions. This is necessary for
# the %L expansion to work, but slows down parsing by
# a very large factor. You're warned.
parse_logs = false;
# tag_font <number>
# The font of the tag text
# tag_color <color>
# The color of the tag text
# tag_ignore <string>
# A extended regular expression to exclude certain tags from view.
# See regex(7) for details on the format.
# Note 1: tags matched in merge_from/merge_to are always displayed unless
# tag_ignore_merge is set to true.
# Note 2: normal string rules apply and special characters must be
# escaped.
# tag_ignore_merge <boolean>
# If set to true, allows tag_ignore to also hide merge_from and merge_to
# tags.
# tag_nocase <boolean>
# Ignore the case is tag_ignore expressions
# tag_negate <boolean>
# Negate the matching criteria of tag_ignore. When true, only matching
# tags will be shown.
# Note: tags matched with merge_from/merge_to will still be displayed.
tag_font = medium;
#tag_ttfont = "/dos/windows/fonts/ariali.ttf";
#tag_ttsize = 11.0;
tag_color = "#007000";
#tag_ignore = "(test|alpha)_release";
#tag_ignore_merge = false;
#tag_nocase = false;
#tag_negate = false;
# rev_hidenumber <boolean>
# If set to true no revision numbers will be printed in the graph.
#rev_hidenumber = false;
rev_font = giant;
#rev_ttfont = "/dos/windows/fonts/arial.ttf";
#rev_ttsize = 12.0;
rev_color = "#000000";
rev_bgcolor = "#f0f0f0";
rev_separator = 1;
rev_minline = 15;
rev_maxline = 75;
rev_lspace = 5;
rev_rspace = 5;
rev_tspace = 3;
rev_bspace = 3;
rev_text = "%d"; # or "%d\n%a, %s" for author and state too
rev_text_font = tiny;
#rev_text_ttfont = "/dos/windows/fonts/times.ttf";
#rev_text_ttsize = 9.0;
rev_text_color = "#500020";
rev_maxtags = 25;
# merge_color <color>
# The color of the line connecting merges
# merge_front <boolean>
# If true, draw the merge-lines on top if the image
# merge_nocase <boolean>
# Ignore case in regular expressions
# merge_from <string>
# A regex describing a tag that is used as the merge source
# merge_to <string>
# A regex describing a tag that is the target of the merge
# merge_findall <boolean>
# Try to match all merge_to targets possible. This can result in
# multiple lines originating from one tag.
# merge_arrows <boolean>
# Use arrows to point to the merge destination. Default is true.
# merge_cvsnt <boolean>
# Use CVSNT's mergepoint registration for merges
# merge_cvsnt_color <color>
# The color of the line connecting merges from/to registered
# mergepoints.
# arrow_width <number>
# arrow_length <number>
# Specify the size of the arrows. Default is 3 wide and 12 long.
#
# NOTE:
# - The merge_from is an extended regular expression as described in
# regex(7) and POSIX 1003.2 (see also Single Unix Specification at
# http://www.opengroup.com).
# - The merge_to is an extended regular expression with a twist. All
# subexpressions from the merge_from are expanded into merge_to
# using %[1-9] (in contrast to \[1-9] for backreferences). Care is
# taken to escape the constructed expression.
# - A '$' at the end of the merge_to expression can be important to
# prevent 'near match' references. Normally, you want the destination
# to be a good representation of the source. However, this depends
# on how well you defined the tags in the first place.
#
# Example:
# merge_from = "^f_(.*)";
# merge_to = "^t_%1$";
# tags: f_foo, f_bar, f_foobar, t_foo, t_bar
# result:
# f_foo -> "^t_foo$" -> t_foo
# f_bar -> "^t_bar$" -> t_bar
# f_foobar-> "^t_foobar$" -> <no match>
#
merge_color = "#a000a0";
merge_front = false;
merge_nocase = false;
merge_from = "^f_(.*)";
merge_to = "^t_%1$";
merge_findall = false;
#merge_arrows = true;
#arrow_width = 3;
#arrow_length = 12;
merge_cvsnt = true;
merge_cvsnt_color = "#606000";
# branch_font <number>
# The font of the number and tags
# branch_color <color>
# All branch element's color
# branch_[lrtb]space <number>
# Interior spacing (margin)
# branch_margin <number>
# Exterior spacing
# branch_connect <number>
# Length of the vertical connector
# branch_dupbox <boolean>
# Add the branch-tag also at the bottom/top of the trunk
# branch_fold <boolean>
# Fold empty branches in one box to save space
# branch_foldall <boolean>
# Put all empty branches in one box, even if they
# were interspaced with branches with revisions.
# branch_resort <boolean>
# Resort the branches by the number of revisions to save space
# branch_subtree <string>
# Only show the branch denoted or all branches that sprout
# from the denoted revision. The argument may be a symbolic
# tag. This option you would normally want to set from the
# command line with the -O option.
branch_font = medium;
#branch_ttfont = "/dos/windows/fonts/arialbd.ttf";
#branch_ttsize = 18.0;
branch_tag_color= "#000080";
branch_tag_font = medium;
#branch_tag_ttfont = "/dos/windows/fonts/arialbi.ttf";
#branch_tag_ttsize = 14.0;
branch_color = "#0000c0";
branch_bgcolor = "#ffffc0";
branch_lspace = 5;
branch_rspace = 5;
branch_tspace = 3;
branch_bspace = 3;
branch_margin = 15;
branch_connect = 8;
branch_dupbox = false;
branch_fold = true;
branch_foldall = false;
branch_resort = false;
#branch_subtree = "1.2.4";
# title <string>
# The title string is expanded (see above for details)
# title_[xy] <number>
# Position of title
# title_font <number>
# The font
# title_align <number>
# 0 = left
# 1 = center
# 2 = right
# title_color <color>
title = "%c%p%f\nRevisions: %r, Branches: %b";
title_x = 10;
title_y = 5;
title_font = small;
#title_ttfont = "/dos/windows/fonts/times.ttf";
#title_ttsize = 10.0;
title_align = left;
title_color = "#800000";
# Margins of the image
# Note: the title is outside the margin
margin_top = 35;
margin_bottom = 10;
margin_left = 10;
margin_right = 10;
# Image format(s)
# image_type <number|{gif,jpeg,png}>
# gif (0) = Create gif image
# png (1) = Create png image
# jpeg (2) = Create jpeg image
# Image types are available if they can be found in
# the gd library. Newer versions of gd do not have
# gif anymore. CvsGraph will automatically generate
# png images instead.
# image_quality <number>
# The quality of a jpeg image (1..100)
# image_compress <number>
# Set the compression of a PNG image (gd version >= 2.0.12).
# Values range from -1 to 9 where:
# - -1 default compression (usually 3)
# - 0 no compression
# - 1 lowest level compression
# - ... ...
# - 9 highest level of compression
# image_interlace <boolean>
# Write interlaces PNG/JPEG images for progressive loading.
image_type = png;
image_quality = 75;
image_compress = 3;
image_interlace = true;
# HTML image map generation
# map_name <string>
# The name= attribute in <map name="mapname">...</map>
# map_branch_href <string>
# map_branch_alt <string>
# map_rev_href <string>
# map_rev_alt <string>
# map_diff_href <string>
# map_diff_alt <string>
# map_merge_href <string>
# map_merge_alt <string>
# These are the href= and alt= attributes in the <area>
# tags of HTML. The strings are expanded (see above).
map_name = "MyMapName\" name=\"MyMapName";
map_branch_href = "href=\"%6pathrev=%(%t%)\"";
map_branch_alt = "alt=\"%0 %(%t%) (%B)\"";
# You might want to experiment with the following setting:
# 1. The default setting will take you to a ViewVC generated page displaying
# that revision of the file, if you click into a revision box:
map_rev_href = "href=\"%4rev=%R\"";
# 2. This alternative setting will take you to the anchor representing this
# revision on a ViewVC generated Log page for that file:
# map_rev_href = "href=\"%3#rev%R\"";
#
map_rev_alt = "alt=\"%1 %(%t%) (%R)\"";
map_diff_href = "href=\"%5r1=%P&amp;r2=%R\"";
map_diff_alt = "alt=\"%2 %P &lt;-&gt; %R\"";
map_merge_href = "href=\"%5r1=%P&amp;r2=%R\"";
map_merge_alt = "alt=\"%2 %P &lt;-&gt; %R\"";

32
conf/mimetypes.conf.dist Normal file
View File

@@ -0,0 +1,32 @@
#---------------------------------------------------------------------------
#
# MIME type mapping file for ViewVC
#
# Information on ViewVC is located at the following web site:
# http://viewvc.org/
#
#---------------------------------------------------------------------------
# THE FORMAT OF THIS FILE
#
# This file contains records -- one per line -- of the following format:
#
# MIME_TYPE [EXTENSION [EXTENSION ...]]
#
# where whitespace separates the MIME_TYPE from the EXTENSION(s),
# and the EXTENSIONs from each other.
#
# For example:
#
# text/x-csh csh
# text/x-csrc c
# text/x-diff diff patch
# image/png png
# image/jpeg jpeg jpg jpe
#
# By default, this file is left empty, allowing ViewVC to continue
# consulting it first without overriding the MIME type mappings
# found in more standard mapping files (such as those provided as
# part of the operating system or web server software).
#
#

1127
conf/viewvc.conf.dist Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1770
docs/upgrading-howto.html Normal file

File diff suppressed because it is too large Load Diff

1482
docs/url-reference.html Normal file

File diff suppressed because it is too large Load Diff

54
elemx/Makefile Normal file
View File

@@ -0,0 +1,54 @@
TARGETS = python/elx-python java/elx-java
all : $(TARGETS)
CFLAGS = -g -Wpointer-arith -Wwrite-strings -Wshadow -Wall
CPPFLAGS = -Ipython -Ijava -I.
# the scanner depends on tokens generated from python.y
python/scanner.c : python/python.c
# the keywords also need the tokens in python.h
python/py_keywords.c : python/python.c
# we need the scanner tokens in py_scan.h and keywords in py_keywords.h
python/elx-python.o : python/elx-python.c python/py_keywords.c
# we need java.[ch] generated first to get the tokens in java.h
java/j_scan.c : java/java.c java/j_keywords.c
# the keywords also need the tokens in java.h
java/j_keywords.c : java/java.c
# we need the scanner tokens in j_scan.h and keywords in j_keywords.h
java/elx-java.o : java/elx-java.c java/j_keywords.c java/java.c
python/elx-python : python/elx-python.o python/scanner.o python/python.o \
python/py_keywords.o elx-common.o
$(CC) -o $@ $^
java/elx-java : java/elx-java.o java/j_scan.o java/java.o java/j_keywords.o \
elx-common.o
$(CC) -o $@ $^
clean :
rm -f *.o
rm -f python/*.o python/python.[ch] python/py_keywords.[ch]
rm -f java/*.o java/java.[ch] java/j_keywords.[ch] java/j_scan.[ch]
rm -f python/*.output java/*.output
rm -f $(TARGETS)
.SUFFIXES:
.SUFFIXES: .c .y .shilka .o
%.c : %.y
@d="`echo $@ | sed 's/\.c//'`" ; \
echo msta -d -enum -v -o $$d $< ; \
msta -d -enum -v -o $$d $<
%.c : %.shilka
@d="`echo $@ | sed 's,/[^/]*$$,,'`" ; \
f="`echo $< | sed 's,.*/,,'`" ; \
echo shilka -length -no-definitions -interface $$f ; \
(cd $$d && shilka -length -no-definitions -interface $$f)

110
elemx/elx-common.c Normal file
View File

@@ -0,0 +1,110 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "elx.h"
#define ELX_ELEMS_EXT ".elx"
#define ELX_SYMBOLS_EXT ".els"
static void usage(const char *progname)
{
fprintf(stderr, "USAGE: %s FILENAME\n", progname);
exit(1);
}
static const char * build_one(const char *base, int len, const char *suffix)
{
int slen = strlen(suffix);
char *fn;
fn = malloc(len + slen + 1);
memcpy(fn, base, len);
memcpy(fn + len, suffix, slen);
fn[len + slen] = '\0';
return fn;
}
elx_context_t *elx_process_args(int argc, const char **argv)
{
elx_context_t *ec;
const char *input_fn;
const char *p;
int len;
/* ### in the future, we can expand this for more options */
if (argc != 2)
{
usage(argv[0]);
/* NOTREACHED */
}
input_fn = argv[1];
p = strrchr(input_fn, '.');
if (p == NULL)
len = strlen(input_fn);
else
len = p - argv[1];
ec = malloc(sizeof(*ec));
ec->input_fn = input_fn;
ec->elx_fn = build_one(input_fn, len, ELX_ELEMS_EXT);
ec->sym_fn = build_one(input_fn, len, ELX_SYMBOLS_EXT);
return ec;
}
void elx_open_files(elx_context_t *ec)
{
const char *fn;
const char *op;
if ((ec->input_fp = fopen(ec->input_fn, "r")) == NULL)
{
fn = ec->input_fn;
op = "reading";
goto error;
}
if ((ec->elx_fp = fopen(ec->elx_fn, "w")) == NULL)
{
fn = ec->elx_fn;
op = "writing";
goto error;
}
if ((ec->sym_fp = fopen(ec->sym_fn, "w")) == NULL)
{
fn = ec->sym_fn;
op = "writing";
goto error;
}
return;
error:
fprintf(stderr, "ERROR: file \"%s\" could not be opened for %s.\n %s\n",
fn, op, strerror(errno));
exit(2);
}
void elx_close_files(elx_context_t *ec)
{
fclose(ec->input_fp);
fclose(ec->elx_fp);
fclose(ec->sym_fp);
}
void elx_issue_token(elx_context_t *ec,
char which, int start, int len,
const char *symbol)
{
fprintf(ec->elx_fp, "%c %d %d\n", which, start, len);
if (ELX_DEFINES_SYM(which))
{
fprintf(ec->sym_fp, "%s %d %s\n", symbol, start, ec->input_fn);
}
}

54
elemx/elx.h Normal file
View File

@@ -0,0 +1,54 @@
#ifndef ELX_H
#define ELX_H
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define ELX_COMMENT 'C' /* a comment */
#define ELX_STRING 'S' /* a string constant */
#define ELX_KEYWORD 'K' /* a language keyword */
#define ELX_GLOBAL_FDEF 'F' /* function defn in global (visible) scope */
#define ELX_LOCAL_FDEF 'L' /* function defn in local (hidden) scope */
#define ELX_METHOD_DEF 'M' /* method definition */
#define ELX_FUNC_REF 'R' /* function reference / call */
#define ELX_DEFINES_SYM(c) ((c) == ELX_GLOBAL_FDEF || (c) == ELX_LOCAL_FDEF \
|| (c) == ELX_METHOD_DEF)
typedef struct
{
/* input filename */
const char *input_fn;
/* output filenames: element extractions, and symbols */
const char *elx_fn;
const char *sym_fn;
/* file pointers for each of the input/output files */
FILE *input_fp;
FILE *elx_fp;
FILE *sym_fp;
} elx_context_t;
elx_context_t *elx_process_args(int argc, const char **argv);
void elx_open_files(elx_context_t *ec);
void elx_close_files(elx_context_t *ec);
void elx_issue_token(elx_context_t *ec,
char which, int start, int len,
const char *symbol);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ELX_H */

121
elemx/elx_html.py Normal file
View File

@@ -0,0 +1,121 @@
#!/usr/bin/env python
#
# generate HTML given an input file and an element file
#
import re
import string
import cgi
import struct
_re_elem = re.compile('([a-zA-Z]) ([0-9]+) ([0-9]+)\n')
CHUNK_SIZE = 98304 # 4096*24
class ElemParser:
"Parse an elements file, extracting the token type, start, and length."
def __init__(self, efile):
self.efile = efile
def get(self):
line = self.efile.readline()
if not line:
return None, None, None
t, s, e = string.split(line)
return t, int(s)-1, int(e)
def unused_get(self):
record = self.efile.read(9)
if not record:
return None, None, None
return struct.unpack('>cii', record)
class Writer:
"Generate output, including copying from another input."
def __init__(self, ifile, ofile):
self.ifile = ifile
self.ofile = ofile
self.buf = ifile.read(CHUNK_SIZE)
self.offset = 0
def write(self, data):
self.ofile.write(data)
def copy(self, pos, amt):
"Copy 'amt' bytes from position 'pos' of input to output."
idx = pos - self.offset
self.ofile.write(cgi.escape(buffer(self.buf, idx, amt)))
amt = amt - (len(self.buf) - idx)
while amt > 0:
self._more()
self.ofile.write(cgi.escape(buffer(self.buf, 0, amt)))
amt = amt - len(self.buf)
def flush(self, pos):
"Flush the rest of the input to the output."
idx = pos - self.offset
self.ofile.write(cgi.escape(buffer(self.buf, idx)))
while 1:
buf = self.ifile.read(CHUNK_SIZE)
if not buf:
break
self.ofile.write(cgi.escape(buf))
def _more(self):
self.offset = self.offset + len(self.buf)
self.buf = self.ifile.read(CHUNK_SIZE)
def generate(input, elems, output, genpage=0):
ep = ElemParser(elems)
w = Writer(input, output)
cur = 0
if genpage:
w.write('''\
<html><head><title>ELX Output Page</title>
<style type="text/css">
.elx_C { color: firebrick; font-style: italic; }
.elx_S { color: #bc8f8f; font-weight: bold; }
.elx_K { color: purple; font-weight: bold }
.elx_F { color: blue; font-weight: bold; }
.elx_L { color: blue; font-weight: bold; }
.elx_M { color: blue; font-weight: bold; }
.elx_R { color: blue; font-weight: bold; }
</style>
</head>
<body>
''')
w.write('<pre>')
while 1:
type, start, length = ep.get()
if type is None:
break
if cur < start:
# print out some plain text up to 'cur'
w.copy(cur, start - cur)
# wrap a bit o' formatting here
w.write('<span class="elx_%s">' % type)
# copy over the token
w.copy(start, length)
# and close up the formatting
w.write('</span>')
cur = start + length
# all done.
w.flush(cur)
w.write('</pre>')
if genpage:
w.write('</body></html>\n')
if __name__ == '__main__':
import sys
generate(open(sys.argv[1]), open(sys.argv[2]), sys.stdout, 1)

26
elemx/elx_page.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/sh
if test "$#" != 2; then
echo "USAGE: $0 SOURCE-FILE ELX-FILE"
exit 1
fi
cat <<EOF
<html><head><title>ELX Output Page</title>
<style type="text/css">
.elx_C { color: firebrick; font-style: italic; }
.elx_S { color: #bc8f8f; font-weight: bold; }
.elx_K { color: purple; font-weight: bold }
.elx_F { color: blue; font-weight: bold; }
.elx_L { color: blue; font-weight: bold; }
.elx_M { color: blue; font-weight: bold; }
.elx_R { color: blue; font-weight: bold; }
</style>
</head>
<body>
EOF
dirname="`dirname $0`"
python2 $dirname/elx_html.py $1 $2
echo "</body></html>"

148
elemx/java/elx-java.c Normal file
View File

@@ -0,0 +1,148 @@
#include <stdio.h>
#include <stdlib.h>
#include "java.h"
#include "j_keywords.h"
#include "elx.h"
/* from j_scan.c */
extern int yylex(void);
extern void yylex_start(int *error_flag);
extern void yylex_finish(void);
extern const char *get_identifier(void);
static const char *fname;
static int saw_error = 0;
static int lineno = 1;
static int hpos = 1;
static int fpos = 0;
static int token_start = 0;
static int start_lineno;
static int start_hpos;
static elx_context_t *ectx;
//#define DEBUG_SCANNER
/* if we're debugging, then the scanner looks for this var */
int yysdebug = 0;
/* and the parser looks for this */
int yydebug = 1;
void yyserror(const char *msg)
{
fprintf(stderr, "%s:%d:%d: lex error: %s\n",
fname, start_lineno, start_hpos, msg);
saw_error = 1;
}
void yyerror(const char *msg)
{
fprintf(stderr, "%s:%d:%d: parse error: %s\n",
fname, start_lineno, start_hpos, msg);
saw_error = 1;
}
int yyslex(void)
{
int c = fgetc(ectx->input_fp);
if (c == EOF)
return -1; /* tell lexer we're done */
++fpos;
if (c == '\n')
{
hpos = 1;
++lineno;
}
else
++hpos;
// printf("char: '%c'\n", c);
return c;
}
void issue_token(char which)
{
const char *ident = NULL;
if (ELX_DEFINES_SYM(which))
ident = get_identifier();
else
ident = NULL;
elx_issue_token(ectx, which, token_start, fpos - token_start + 1, ident);
}
void mark_token_start(void)
{
token_start = fpos;
start_lineno = lineno;
start_hpos = hpos;
}
#ifdef DEBUG_SCANNER
void gen_scan_tokens(void)
{
while (1)
{
int v = yylex();
if (v == TK_IDENTIFIER)
printf("%d-%d: %d '%s'\n",
token_start, fpos-1, v, get_identifier());
else
printf("%d-%d: %d\n", token_start, fpos-1, v);
/* end of parse? */
if (v <= 0)
break;
}
}
#else /* DEBUG_SCANNER */
static void gen_elx_tokens(void)
{
/* ### what to do with the result? should have seen/set saw_error */
(void) yyparse();
}
#endif /* DEBUG_SCANNER */
int main(int argc, const char **argv)
{
int errcode;
ectx = elx_process_args(argc, argv);
yylex_start(&errcode);
if (errcode)
{
fprintf(stderr, "error: yylex_start: %d\n", errcode);
return EXIT_FAILURE;
}
elx_open_files(ectx);
#ifdef DEBUG_SCANNER
gen_scan_tokens();
#else
gen_elx_tokens();
#endif
yylex_finish();
elx_close_files(ectx);
if (saw_error)
return EXIT_FAILURE;
return EXIT_SUCCESS;
}

View File

@@ -0,0 +1,65 @@
%local {
/* get the KR_* values */
#include "java.h"
}
%%
abstract
boolean
break
byte
/* byvalue */
case
/* cast */
catch
char
class
/* const */
continue
default
do
double
else
extends
false
final
finally
float
for
/* future */
/* generic */
/* goto */
if
implements
import
/* inner */
instanceof
int
interface
long
native
new
null
/* operator */
/* outer */
package
private
protected
public
/* rest */
return
short
static
super
switch
synchronized
this
throw
throws
transient
true
try
/* var */
void
volatile
while

135
elemx/java/j_scan.y Normal file
View File

@@ -0,0 +1,135 @@
%start token
%scanner
%local {
#include "elx.h"
/* from elx-java.c */
void yyserror(const char *msg);
int yyslex(void);
/* for the TK_ symbols, generated from java.y */
#include "java.h"
/* for keyword recognition */
#include "j_keywords.h"
extern void issue_token(char which);
extern void mark_token_start(void);
#define MAX_IDENT 200
static int idlen;
static char identifier[MAX_IDENT+1];
#define INIT_IDENT(c) (identifier[0] = (c), idlen = 1)
#define ADD_IDENT(c) if (idlen == MAX_IDENT) return E_IDENT_TOO_LONG; \
else identifier[idlen++] = (c)
/* ### is there a better place? */
#define E_IDENT_TOO_LONG (-100)
static int lookup(void);
}
%%
token : pure_ws* { mark_token_start(); } slash_op
slash_op : "/=" { return TK_OPERATOR; }
| comment token
| '/' { return TK_OPERATOR; }
| one_token
|
;
one_token : t_identifier { return lookup(); }
| t_literal { return TK_LITERAL; }
| t_operator { return TK_OPERATOR; }
| t_chars { return yysprev_char; }
| t_inc_dec { return TK_INC_DEC; }
| t_bracket
;
t_identifier : alpha { INIT_IDENT(yysprev_char); }
( alphanum { ADD_IDENT(yysprev_char); } )*
alpha : 'a' - 'z' | 'A' - 'Z' | '_' | '$'
alphanum : alpha | digit
digit : '0' - '9'
hexdigit : digit | 'a' - 'f' | 'A' - 'F'
octal : '0' - '7'
t_literal : number | string | char_constant
number : ('1' - '9') digit* decimal_suffix
| '.' digit+ [exponent] [float_suffix]
| '0' (('x' | 'X') hexdigit+ | octal+) decimal_suffix
;
decimal_suffix : ('.' digit* [exponent] [float_suffix])
| 'l' | 'L'
| /* nothing */
;
exponent : ('e' | 'E') ['+' | '-'] digit+
float_suffix : 'f' | 'F' | 'd' | 'D'
string : '"' string_char* '"' { issue_token(ELX_STRING); }
string_char : '\1' -> '"' | '"' <-> '\\' | '\\' <- '\377' | '\\' '\1' - '\377'
char_constant : '\'' one_char '\''
one_char : '\1' -> '\'' | '\'' <-> '\\' | '\\' <- '\377' | '\\' '\1' - '\377'
comment : ( "//" line_comment_char* '\n'
| "/*" (block_comment_char | '*' block_non_term_char)* "*/"
) { issue_token(ELX_COMMENT); }
;
line_comment_char : '\1' -> '\n' | '\n' <- '\377'
block_comment_char : '\1' -> '*' | '*' <- '\377'
block_non_term_char : '\1' -> '/' | '/' <- '\377'
t_operator : "<<" | ">>" | ">>>"
| ">=" | "<=" | "==" | "!=" | "&&" | "||"
| "*=" | "%=" | "+=" | "-=" | "<<=" | ">>="
| ">>>=" | "&=" | "^=" | "|="
| '<' | '>' | '%' | '^' | '&' | '|'
;
t_inc_dec : "++" | "--"
/* note: could not use ws* ; the '[' form would only reduce on $end
rather than "any" character. that meant we could not recognize '['
within the program text. separating out the cases Does The Right
Thing */
t_bracket : '[' { return '['; }
| '[' ']' { return TK_DIM; }
| '[' ws+ ']' { return TK_DIM; }
;
t_chars : ',' | ';' | '.' | '{' | '}' | '=' | '(' | ')' | ':'
| ']' | '!' | '~' | '+' | '-' | '*' | '?'
;
ws : pure_ws | comment
pure_ws : ' ' | '\t' | '\n' | '\f'
%%
static int lookup(void)
{
int kw = KR_find_keyword(identifier, idlen);
if (kw == KR__not_found)
{
/* terminate so user can grab an identifier string */
identifier[idlen] = '\0';
return TK_IDENTIFIER;
}
issue_token(ELX_KEYWORD);
return kw;
}
const char *get_identifier(void)
{
return identifier;
}

458
elemx/java/java.y Normal file
View File

@@ -0,0 +1,458 @@
%token KR_abstract
%token KR_boolean KR_break KR_byte /* KR_byvalue */
%token KR_case /* KR_cast */ KR_catch KR_char KR_class /* KR_const */ KR_continue
%token KR_default KR_do KR_double
%token KR_else KR_extends
%token KR_false KR_final KR_finally KR_float KR_for /* KR_future */
/* %token KR_generic KR_goto */
%token KR_if KR_implements KR_import /* KR_inner */ KR_instanceof KR_int KR_interface
%token KR_long
%token KR_native KR_new KR_null
/* %token KR_operator KR_outer */
%token KR_package KR_private KR_protected KR_public
%token /* KR_rest */ KR_return
%token KR_short KR_static KR_super KR_switch KR_synchronized
%token KR_this KR_throw KR_throws KR_transient KR_true KR_try
%token /* KR_var */ KR_void KR_volatile
%token KR_while
%token TK_OP_ASSIGN TK_OPERATOR TK_IDENTIFIER TK_LITERAL
%token TK_DIM TK_INC_DEC
%start CompilationUnit
/* the standard if/then/else conflict */
/* %expect 1 */
%{
#include "elx.h"
void yyerror(const char *msg);
int yylex(void);
/* ### should come from an elx-python.h or something */
void issue_token(char which);
%}
%export {
/* the main parsing function */
int yyparse(void);
/* need to define the 'not found' in addition to the regular keywords */
#define KR__not_found 0
}
%%
TypeSpecifier
: TypeName
| TypeNameDims
;
TypeNameDims
: TypeName TK_DIM+
;
TypeNameDot
: NamePeriod
| PrimitiveType '.'
;
TypeName
: PrimitiveType
| NamePeriod TK_IDENTIFIER
| TK_IDENTIFIER
;
NamePeriod
: TK_IDENTIFIER '.'
| NamePeriod TK_IDENTIFIER '.'
;
TypeNameList
: TypeName / ','
;
PrimitiveType
: KR_boolean
| KR_byte
| KR_char
| KR_double
| KR_float
| KR_int
| KR_long
| KR_short
| KR_void
;
CompilationUnit
: PackageStatement [ImportStatements] [TypeDeclarations]
| ImportStatements [TypeDeclarations]
| TypeDeclarations
;
PackageStatement
: KR_package (TK_IDENTIFIER / '.') ';'
;
TypeDeclarations
: TypeDeclaration+
;
TypeDeclaration
: ClassDeclaration
| InterfaceDeclaration
;
ImportStatements
: ImportStatement+
;
ImportStatement
: KR_import TK_IDENTIFIER ('.' TK_IDENTIFIER)* [".*"] ';'
;
/*
QualifiedName
: TK_IDENTIFIER / '.'
;
*/
ClassDeclaration
: [Modifiers] KR_class TK_IDENTIFIER [Super] [Interfaces] ClassBody
;
Modifiers
: Modifier+
;
Modifier
: KR_abstract
| KR_final
| KR_public
| KR_protected
| KR_private
| KR_static
| KR_transient
| KR_volatile
| KR_native
| KR_synchronized
;
Super
: KR_extends TypeNameList
;
Interfaces
: KR_implements TypeNameList
;
ClassBody
: '{' FieldDeclaration* '}'
;
FieldDeclaration
: FieldVariableDeclaration
| MethodDeclaration
| ConstructorDeclaration
| StaticInitializer
;
FieldVariableDeclaration
: [Modifiers] TypeSpecifier VariableDeclarators ';'
;
VariableDeclarators
: VariableDeclarator / ','
;
VariableDeclarator
: DeclaratorName ['=' VariableInitializer]
;
VariableInitializer
: Expression
| '{' [ArrayInitializers] '}'
;
ArrayInitializers
: VariableInitializer ( ',' [VariableInitializer] )*
;
MethodDeclaration
: [Modifiers] TypeSpecifier MethodDeclarator [Throws] MethodBody
;
MethodDeclarator
: DeclaratorName '(' [ParameterList] ')' TK_DIM*
;
ParameterList
: Parameter / ','
;
Parameter
: TypeSpecifier DeclaratorName
;
DeclaratorName
: TK_IDENTIFIER TK_DIM*
;
Throws
: KR_throws TypeNameList
;
MethodBody
: Block
| ';'
;
ConstructorDeclaration
: [Modifiers] ConstructorDeclarator [Throws] Block
;
ConstructorDeclarator
: TypeName '(' [ParameterList] ')'
;
StaticInitializer
: KR_static Block
;
InterfaceDeclaration
: [Modifiers] KR_interface TK_IDENTIFIER [ExtendsInterfaces] InterfaceBody
;
ExtendsInterfaces
: KR_extends TypeNameList
;
InterfaceBody
: '{' FieldDeclaration+ '}'
;
Block
: '{' LocalVariableDeclarationOrStatement* '}'
;
LocalVariableDeclarationOrStatement
: LocalVariableDeclarationStatement
| Statement
;
LocalVariableDeclarationStatement
: TypeSpecifier VariableDeclarators ';'
;
Statement
: EmptyStatement
| LabeledStatement
| ExpressionStatement ';'
| SelectionStatement
| IterationStatement
| JumpStatement
| GuardingStatement
| Block
;
EmptyStatement
: ';'
;
LabeledStatement
: TK_IDENTIFIER ':' LocalVariableDeclarationOrStatement
| KR_case ConstantExpression ':' LocalVariableDeclarationOrStatement
| KR_default ':' LocalVariableDeclarationOrStatement
;
ExpressionStatement
: Expression
;
SelectionStatement
: KR_if '(' Expression ')' Statement [KR_else Statement]
| KR_switch '(' Expression ')' Block
;
IterationStatement
: KR_while '(' Expression ')' Statement
| KR_do Statement KR_while '(' Expression ')' ';'
| KR_for '(' ForInit ForExpr [ForIncr] ')' Statement
;
ForInit
: ExpressionStatements ';'
| LocalVariableDeclarationStatement
| ';'
;
ForExpr
: [Expression] ';'
;
ForIncr
: ExpressionStatements
;
ExpressionStatements
: ExpressionStatement / ','
;
JumpStatement
: KR_break [TK_IDENTIFIER] ';'
| KR_continue [TK_IDENTIFIER] ';'
| KR_return [Expression] ';'
| KR_throw Expression ';'
;
GuardingStatement
: KR_synchronized '(' Expression ')' Statement
| KR_try Block Finally
| KR_try Block Catches
| KR_try Block Catches Finally
;
Catches
: Catch+
;
Catch
: KR_catch '(' TypeSpecifier [TK_IDENTIFIER] ')' Block
;
Finally
: KR_finally Block
;
ArgumentList
: Expression / ','
;
PrimaryExpression
: TK_LITERAL
| KR_true | KR_false
| KR_this
| KR_null
| KR_super
| '(' Expression ')'
;
PostfixExpression
: PrimaryExpression Trailers
| TypeName AltTrailers
| TypeNameDot FollowsPeriod Trailers
| TypeNameDot DimAllocation TypeTrailers
| TypeNameDims TypeTrailers
| KR_new TypeName AltTrailers
| KR_new TypeNameDims TypeTrailers
;
DimAllocation
: KR_new TypeNameDims
;
PostfixDims
: TK_DIM+ '.' KR_class
;
FollowsPeriod
: KR_this
| KR_class
| KR_super
| KR_new TypeName NoPeriodsTrailer
;
NoPeriodsTrailer
: '[' Expression ']'
| '(' [ArgumentList] ')'
;
NoDimTrailer
: NoPeriodsTrailer
| '.' (FollowsPeriod | TK_IDENTIFIER)
;
AnyTrailer
: NoDimTrailer
| PostfixDims
;
Trailers
: (AnyTrailer | DimAllocation NoDimTrailer)* [DimAllocation]
;
AltTrailers
: NoPeriodsTrailer Trailers
|
;
TypeTrailers
: NoDimTrailer Trailers
|
;
CastablePrefixExpression
: PostfixExpression [TK_INC_DEC]
| LogicalUnaryOperator CastExpression
;
LogicalUnaryOperator
: '~'
| '!'
;
UnaryOperator
: '+'
| '-'
| TK_INC_DEC
;
/* note: we don't actually have grammar for a cast. we just rely on:
(expr) (argument)
as our parse match */
CastExpression
: /* '(' PrimitiveType ')' CastExpression
| '(' NamePeriod TK_IDENTIFIER TK_DIM TK_DIM* ')' CastablePrefixExpression
| '(' NamePeriod TK_IDENTIFIER ')' CastablePrefixExpression
| '(' TK_IDENTIFIER TK_DIM TK_DIM* ')' CastablePrefixExpression
| '(' TK_IDENTIFIER ')' CastablePrefixExpression
| */ UnaryOperator CastExpression
| CastablePrefixExpression
;
BinaryExpression
: CastExpression
| BinaryExpression TK_BINARY CastExpression
| BinaryExpression KR_instanceof TypeSpecifier
;
ConditionalExpression
: BinaryExpression
| BinaryExpression '?' Expression ':' ConditionalExpression
;
AssignmentExpression
: ConditionalExpression [AssignmentOperator AssignmentExpression]
;
AssignmentOperator
: '='
| TK_OP_ASSIGN
;
Expression
: AssignmentExpression
;
ConstantExpression
: ConditionalExpression
;
/*
TK_OPERATOR : OP_LOR | OP_LAND
| OP_EQ | OP_NE | OP_LE | OP_GE
| OP_SHL | OP_SHR | OP_SHRR
;
*/
TK_BINARY : TK_OPERATOR | '+' | '-' | '*'

150
elemx/python/elx-python.c Normal file
View File

@@ -0,0 +1,150 @@
#include <stdio.h>
#include <stdlib.h>
#include "scanner.h"
#include "python.h"
#include "py_keywords.h"
#include "elx.h"
extern int yylex(void);
static const char *fname;
static int saw_error = 0;
static void *scan_ctx;
static elx_context_t *ectx;
void yyerror(const char *msg)
{
int sl, sc, el, ec;
scanner_token_linecol(scan_ctx, &sl, &sc, &el, &ec);
fprintf(stderr, "%s:%d:%d: parse error: %s\n", fname, sl, sc, msg);
saw_error = 1;
}
int reader(void *user_ctx)
{
FILE *inf = user_ctx;
int c = fgetc(inf);
if (c == EOF)
return SCANNER_EOF;
// printf("char: '%c'\n", c);
return c;
}
void issue_token(char which)
{
int start;
int end;
const char *ident = NULL;
scanner_token_range(scan_ctx, &start, &end);
if (ELX_DEFINES_SYM(which))
{
int length;
scanner_identifier(scan_ctx, &ident, &length);
}
elx_issue_token(ectx, which, start, end - start + 1, ident);
}
int yylex(void)
{
int v;
do {
v = scanner_get_token(scan_ctx);
if (v == TK_COMMENT)
{
issue_token(ELX_COMMENT);
}
} while (v == TK_COMMENT);
/* is this identifier a keyword? */
if (v == TK_IDENTIFIER)
{
const char *ident;
int length;
int kw;
scanner_identifier(scan_ctx, &ident, &length);
#if 0
printf("id=%s\n", ident);
#endif
kw = KR_find_keyword(ident, length);
if (kw != KR__not_found)
{
v = kw;
issue_token(ELX_KEYWORD);
}
}
else if (v == TK_STRING)
{
issue_token(ELX_STRING);
}
// printf("token=%d\n", v);
return v;
}
#ifdef DEBUG_SCANNER
void gen_scan_tokens(void)
{
while (1)
{
int v = scanner_get_token(scan_ctx);
int sl, sc, el, ec;
scanner_token_linecol(scan_ctx, &sl, &sc, &el, &ec);
if (v == TK_NEWLINE)
printf("%d,%d: NEWLINE\n", sl, sc);
else if (v == TK_INDENT)
printf("%d,%d: INDENT\n", el, ec);
else if (v == TK_DEDENT)
printf("%d,%d: DEDENT\n", el, ec);
else
printf("%d,%d-%d,%d: %d\n", sl, sc, el, ec, v);
/* end of parse? */
if (v <= 0)
break;
}
}
#endif /* DEBUG_SCANNER */
static void gen_elx_tokens(void)
{
/* ### what to do with the result? should have seen/set saw_error */
(void) yyparse();
}
int main(int argc, const char **argv)
{
ectx = elx_process_args(argc, argv);
elx_open_files(ectx);
scan_ctx = scanner_begin(reader, ectx->input_fp);
#ifdef DEBUG_SCANNER
gen_scan_tokens();
#else
gen_elx_tokens();
#endif
scanner_end(scan_ctx);
elx_close_files(ectx);
if (saw_error)
return EXIT_FAILURE;
return EXIT_SUCCESS;
}

View File

@@ -0,0 +1,36 @@
%local {
/* get the KR_* values */
#include "python.h"
}
%%
and
/* as */
assert
break
class
continue
def
del
elif
else
except
exec
finally
for
from
global
if
import
in
is
lambda
not
or
pass
print
raise
return
try
while
yield

135
elemx/python/python.y Normal file
View File

@@ -0,0 +1,135 @@
%token TK_COMMENT TK_IDENTIFIER TK_NUMBER
%token TK_OPERATOR TK_STRING
%token TK_INDENT TK_DEDENT TK_NEWLINE
%token KR_and KR_assert KR_break KR_class KR_continue KR_def
%token KR_del KR_elif KR_else KR_except KR_exec KR_finally
%token KR_for KR_from KR_global KR_if KR_import KR_in KR_is
%token KR_lambda KR_not KR_or KR_pass KR_print KR_raise
%token KR_return KR_try KR_while KR_yield
%start file_input
%{
#include "elx.h"
void yyerror(const char *msg);
int yylex(void);
/* ### should come from an elx-python.h or something */
void issue_token(char which);
%}
%export {
/* the main parsing function */
int yyparse(void);
/* need to define the 'not found' in addition to the regular keywords */
#define KR__not_found 0
}
%%
file_input: (TK_NEWLINE | stmt)*
NAME: TK_IDENTIFIER
funcdef: KR_def NAME { issue_token(ELX_LOCAL_FDEF); } parameters ':' suite
parameters: '(' [varargslist] ')'
varargslist: paramdef (',' paramdef)* [',' [varargsdef]]
| varargsdef
;
/* the TK_OPERATOR represents '*' or '**' */
varargsdef: TK_OPERATOR NAME [',' TK_OPERATOR NAME]
paramdef: fpdef [TK_OPERATOR test]
fpdef: NAME | '(' fplist ')'
fplist: fpdef (',' fpdef)* [',']
stmt: simple_stmt | compound_stmt
simple_stmt: small_stmt (';' small_stmt)* [';'] TK_NEWLINE
small_stmt: expr_stmt | print_stmt | raise_stmt
| import_stmt | global_stmt | exec_stmt | assert_stmt
| KR_del exprlist
| KR_pass
| KR_break
| KR_continue
| KR_return [testlist]
| KR_yield testlist
;
/* expr_stmt is normally assignment, which we get thru TK_OPERATOR in 'expr' */
expr_stmt: testlist
/* a print normally allows '>> test'; since that is a TK_OPERATOR, we
get it as part of 'factor'. this rule also allows for a trailing
comma in '>> test,' which the normal print doesn't */
print_stmt: KR_print [test (',' test)* [',']]
raise_stmt: KR_raise [test [',' test [',' test]]]
/* the TK_OPERATOR represents '*' */
import_stmt: KR_import dotted_as_name (',' dotted_as_name)*
| KR_from dotted_name KR_import (TK_OPERATOR | import_as_name (',' import_as_name)*)
import_as_name: NAME [NAME NAME]
dotted_as_name: dotted_name [NAME NAME]
dotted_name: NAME ('.' NAME)*
global_stmt: KR_global NAME (',' NAME)*
exec_stmt: KR_exec expr [KR_in test [',' test]]
assert_stmt: KR_assert test [',' test]
compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef
if_stmt: KR_if test ':' suite (KR_elif test ':' suite)* [KR_else ':' suite]
while_stmt: KR_while test ':' suite [KR_else ':' suite]
for_stmt: KR_for exprlist KR_in testlist ':' suite [KR_else ':' suite]
try_stmt: KR_try ':' suite (except_clause ':' suite)+
[KR_else ':' suite] | KR_try ':' suite KR_finally ':' suite
/* NB compile.c makes sure that the default except clause is last */
except_clause: KR_except [test [',' test]]
suite: simple_stmt | TK_NEWLINE TK_INDENT stmt+ TK_DEDENT
test: test_factor (test_op test_factor | KR_is [KR_not] factor)*
[TK_OPERATOR lambdef] | lambdef
test_op: bin_op | KR_in
test_factor: KR_not* factor
expr: factor (expr_op factor)*
expr_op: bin_op | KR_is [KR_not]
factor: TK_OPERATOR* atom trailer*
bin_op: TK_OPERATOR | KR_or | KR_and | KR_not KR_in
atom: '(' [testlist] ')' | '[' [listmaker] ']' | '{' [dictmaker] '}'
| '`' testlist_no_trailing '`' | TK_IDENTIFIER | TK_NUMBER | TK_STRING+
listmaker: test ( list_for | (',' test)* [','] )
lambdef: KR_lambda [varargslist] ':' test
trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME
subscriptlist: subscript (',' subscript)* [',']
subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop]
sliceop: ':' [test]
exprlist: expr (',' expr)* [',']
testlist: test (',' test)* [',']
testlist_no_trailing: test (',' test)*
testlist_safe: test [(',' test)+ [',']] /* doesn't match: test, */
dictmaker: test ':' test (',' test ':' test)* [',']
classdef: KR_class NAME ['(' testlist ')'] ':' suite
/* arguments are normally 'keyword = test; since '=' is TK_OPERATOR, we
match keyword arguments as part of 'test' (in 'expr').
the vararg portion is normally '* test' or '** test'; since '*' and
'**' are TK_OPERATOR, we match varargs as part of 'test' (in
'factor')
thus, all argument forms are simply 'test'
varargs does not normally allow a trailing comma, but we can
simplify things and allow a match
*/
arglist: test (',' test)* [',']
list_iter: list_for | list_if
list_for: KR_for exprlist KR_in testlist_safe [list_iter]
list_if: KR_if test [list_iter]

523
elemx/python/scanner.c Normal file
View File

@@ -0,0 +1,523 @@
#include <stdlib.h>
#include <ctype.h>
#include <assert.h>
#include <string.h>
#include "python.h" /* get the TK_ values */
#include "scanner.h"
#define SCANNER_EMPTY (SCANNER_EOF - 1) /* -2 */
#define SCANNER_TABSIZE 8
#define SCANNER_MAXINDENT 100
#define SCANNER_MAXIDLEN 200
typedef struct
{
get_char_t getfunc;
void *user_ctx;
char saved;
int was_newline; /* was previous character a newline? */
int start; /* start position of last token returned */
int start_col;
int start_line;
int fpos; /* file position */
int lineno; /* file line number */
int line_pos; /* file position of current line's first char */
int nesting_level;
int indent; /* which indent */
int indents[SCANNER_MAXINDENT]; /* the set of indents */
int dedent_count; /* how many DEDENTs to issue */
int skip_newline; /* skip the newline after a blank_line + comment */
int idlen;
char identifier[SCANNER_MAXIDLEN]; /* accumulated identifier */
} scanner_ctx;
static int next_char(scanner_ctx *ctx)
{
int c;
++ctx->fpos;
if (ctx->saved == SCANNER_EMPTY)
{
return (*ctx->getfunc)(ctx->user_ctx);
}
c = ctx->saved;
ctx->saved = SCANNER_EMPTY;
return c;
}
static void backup_char(scanner_ctx *ctx, int c)
{
assert(ctx->saved == SCANNER_EMPTY);
ctx->saved = c;
ctx->was_newline = 0; /* we may have put it back */
--ctx->fpos;
}
/* called to note that we've moved on to another line */
static void on_next_line(scanner_ctx *ctx)
{
ctx->line_pos = ctx->fpos;
++ctx->lineno;
}
void *scanner_begin(get_char_t getfunc, void *user_ctx)
{
scanner_ctx *ctx = malloc(sizeof(*ctx));
memset(ctx, 0, sizeof(*ctx));
ctx->getfunc = getfunc;
ctx->user_ctx = user_ctx;
ctx->saved = SCANNER_EMPTY;
ctx->lineno = 1;
return ctx;
}
int scanner_get_token(void *opaque_ctx)
{
scanner_ctx *ctx = opaque_ctx;
int c;
int c2;
int blank_line;
if (ctx->dedent_count)
{
--ctx->dedent_count;
return TK_DEDENT;
}
nextline:
blank_line = 0;
/* if we're at the start of the line, then get the indentation level */
if (ctx->fpos == ctx->line_pos)
{
int col = 0;
while (1)
{
c = next_char(ctx);
if (c == ' ')
++col;
else if (c == '\t')
col = (col / SCANNER_TABSIZE + 1) * SCANNER_TABSIZE;
else if (c == '\f') /* ^L / formfeed */
col = 0;
else
break;
}
backup_char(ctx, c);
if (c == '#' || c == '\n')
{
/* this is a "blank" line and doesn't count towards indentation,
and it doesn't produce NEWLINE tokens */
blank_line = 1;
}
/* if it isn't blank, and we aren't inside nesting expressions, then
we need to handle INDENT/DEDENT */
if (!blank_line && ctx->nesting_level == 0)
{
int last_indent = ctx->indents[ctx->indent];
if (col == last_indent)
{
/* no change */
}
else if (col > last_indent)
{
if (ctx->indent == SCANNER_MAXINDENT - 1)
{
/* oops. too deep. */
return E_TOO_MANY_INDENTS;
}
ctx->indents[++ctx->indent] = col;
return TK_INDENT;
}
else /* col < last_indent */
{
/* find the previous indentation that matches this one */
while (ctx->indent > 0
&& col < ctx->indents[ctx->indent])
{
++ctx->dedent_count;
--ctx->indent;
}
if (col != ctx->indents[ctx->indent])
{
/* oops. dedent doesn't match any indent. */
return E_DEDENT_MISMATCH;
}
/* deliver one dedent now */
--ctx->dedent_count;
return TK_DEDENT;
}
} /* !blank_line ... */
} /* start of line */
/* start here if we see a line continuation */
read_more:
do {
c = next_char(ctx);
} while (c == ' ' || c == '\t' || c == '\f');
/* here is where the token starts */
ctx->start = ctx->fpos;
ctx->start_line = ctx->lineno;
ctx->start_col = ctx->fpos - ctx->line_pos;
/* comment? */
if (c == '#')
{
do {
c = next_char(ctx);
} while (c != SCANNER_EOF && c != '\n');
/* if we are suppressing newlines because this is a blank line, then
leave a marker to skip the newline, next time through. */
if (blank_line && c == '\n')
ctx->skip_newline = 1;
/* put back whatever we sucked up */
backup_char(ctx, c);
return TK_COMMENT;
}
/* Look for an identifier */
if (isalpha(c) || c == '_')
{
ctx->idlen = 0;
/* is this actually a string? */
if (c == 'r' || c == 'R')
{
ctx->identifier[ctx->idlen++] = c;
c = next_char(ctx);
if (c == '"' || c == '\'')
goto parse_string;
}
else if (c == 'u' || c == 'U')
{
ctx->identifier[ctx->idlen++] = c;
c = next_char(ctx);
if (c == 'r' || c == 'R')
{
ctx->identifier[ctx->idlen++] = c;
c = next_char(ctx);
}
if (c == '"' || c == '\'')
goto parse_string;
}
while (isalnum(c) || c == '_') {
/* store the character if there is room for it, and room left
for a null-terminator. */
if (ctx->idlen < SCANNER_MAXIDLEN-1)
ctx->identifier[ctx->idlen++] = c;
c = next_char(ctx);
}
backup_char(ctx, c);
/* ### check for a keyword */
return TK_IDENTIFIER;
}
if (c == '\n')
{
on_next_line(ctx);
/* don't report NEWLINE tokens for blank lines or nested exprs */
if (blank_line || ctx->nesting_level > 0 || ctx->skip_newline)
{
ctx->skip_newline = 0;
goto nextline;
}
return TK_NEWLINE;
}
if (c == '.')
{
c = next_char(ctx);
if (isdigit(c))
goto parse_fraction;
backup_char(ctx, c);
return '.';
}
if (isdigit(c))
{
if (c == '0')
{
c = next_char(ctx);
if (c == 'x' || c == 'X')
{
do {
c = next_char(ctx);
} while (isxdigit(c));
goto skip_fp;
}
else if (isdigit(c))
{
do {
c = next_char(ctx);
} while (isdigit(c));
}
if (c == '.')
goto parse_fraction;
if (c == 'e' || c == 'E')
goto parse_exponent;
if (c == 'j' || c == 'J')
goto parse_imaginary;
skip_fp:
/* this point: parsed an octal, decimal, or hexadecimal */
if (c == 'l' || c == 'L')
{
/* we consumed just enough. stop and return a NUMBER */
return TK_NUMBER;
}
/* consumed too much. backup and return a NUMBER */
backup_char(ctx, c);
return TK_NUMBER;
}
/* decimal number */
do {
c = next_char(ctx);
} while (isdigit(c));
if (c == 'l' || c == 'L')
{
/* we consumed just enogh. stop and return a NUMBER */
return TK_NUMBER;
}
if (c == '.')
{
parse_fraction:
do {
c = next_char(ctx);
} while (isdigit(c));
}
if (c == 'e' || c == 'E')
{
parse_exponent:
c = next_char(ctx);
if (c == '+' || c == '-')
c = next_char(ctx);
if (!isdigit(c))
{
backup_char(ctx, c);
return E_BAD_NUMBER;
}
do {
c = next_char(ctx);
} while (isdigit(c));
}
if (c == 'j' || c == 'J')
{
parse_imaginary:
c = next_char(ctx);
}
/* one too far. backup and return a NUMBER */
backup_char(ctx, c);
return TK_NUMBER;
} /* isdigit */
parse_string:
if (c == '\'' || c == '"')
{
int second_quote_pos = ctx->fpos + 1;
int which_quote = c;
int is_triple = 0;
int quote_count = 0;
while (1)
{
c = next_char(ctx);
if (c == '\n')
{
on_next_line(ctx);
if (!is_triple)
return E_UNTERM_STRING;
quote_count = 0;
}
else if (c == SCANNER_EOF)
{
return E_UNTERM_STRING;
}
else if (c == which_quote)
{
++quote_count;
if (ctx->fpos == second_quote_pos)
{
c = next_char(ctx);
if (c == which_quote)
{
is_triple = 1;
quote_count = 0;
continue;
}
/* we just read one past the empty string. back up. */
backup_char(ctx, c);
}
/* this quote may have terminated the string */
if (!is_triple || quote_count == 3)
return TK_STRING;
}
else if (c == '\\')
{
c = next_char(ctx);
if (c == SCANNER_EOF)
return E_UNTERM_STRING;
if (c == '\n')
on_next_line(ctx);
quote_count = 0;
}
else
{
quote_count = 0;
}
}
/* NOTREACHED */
}
/* line continuation */
if (c == '\\')
{
c = next_char(ctx);
if (c != '\n')
return E_BAD_CONTINUATION;
on_next_line(ctx);
goto read_more;
}
/* look for operators */
/* the nesting operators */
if (c == '(' || c == '[' || c == '{')
{
++ctx->nesting_level;
return c;
}
if (c == ')' || c == ']' || c == '}')
{
--ctx->nesting_level;
return c;
}
/* look for up-to-3-char ops */
if (c == '<' || c == '>' || c == '*' || c == '/')
{
c2 = next_char(ctx);
if (c == c2)
{
c2 = next_char(ctx);
if (c2 != '=')
{
/* oops. one too far. */
backup_char(ctx, c2);
}
return TK_OPERATOR;
}
if (c == '<' && c2 == '>')
return TK_OPERATOR;
if (c2 != '=')
{
/* one char too far. */
backup_char(ctx, c2);
}
return TK_OPERATOR;
}
/* look for 2-char ops */
if (c == '=' || c == '!' || c == '+' || c == '-'
|| c == '|' || c == '%' || c == '&' || c == '^')
{
c2 = next_char(ctx);
if (c2 == '=')
return TK_OPERATOR;
/* oops. too far. */
backup_char(ctx, c2);
return TK_OPERATOR;
}
/* ### should all of these return 'c' ? */
if (c == ':' || c == ',' || c == ';' || c == '`')
return c;
/* as a unary operator, this must be a TK_OPERATOR */
if (c == '~')
return TK_OPERATOR;
/* if we have an EOF, then just return it */
if (c == SCANNER_EOF)
return SCANNER_EOF;
/* unknown input */
return E_UNKNOWN_TOKEN;
}
void scanner_identifier(void *opaque_ctx, const char **ident, int *len)
{
scanner_ctx *ctx = opaque_ctx;
ctx->identifier[ctx->idlen] = '\0';
*ident = ctx->identifier;
*len = ctx->idlen;
}
void scanner_token_range(void *opaque_ctx, int *start, int *end)
{
scanner_ctx *ctx = opaque_ctx;
*start = ctx->start;
*end = ctx->fpos;
}
void scanner_token_linecol(void *opaque_ctx,
int *sline, int *scol, int *eline, int *ecol)
{
scanner_ctx *ctx = opaque_ctx;
*sline = ctx->start_line;
*scol = ctx->start_col;
*eline = ctx->lineno;
*ecol = ctx->fpos - ctx->line_pos;
}
void scanner_end(void *ctx)
{
free(ctx);
}

42
elemx/python/scanner.h Normal file
View File

@@ -0,0 +1,42 @@
#ifndef SCANNER_H
#define SCANNER_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* constants and errors returned by the scanner */
enum
{
SCANNER_EOF = -1, /* returned by get_char_t and
scanner_get_token to symbolize EOF */
E_TOO_MANY_INDENTS = -100, /* too many indents */
E_DEDENT_MISMATCH, /* no matching indent */
E_BAD_CONTINUATION, /* character occurred after \ */
E_BAD_NUMBER, /* parse error in a number */
E_UNKNOWN_TOKEN, /* dunno what we found */
E_UNTERM_STRING /* unterminated string constant */
};
typedef int (*get_char_t)(void *user_ctx);
void *scanner_begin(get_char_t getfunc, void *user_ctx);
int scanner_get_token(void *ctx);
void scanner_identifier(void *ctx, const char **ident, int *len);
void scanner_token_range(void *ctx, int *start, int *end);
void scanner_token_linecol(void *ctx,
int *sline, int *scol, int *eline, int *ecol);
void scanner_end(void *ctx);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* SCANNER_H */

170
lib/PyFontify.py Normal file
View File

@@ -0,0 +1,170 @@
"""Module to analyze Python source code; for syntax coloring tools.
Interface:
tags = fontify(pytext, searchfrom, searchto)
The PYTEXT argument is a string containing Python source code. The
(optional) arguments SEARCHFROM and SEARCHTO may contain a slice in
PYTEXT.
The returned value is a list of tuples, formatted like this:
[('keyword', 0, 6, None),
('keyword', 11, 17, None),
('comment', 23, 53, None),
...
]
The tuple contents are always like this:
(tag, startindex, endindex, sublist)
TAG is one of 'keyword', 'string', 'comment' or 'identifier'
SUBLIST is not used, hence always None.
"""
# Based on FontText.py by Mitchell S. Chapman,
# which was modified by Zachary Roadhouse,
# then un-Tk'd by Just van Rossum.
# Many thanks for regular expression debugging & authoring are due to:
# Tim (the-incredib-ly y'rs) Peters and Cristian Tismer
# So, who owns the copyright? ;-) How about this:
# Copyright 1996-1997:
# Mitchell S. Chapman,
# Zachary Roadhouse,
# Tim Peters,
# Just van Rossum
__version__ = "0.3.1"
import string, re
# This list of keywords is taken from ref/node13.html of the
# Python 1.3 HTML documentation. ("access" is intentionally omitted.)
keywordsList = ["and", "assert", "break", "class", "continue", "def",
"del", "elif", "else", "except", "exec", "finally",
"for", "from", "global", "if", "import", "in", "is",
"lambda", "not", "or", "pass", "print", "raise",
"return", "try", "while",
]
# A regexp for matching Python comments.
commentPat = "#.*"
# A regexp for matching simple quoted strings.
pat = "q[^q\\n]*(\\[\000-\377][^q\\n]*)*q"
quotePat = string.replace(pat, "q", "'") + "|" + string.replace(pat, 'q', '"')
# A regexp for matching multi-line tripled-quoted strings. (Way to go, Tim!)
pat = """
qqq
[^q]*
(
( \\[\000-\377]
| q
( \\[\000-\377]
| [^q]
| q
( \\[\000-\377]
| [^q]
)
)
)
[^q]*
)*
qqq
"""
pat = string.join(string.split(pat), '') # get rid of whitespace
tripleQuotePat = string.replace(pat, "q", "'") + "|" \
+ string.replace(pat, 'q', '"')
# A regexp which matches all and only Python keywords. This will let
# us skip the uninteresting identifier references.
nonKeyPat = "(^|[^a-zA-Z0-9_.\"'])" # legal keyword-preceding characters
keyPat = nonKeyPat + "(" + string.join(keywordsList, "|") + ")" + nonKeyPat
# Our final syntax-matching regexp is the concatation of the regexp's we
# constructed above.
syntaxPat = keyPat + \
"|" + commentPat + \
"|" + tripleQuotePat + \
"|" + quotePat
syntaxRE = re.compile(syntaxPat)
# Finally, we construct a regexp for matching indentifiers (with
# optional leading whitespace).
idKeyPat = "[ \t]*[A-Za-z_][A-Za-z_0-9.]*"
idRE = re.compile(idKeyPat)
def fontify(pytext, searchfrom=0, searchto=None):
if searchto is None:
searchto = len(pytext)
tags = []
commentTag = 'comment'
stringTag = 'string'
keywordTag = 'keyword'
identifierTag = 'identifier'
start = 0
end = searchfrom
while 1:
# Look for some syntax token we're interested in. If find
# nothing, we're done.
matchobj = syntaxRE.search(pytext, end)
if not matchobj:
break
# If we found something outside our search area, it doesn't
# count (and we're done).
start = matchobj.start()
if start >= searchto:
break
match = matchobj.group(0)
end = start + len(match)
c = match[0]
if c == '#':
# We matched a comment.
tags.append((commentTag, start, end, None))
elif c == '"' or c == '\'':
# We matched a string.
tags.append((stringTag, start, end, None))
else:
# We matched a keyword.
if start != searchfrom:
# there's still a redundant char before and after it, strip!
match = match[1:-1]
start = start + 1
else:
# This is the first keyword in the text.
# Only a space at the end.
match = match[:-1]
end = end - 1
tags.append((keywordTag, start, end, None))
# If this was a defining keyword, look ahead to the
# following identifier.
if match in ["def", "class"]:
matchobj = idRE.search(pytext, end)
if matchobj:
start = matchobj.start()
if start == end and start < searchto:
end = start + len(matchobj.group(0))
tags.append((identifierTag, start, end, None))
return tags
def test(path):
f = open(path)
text = f.read()
f.close()
tags = fontify(text)
for tag, start, end, sublist in tags:
print tag, `text[start:end]`
if __name__ == "__main__":
import sys
test(sys.argv[0])

236
lib/accept.py Normal file
View File

@@ -0,0 +1,236 @@
# -*-python-*-
#
# Copyright (C) 1999-2009 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# accept.py: parse/handle the various Accept headers from the client
#
# -----------------------------------------------------------------------
import re
import string
def language(hdr):
"Parse an Accept-Language header."
# parse the header, storing results in a _LanguageSelector object
return _parse(hdr, _LanguageSelector())
# -----------------------------------------------------------------------
_re_token = re.compile(r'\s*([^\s;,"]+|"[^"]*")+\s*')
_re_param = re.compile(r';\s*([^;,"]+|"[^"]*")+\s*')
_re_split_param = re.compile(r'([^\s=])\s*=\s*(.*)')
def _parse(hdr, result):
# quick exit for empty or not-supplied header
if not hdr:
return result
pos = 0
while pos < len(hdr):
name = _re_token.match(hdr, pos)
if not name:
raise AcceptLanguageParseError()
a = result.item_class(string.lower(name.group(1)))
pos = name.end()
while 1:
# are we looking at a parameter?
match = _re_param.match(hdr, pos)
if not match:
break
param = match.group(1)
pos = match.end()
# split up the pieces of the parameter
match = _re_split_param.match(param)
if not match:
# the "=" was probably missing
continue
pname = string.lower(match.group(1))
if pname == 'q' or pname == 'qs':
try:
a.quality = float(match.group(2))
except ValueError:
# bad float literal
pass
elif pname == 'level':
try:
a.level = float(match.group(2))
except ValueError:
# bad float literal
pass
elif pname == 'charset':
a.charset = string.lower(match.group(2))
result.append(a)
if hdr[pos:pos+1] == ',':
pos = pos + 1
return result
class _AcceptItem:
def __init__(self, name):
self.name = name
self.quality = 1.0
self.level = 0.0
self.charset = ''
def __str__(self):
s = self.name
if self.quality != 1.0:
s = '%s;q=%.3f' % (s, self.quality)
if self.level != 0.0:
s = '%s;level=%.3f' % (s, self.level)
if self.charset:
s = '%s;charset=%s' % (s, self.charset)
return s
class _LanguageRange(_AcceptItem):
def matches(self, tag):
"Match the tag against self. Returns the qvalue, or None if non-matching."
if tag == self.name:
return self.quality
# are we a prefix of the available language-tag
name = self.name + '-'
if tag[:len(name)] == name:
return self.quality
return None
class _LanguageSelector:
"""Instances select an available language based on the user's request.
Languages found in the user's request are added to this object with the
append() method (they should be instances of _LanguageRange). After the
languages have been added, then the caller can use select_from() to
determine which user-request language(s) best matches the set of
available languages.
Strictly speaking, this class is pretty close for more than just
language matching. It has been implemented to enable q-value based
matching between requests and availability. Some minor tweaks may be
necessary, but simply using a new 'item_class' should be sufficient
to allow the _parse() function to construct a selector which holds
the appropriate item implementations (e.g. _LanguageRange is the
concrete _AcceptItem class that handles matching of language tags).
"""
item_class = _LanguageRange
def __init__(self):
self.requested = [ ]
def select_from(self, avail):
"""Select one of the available choices based on the request.
Note: if there isn't a match, then the first available choice is
considered the default. Also, if a number of matches are equally
relevant, then the first-requested will be used.
avail is a list of language-tag strings of available languages
"""
# tuples of (qvalue, language-tag)
matches = [ ]
# try matching all pairs of desired vs available, recording the
# resulting qvalues. we also need to record the longest language-range
# that matches since the most specific range "wins"
for tag in avail:
longest = 0
final = 0.0
# check this tag against the requests from the user
for want in self.requested:
qvalue = want.matches(tag)
#print 'have %s. want %s. qvalue=%s' % (tag, want.name, qvalue)
if qvalue is not None and len(want.name) > longest:
# we have a match and it is longer than any we may have had.
# the final qvalue should be from this tag.
final = qvalue
longest = len(want.name)
# a non-zero qvalue is a potential match
if final:
matches.append((final, tag))
# if there are no matches, then return the default language tag
if not matches:
return avail[0]
# get the highest qvalue and its corresponding tag
matches.sort()
qvalue, tag = matches[-1]
# if the qvalue is zero, then we have no valid matches. return the
# default language tag.
if not qvalue:
return avail[0]
# if there are two or more matches, and the second-highest has a
# qvalue equal to the best, then we have multiple "best" options.
# select the one that occurs first in self.requested
if len(matches) >= 2 and matches[-2][0] == qvalue:
# remove non-best matches
while matches[0][0] != qvalue:
del matches[0]
#print "non-deterministic choice", matches
# sequence through self.requested, in order
for want in self.requested:
# try to find this one in our best matches
for qvalue, tag in matches:
if want.matches(tag):
# this requested item is one of the "best" options
### note: this request item could match *other* "best" options,
### so returning *this* one is rather non-deterministic.
### theoretically, we could go further here, and do another
### search based on the ordering in 'avail'. however, note
### that this generally means that we are picking from multiple
### *SUB* languages, so I'm all right with the non-determinism
### at this point. stupid client should send a qvalue if they
### want to refine.
return tag
# NOTREACHED
# return the best match
return tag
def append(self, item):
self.requested.append(item)
class AcceptLanguageParseError(Exception):
pass
def _test():
s = language('en')
assert s.select_from(['en']) == 'en'
assert s.select_from(['en', 'de']) == 'en'
assert s.select_from(['de', 'en']) == 'en'
# Netscape 4.x and early version of Mozilla may not send a q value
s = language('en, ja')
assert s.select_from(['en', 'ja']) == 'en'
s = language('fr, de;q=0.9, en-gb;q=0.7, en;q=0.6, en-gb-foo;q=0.8')
assert s.select_from(['en']) == 'en'
assert s.select_from(['en-gb-foo']) == 'en-gb-foo'
assert s.select_from(['de', 'fr']) == 'fr'
assert s.select_from(['de', 'en-gb']) == 'de'
assert s.select_from(['en-gb', 'en-gb-foo']) == 'en-gb-foo'
assert s.select_from(['en-bar']) == 'en-bar'
assert s.select_from(['en-gb-bar', 'en-gb-foo']) == 'en-gb-foo'
# non-deterministic. en-gb;q=0.7 matches both avail tags.
#assert s.select_from(['en-gb-bar', 'en-gb']) == 'en-gb'

150
lib/blame.py Normal file
View File

@@ -0,0 +1,150 @@
#!/usr/bin/env python
# -*-python-*-
#
# Copyright (C) 1999-2010 The ViewCVS Group. All Rights Reserved.
# Copyright (C) 2000 Curt Hagenlocher <curt@hagenlocher.org>
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# blame.py: Annotate each line of a CVS file with its author,
# revision #, date, etc.
#
# -----------------------------------------------------------------------
#
# This file is based on the cvsblame.pl portion of the Bonsai CVS tool,
# developed by Steve Lamm for Netscape Communications Corporation. More
# information about Bonsai can be found at
# http://www.mozilla.org/bonsai.html
#
# cvsblame.pl, in turn, was based on Scott Furman's cvsblame script
#
# -----------------------------------------------------------------------
import sys
import string
import os
import re
import time
import math
import vclib
import sapi
re_includes = re.compile('\\#(\\s*)include(\\s*)"(.*?)"')
def link_includes(text, repos, path_parts, include_url):
match = re_includes.match(text)
if match:
incfile = match.group(3)
include_path_parts = path_parts[:-1]
for part in filter(None, string.split(incfile, '/')):
if part == "..":
if not include_path_parts:
# nothing left to pop; don't bother marking up this include.
return text
include_path_parts.pop()
elif part and part != ".":
include_path_parts.append(part)
include_path = None
try:
if repos.itemtype(include_path_parts, None) == vclib.FILE:
include_path = string.join(include_path_parts, '/')
except vclib.ItemNotFound:
pass
if include_path:
return '#%sinclude%s<a href="%s">"%s"</a>' % \
(match.group(1), match.group(2),
string.replace(include_url, '/WHERE/', include_path), incfile)
return text
class HTMLBlameSource:
"""Wrapper around a the object by the vclib.annotate() which does
HTML escaping, diff URL generation, and #include linking."""
def __init__(self, repos, path_parts, diff_url, include_url, opt_rev=None):
self.repos = repos
self.path_parts = path_parts
self.diff_url = diff_url
self.include_url = include_url
self.annotation, self.revision = self.repos.annotate(path_parts, opt_rev)
def __getitem__(self, idx):
item = self.annotation.__getitem__(idx)
diff_url = None
if item.prev_rev:
diff_url = '%sr1=%s&amp;r2=%s' % (self.diff_url, item.prev_rev, item.rev)
thisline = link_includes(sapi.escape(item.text), self.repos,
self.path_parts, self.include_url)
return _item(text=thisline, line_number=item.line_number,
rev=item.rev, prev_rev=item.prev_rev,
diff_url=diff_url, date=item.date, author=item.author)
def blame(repos, path_parts, diff_url, include_url, opt_rev=None):
source = HTMLBlameSource(repos, path_parts, diff_url, include_url, opt_rev)
return source, source.revision
class _item:
def __init__(self, **kw):
vars(self).update(kw)
def make_html(root, rcs_path):
import vclib.ccvs.blame
bs = vclib.ccvs.blame.BlameSource(os.path.join(root, rcs_path))
line = 0
old_revision = 0
row_color = 'ffffff'
rev_count = 0
align = ' style="text-align: %s;"'
sys.stdout.write('<table cellpadding="2" cellspacing="2" style="font-family: monospace; whitespace: pre;">\n')
for line_data in bs:
revision = line_data.rev
thisline = line_data.text
line = line_data.line_number
author = line_data.author
prev_rev = line_data.prev_rev
if old_revision != revision and line != 1:
if row_color == 'ffffff':
row_color = 'e7e7e7'
else:
row_color = 'ffffff'
sys.stdout.write('<tr id="l%d" style="background-color: #%s; vertical-align: center;">' % (line, row_color))
sys.stdout.write('<td%s>%d</td>' % (align % 'right', line))
if old_revision != revision or rev_count > 20:
sys.stdout.write('<td%s>%s</td>' % (align % 'right', author or '&nbsp;'))
sys.stdout.write('<td%s>%s</td>' % (align % 'left', revision))
old_revision = revision
rev_count = 0
else:
sys.stdout.write('<td>&nbsp;</td><td>&nbsp;</td>')
rev_count = rev_count + 1
sys.stdout.write('<td%s>%s</td></tr>\n' % (align % 'left', string.rstrip(thisline) or '&nbsp;'))
sys.stdout.write('</table>\n')
def main():
import sys
if len(sys.argv) != 3:
print 'USAGE: %s cvsroot rcs-file' % sys.argv[0]
sys.exit(1)
make_html(sys.argv[1], sys.argv[2])
if __name__ == '__main__':
main()

180
lib/compat.py Normal file
View File

@@ -0,0 +1,180 @@
# -*-python-*-
#
# Copyright (C) 1999-2007 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# compat.py: compatibility functions for operation across Python 1.5.x to 2.2.x
#
# -----------------------------------------------------------------------
import urllib
import string
import time
import calendar
import re
import os
import rfc822
import tempfile
import errno
#
# urllib.urlencode() is new to Python 1.5.2
#
try:
urlencode = urllib.urlencode
except AttributeError:
def urlencode(dict):
"Encode a dictionary as application/x-url-form-encoded."
if not dict:
return ''
quote = urllib.quote_plus
keyvalue = [ ]
for key, value in dict.items():
keyvalue.append(quote(key) + '=' + quote(str(value)))
return string.join(keyvalue, '&')
#
# time.strptime() is new to Python 1.5.2
#
if hasattr(time, 'strptime'):
def cvs_strptime(timestr):
'Parse a CVS-style date/time value.'
return time.strptime(timestr, '%Y/%m/%d %H:%M:%S')[:-1] + (0,)
else:
_re_rev_date = re.compile('([0-9]{4})/([0-9][0-9])/([0-9][0-9]) '
'([0-9][0-9]):([0-9][0-9]):([0-9][0-9])')
def cvs_strptime(timestr):
'Parse a CVS-style date/time value.'
match = _re_rev_date.match(timestr)
if match:
return tuple(map(int, match.groups())) + (0, 1, 0)
else:
raise ValueError('date is not in cvs format')
#
# os.makedirs() is new to Python 1.5.2
#
try:
makedirs = os.makedirs
except AttributeError:
def makedirs(path, mode=0777):
head, tail = os.path.split(path)
if head and tail and not os.path.exists(head):
makedirs(head, mode)
os.mkdir(path, mode)
#
# rfc822.formatdate() is new to Python 1.6
#
try:
formatdate = rfc822.formatdate
except AttributeError:
def formatdate(timeval):
if timeval is None:
timeval = time.time()
timeval = time.gmtime(timeval)
return "%s, %02d %s %04d %02d:%02d:%02d GMT" % (
["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"][timeval[6]],
timeval[2],
["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][timeval[1]-1],
timeval[0], timeval[3], timeval[4], timeval[5])
#
# calendar.timegm() is new to Python 2.x and
# calendar.leapdays() was wrong in Python 1.5.2
#
try:
timegm = calendar.timegm
except AttributeError:
def leapdays(year1, year2):
"""Return number of leap years in range [year1, year2).
Assume year1 <= year2."""
year1 = year1 - 1
year2 = year2 - 1
return (year2/4 - year1/4) - (year2/100 -
year1/100) + (year2/400 - year1/400)
EPOCH = 1970
def timegm(tuple):
"""Unrelated but handy function to calculate Unix timestamp from GMT."""
year, month, day, hour, minute, second = tuple[:6]
# assert year >= EPOCH
# assert 1 <= month <= 12
days = 365*(year-EPOCH) + leapdays(EPOCH, year)
for i in range(1, month):
days = days + calendar.mdays[i]
if month > 2 and calendar.isleap(year):
days = days + 1
days = days + day - 1
hours = days*24 + hour
minutes = hours*60 + minute
seconds = minutes*60 + second
return seconds
#
# tempfile.mkdtemp() is new to Python 2.3
#
try:
mkdtemp = tempfile.mkdtemp
except AttributeError:
def mkdtemp(suffix="", prefix="tmp", dir=None):
# mktemp() only took a single suffix argument until Python 2.3.
# We'll do the best we can.
oldtmpdir = os.environ.get('TMPDIR')
try:
for i in range(10):
if dir:
os.environ['TMPDIR'] = dir
dir = tempfile.mktemp(suffix)
if prefix:
parent, base = os.path.split(dir)
dir = os.path.join(parent, prefix + base)
try:
os.mkdir(dir, 0700)
return dir
except OSError, e:
if e.errno == errno.EEXIST:
continue # try again
raise
finally:
if oldtmpdir:
os.environ['TMPDIR'] = oldtmpdir
elif os.environ.has_key('TMPDIR'):
del(os.environ['TMPDIR'])
raise IOError, (errno.EEXIST, "No usable temporary directory name found")
#
# the following stuff is *ONLY* needed for standalone.py.
# For that reason I've encapsulated it into a function.
#
def for_standalone():
import SocketServer
if not hasattr(SocketServer.TCPServer, "close_request"):
#
# method close_request() was missing until Python 2.1
#
class TCPServer(SocketServer.TCPServer):
def process_request(self, request, client_address):
"""Call finish_request.
Overridden by ForkingMixIn and ThreadingMixIn.
"""
self.finish_request(request, client_address)
self.close_request(request)
def close_request(self, request):
"""Called to clean up an individual request."""
request.close()
SocketServer.TCPServer = TCPServer

786
lib/compat_difflib.py Executable file
View File

@@ -0,0 +1,786 @@
#! /usr/bin/env python
# Backported to Python 1.5.2 for the ViewCVS project by pf@artcom-gmbh.de
# 24-Dec-2001, original version "stolen" from Python-2.1.1
"""
Module difflib -- helpers for computing deltas between objects.
Function get_close_matches(word, possibilities, n=3, cutoff=0.6):
Use SequenceMatcher to return list of the best "good enough" matches.
word is a sequence for which close matches are desired (typically a
string).
possibilities is a list of sequences against which to match word
(typically a list of strings).
Optional arg n (default 3) is the maximum number of close matches to
return. n must be > 0.
Optional arg cutoff (default 0.6) is a float in [0, 1]. Possibilities
that don't score at least that similar to word are ignored.
The best (no more than n) matches among the possibilities are returned
in a list, sorted by similarity score, most similar first.
>>> get_close_matches("appel", ["ape", "apple", "peach", "puppy"])
['apple', 'ape']
>>> import keyword
>>> get_close_matches("wheel", keyword.kwlist)
['while']
>>> get_close_matches("apple", keyword.kwlist)
[]
>>> get_close_matches("accept", keyword.kwlist)
['except']
Class SequenceMatcher
SequenceMatcher is a flexible class for comparing pairs of sequences of any
type, so long as the sequence elements are hashable. The basic algorithm
predates, and is a little fancier than, an algorithm published in the late
1980's by Ratcliff and Obershelp under the hyperbolic name "gestalt pattern
matching". The basic idea is to find the longest contiguous matching
subsequence that contains no "junk" elements (R-O doesn't address junk).
The same idea is then applied recursively to the pieces of the sequences to
the left and to the right of the matching subsequence. This does not yield
minimal edit sequences, but does tend to yield matches that "look right"
to people.
Example, comparing two strings, and considering blanks to be "junk":
>>> s = SequenceMatcher(lambda x: x == " ",
... "private Thread currentThread;",
... "private volatile Thread currentThread;")
>>>
.ratio() returns a float in [0, 1], measuring the "similarity" of the
sequences. As a rule of thumb, a .ratio() value over 0.6 means the
sequences are close matches:
>>> print round(s.ratio(), 3)
0.866
>>>
If you're only interested in where the sequences match,
.get_matching_blocks() is handy:
>>> for block in s.get_matching_blocks():
... print "a[%d] and b[%d] match for %d elements" % block
a[0] and b[0] match for 8 elements
a[8] and b[17] match for 6 elements
a[14] and b[23] match for 15 elements
a[29] and b[38] match for 0 elements
Note that the last tuple returned by .get_matching_blocks() is always a
dummy, (len(a), len(b), 0), and this is the only case in which the last
tuple element (number of elements matched) is 0.
If you want to know how to change the first sequence into the second, use
.get_opcodes():
>>> for opcode in s.get_opcodes():
... print "%6s a[%d:%d] b[%d:%d]" % opcode
equal a[0:8] b[0:8]
insert a[8:8] b[8:17]
equal a[8:14] b[17:23]
equal a[14:29] b[23:38]
See Tools/scripts/ndiff.py for a fancy human-friendly file differencer,
which uses SequenceMatcher both to view files as sequences of lines, and
lines as sequences of characters.
See also function get_close_matches() in this module, which shows how
simple code building on SequenceMatcher can be used to do useful work.
Timing: Basic R-O is cubic time worst case and quadratic time expected
case. SequenceMatcher is quadratic time for the worst case and has
expected-case behavior dependent in a complicated way on how many
elements the sequences have in common; best case time is linear.
SequenceMatcher methods:
__init__(isjunk=None, a='', b='')
Construct a SequenceMatcher.
Optional arg isjunk is None (the default), or a one-argument function
that takes a sequence element and returns true iff the element is junk.
None is equivalent to passing "lambda x: 0", i.e. no elements are
considered to be junk. For example, pass
lambda x: x in " \\t"
if you're comparing lines as sequences of characters, and don't want to
synch up on blanks or hard tabs.
Optional arg a is the first of two sequences to be compared. By
default, an empty string. The elements of a must be hashable.
Optional arg b is the second of two sequences to be compared. By
default, an empty string. The elements of b must be hashable.
set_seqs(a, b)
Set the two sequences to be compared.
>>> s = SequenceMatcher()
>>> s.set_seqs("abcd", "bcde")
>>> s.ratio()
0.75
set_seq1(a)
Set the first sequence to be compared.
The second sequence to be compared is not changed.
>>> s = SequenceMatcher(None, "abcd", "bcde")
>>> s.ratio()
0.75
>>> s.set_seq1("bcde")
>>> s.ratio()
1.0
>>>
SequenceMatcher computes and caches detailed information about the
second sequence, so if you want to compare one sequence S against many
sequences, use .set_seq2(S) once and call .set_seq1(x) repeatedly for
each of the other sequences.
See also set_seqs() and set_seq2().
set_seq2(b)
Set the second sequence to be compared.
The first sequence to be compared is not changed.
>>> s = SequenceMatcher(None, "abcd", "bcde")
>>> s.ratio()
0.75
>>> s.set_seq2("abcd")
>>> s.ratio()
1.0
>>>
SequenceMatcher computes and caches detailed information about the
second sequence, so if you want to compare one sequence S against many
sequences, use .set_seq2(S) once and call .set_seq1(x) repeatedly for
each of the other sequences.
See also set_seqs() and set_seq1().
find_longest_match(alo, ahi, blo, bhi)
Find longest matching block in a[alo:ahi] and b[blo:bhi].
If isjunk is not defined:
Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where
alo <= i <= i+k <= ahi
blo <= j <= j+k <= bhi
and for all (i',j',k') meeting those conditions,
k >= k'
i <= i'
and if i == i', j <= j'
In other words, of all maximal matching blocks, return one that starts
earliest in a, and of all those maximal matching blocks that start
earliest in a, return the one that starts earliest in b.
>>> s = SequenceMatcher(None, " abcd", "abcd abcd")
>>> s.find_longest_match(0, 5, 0, 9)
(0, 4, 5)
If isjunk is defined, first the longest matching block is determined as
above, but with the additional restriction that no junk element appears
in the block. Then that block is extended as far as possible by
matching (only) junk elements on both sides. So the resulting block
never matches on junk except as identical junk happens to be adjacent
to an "interesting" match.
Here's the same example as before, but considering blanks to be junk.
That prevents " abcd" from matching the " abcd" at the tail end of the
second sequence directly. Instead only the "abcd" can match, and
matches the leftmost "abcd" in the second sequence:
>>> s = SequenceMatcher(lambda x: x==" ", " abcd", "abcd abcd")
>>> s.find_longest_match(0, 5, 0, 9)
(1, 0, 4)
If no blocks match, return (alo, blo, 0).
>>> s = SequenceMatcher(None, "ab", "c")
>>> s.find_longest_match(0, 2, 0, 1)
(0, 0, 0)
get_matching_blocks()
Return list of triples describing matching subsequences.
Each triple is of the form (i, j, n), and means that
a[i:i+n] == b[j:j+n]. The triples are monotonically increasing in i
and in j.
The last triple is a dummy, (len(a), len(b), 0), and is the only triple
with n==0.
>>> s = SequenceMatcher(None, "abxcd", "abcd")
>>> s.get_matching_blocks()
[(0, 0, 2), (3, 2, 2), (5, 4, 0)]
get_opcodes()
Return list of 5-tuples describing how to turn a into b.
Each tuple is of the form (tag, i1, i2, j1, j2). The first tuple has
i1 == j1 == 0, and remaining tuples have i1 == the i2 from the tuple
preceding it, and likewise for j1 == the previous j2.
The tags are strings, with these meanings:
'replace': a[i1:i2] should be replaced by b[j1:j2]
'delete': a[i1:i2] should be deleted.
Note that j1==j2 in this case.
'insert': b[j1:j2] should be inserted at a[i1:i1].
Note that i1==i2 in this case.
'equal': a[i1:i2] == b[j1:j2]
>>> a = "qabxcd"
>>> b = "abycdf"
>>> s = SequenceMatcher(None, a, b)
>>> for tag, i1, i2, j1, j2 in s.get_opcodes():
... print ("%7s a[%d:%d] (%s) b[%d:%d] (%s)" %
... (tag, i1, i2, a[i1:i2], j1, j2, b[j1:j2]))
delete a[0:1] (q) b[0:0] ()
equal a[1:3] (ab) b[0:2] (ab)
replace a[3:4] (x) b[2:3] (y)
equal a[4:6] (cd) b[3:5] (cd)
insert a[6:6] () b[5:6] (f)
ratio()
Return a measure of the sequences' similarity (float in [0,1]).
Where T is the total number of elements in both sequences, and M is the
number of matches, this is 2,0*M / T. Note that this is 1 if the
sequences are identical, and 0 if they have nothing in common.
.ratio() is expensive to compute if you haven't already computed
.get_matching_blocks() or .get_opcodes(), in which case you may want to
try .quick_ratio() or .real_quick_ratio() first to get an upper bound.
>>> s = SequenceMatcher(None, "abcd", "bcde")
>>> s.ratio()
0.75
>>> s.quick_ratio()
0.75
>>> s.real_quick_ratio()
1.0
quick_ratio()
Return an upper bound on .ratio() relatively quickly.
This isn't defined beyond that it is an upper bound on .ratio(), and
is faster to compute.
real_quick_ratio():
Return an upper bound on ratio() very quickly.
This isn't defined beyond that it is an upper bound on .ratio(), and
is faster to compute than either .ratio() or .quick_ratio().
"""
TRACE = 0
class SequenceMatcher:
def __init__(self, isjunk=None, a='', b=''):
"""Construct a SequenceMatcher.
Optional arg isjunk is None (the default), or a one-argument
function that takes a sequence element and returns true iff the
element is junk. None is equivalent to passing "lambda x: 0", i.e.
no elements are considered to be junk. For example, pass
lambda x: x in " \\t"
if you're comparing lines as sequences of characters, and don't
want to synch up on blanks or hard tabs.
Optional arg a is the first of two sequences to be compared. By
default, an empty string. The elements of a must be hashable. See
also .set_seqs() and .set_seq1().
Optional arg b is the second of two sequences to be compared. By
default, an empty string. The elements of b must be hashable. See
also .set_seqs() and .set_seq2().
"""
# Members:
# a
# first sequence
# b
# second sequence; differences are computed as "what do
# we need to do to 'a' to change it into 'b'?"
# b2j
# for x in b, b2j[x] is a list of the indices (into b)
# at which x appears; junk elements do not appear
# b2jhas
# b2j.has_key
# fullbcount
# for x in b, fullbcount[x] == the number of times x
# appears in b; only materialized if really needed (used
# only for computing quick_ratio())
# matching_blocks
# a list of (i, j, k) triples, where a[i:i+k] == b[j:j+k];
# ascending & non-overlapping in i and in j; terminated by
# a dummy (len(a), len(b), 0) sentinel
# opcodes
# a list of (tag, i1, i2, j1, j2) tuples, where tag is
# one of
# 'replace' a[i1:i2] should be replaced by b[j1:j2]
# 'delete' a[i1:i2] should be deleted
# 'insert' b[j1:j2] should be inserted
# 'equal' a[i1:i2] == b[j1:j2]
# isjunk
# a user-supplied function taking a sequence element and
# returning true iff the element is "junk" -- this has
# subtle but helpful effects on the algorithm, which I'll
# get around to writing up someday <0.9 wink>.
# DON'T USE! Only __chain_b uses this. Use isbjunk.
# isbjunk
# for x in b, isbjunk(x) == isjunk(x) but much faster;
# it's really the has_key method of a hidden dict.
# DOES NOT WORK for x in a!
self.isjunk = isjunk
self.a = self.b = None
self.set_seqs(a, b)
def set_seqs(self, a, b):
"""Set the two sequences to be compared.
>>> s = SequenceMatcher()
>>> s.set_seqs("abcd", "bcde")
>>> s.ratio()
0.75
"""
self.set_seq1(a)
self.set_seq2(b)
def set_seq1(self, a):
"""Set the first sequence to be compared.
The second sequence to be compared is not changed.
>>> s = SequenceMatcher(None, "abcd", "bcde")
>>> s.ratio()
0.75
>>> s.set_seq1("bcde")
>>> s.ratio()
1.0
>>>
SequenceMatcher computes and caches detailed information about the
second sequence, so if you want to compare one sequence S against
many sequences, use .set_seq2(S) once and call .set_seq1(x)
repeatedly for each of the other sequences.
See also set_seqs() and set_seq2().
"""
if a is self.a:
return
self.a = a
self.matching_blocks = self.opcodes = None
def set_seq2(self, b):
"""Set the second sequence to be compared.
The first sequence to be compared is not changed.
>>> s = SequenceMatcher(None, "abcd", "bcde")
>>> s.ratio()
0.75
>>> s.set_seq2("abcd")
>>> s.ratio()
1.0
>>>
SequenceMatcher computes and caches detailed information about the
second sequence, so if you want to compare one sequence S against
many sequences, use .set_seq2(S) once and call .set_seq1(x)
repeatedly for each of the other sequences.
See also set_seqs() and set_seq1().
"""
if b is self.b:
return
self.b = b
self.matching_blocks = self.opcodes = None
self.fullbcount = None
self.__chain_b()
# For each element x in b, set b2j[x] to a list of the indices in
# b where x appears; the indices are in increasing order; note that
# the number of times x appears in b is len(b2j[x]) ...
# when self.isjunk is defined, junk elements don't show up in this
# map at all, which stops the central find_longest_match method
# from starting any matching block at a junk element ...
# also creates the fast isbjunk function ...
# note that this is only called when b changes; so for cross-product
# kinds of matches, it's best to call set_seq2 once, then set_seq1
# repeatedly
def __chain_b(self):
# Because isjunk is a user-defined (not C) function, and we test
# for junk a LOT, it's important to minimize the number of calls.
# Before the tricks described here, __chain_b was by far the most
# time-consuming routine in the whole module! If anyone sees
# Jim Roskind, thank him again for profile.py -- I never would
# have guessed that.
# The first trick is to build b2j ignoring the possibility
# of junk. I.e., we don't call isjunk at all yet. Throwing
# out the junk later is much cheaper than building b2j "right"
# from the start.
b = self.b
self.b2j = b2j = {}
self.b2jhas = b2jhas = b2j.has_key
for i in xrange(len(b)):
elt = b[i]
if b2jhas(elt):
b2j[elt].append(i)
else:
b2j[elt] = [i]
# Now b2j.keys() contains elements uniquely, and especially when
# the sequence is a string, that's usually a good deal smaller
# than len(string). The difference is the number of isjunk calls
# saved.
isjunk, junkdict = self.isjunk, {}
if isjunk:
for elt in b2j.keys():
if isjunk(elt):
junkdict[elt] = 1 # value irrelevant; it's a set
del b2j[elt]
# Now for x in b, isjunk(x) == junkdict.has_key(x), but the
# latter is much faster. Note too that while there may be a
# lot of junk in the sequence, the number of *unique* junk
# elements is probably small. So the memory burden of keeping
# this dict alive is likely trivial compared to the size of b2j.
self.isbjunk = junkdict.has_key
def find_longest_match(self, alo, ahi, blo, bhi):
"""Find longest matching block in a[alo:ahi] and b[blo:bhi].
If isjunk is not defined:
Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where
alo <= i <= i+k <= ahi
blo <= j <= j+k <= bhi
and for all (i',j',k') meeting those conditions,
k >= k'
i <= i'
and if i == i', j <= j'
In other words, of all maximal matching blocks, return one that
starts earliest in a, and of all those maximal matching blocks that
start earliest in a, return the one that starts earliest in b.
>>> s = SequenceMatcher(None, " abcd", "abcd abcd")
>>> s.find_longest_match(0, 5, 0, 9)
(0, 4, 5)
If isjunk is defined, first the longest matching block is
determined as above, but with the additional restriction that no
junk element appears in the block. Then that block is extended as
far as possible by matching (only) junk elements on both sides. So
the resulting block never matches on junk except as identical junk
happens to be adjacent to an "interesting" match.
Here's the same example as before, but considering blanks to be
junk. That prevents " abcd" from matching the " abcd" at the tail
end of the second sequence directly. Instead only the "abcd" can
match, and matches the leftmost "abcd" in the second sequence:
>>> s = SequenceMatcher(lambda x: x==" ", " abcd", "abcd abcd")
>>> s.find_longest_match(0, 5, 0, 9)
(1, 0, 4)
If no blocks match, return (alo, blo, 0).
>>> s = SequenceMatcher(None, "ab", "c")
>>> s.find_longest_match(0, 2, 0, 1)
(0, 0, 0)
"""
# CAUTION: stripping common prefix or suffix would be incorrect.
# E.g.,
# ab
# acab
# Longest matching block is "ab", but if common prefix is
# stripped, it's "a" (tied with "b"). UNIX(tm) diff does so
# strip, so ends up claiming that ab is changed to acab by
# inserting "ca" in the middle. That's minimal but unintuitive:
# "it's obvious" that someone inserted "ac" at the front.
# Windiff ends up at the same place as diff, but by pairing up
# the unique 'b's and then matching the first two 'a's.
a, b, b2j, isbjunk = self.a, self.b, self.b2j, self.isbjunk
besti, bestj, bestsize = alo, blo, 0
# find longest junk-free match
# during an iteration of the loop, j2len[j] = length of longest
# junk-free match ending with a[i-1] and b[j]
j2len = {}
nothing = []
for i in xrange(alo, ahi):
# look at all instances of a[i] in b; note that because
# b2j has no junk keys, the loop is skipped if a[i] is junk
j2lenget = j2len.get
newj2len = {}
for j in b2j.get(a[i], nothing):
# a[i] matches b[j]
if j < blo:
continue
if j >= bhi:
break
k = newj2len[j] = j2lenget(j-1, 0) + 1
if k > bestsize:
besti, bestj, bestsize = i-k+1, j-k+1, k
j2len = newj2len
# Now that we have a wholly interesting match (albeit possibly
# empty!), we may as well suck up the matching junk on each
# side of it too. Can't think of a good reason not to, and it
# saves post-processing the (possibly considerable) expense of
# figuring out what to do with it. In the case of an empty
# interesting match, this is clearly the right thing to do,
# because no other kind of match is possible in the regions.
while besti > alo and bestj > blo and \
isbjunk(b[bestj-1]) and \
a[besti-1] == b[bestj-1]:
besti, bestj, bestsize = besti-1, bestj-1, bestsize+1
while besti+bestsize < ahi and bestj+bestsize < bhi and \
isbjunk(b[bestj+bestsize]) and \
a[besti+bestsize] == b[bestj+bestsize]:
bestsize = bestsize + 1
if TRACE:
print "get_matching_blocks", alo, ahi, blo, bhi
print " returns", besti, bestj, bestsize
return besti, bestj, bestsize
def get_matching_blocks(self):
"""Return list of triples describing matching subsequences.
Each triple is of the form (i, j, n), and means that
a[i:i+n] == b[j:j+n]. The triples are monotonically increasing in
i and in j.
The last triple is a dummy, (len(a), len(b), 0), and is the only
triple with n==0.
>>> s = SequenceMatcher(None, "abxcd", "abcd")
>>> s.get_matching_blocks()
[(0, 0, 2), (3, 2, 2), (5, 4, 0)]
"""
if self.matching_blocks is not None:
return self.matching_blocks
self.matching_blocks = []
la, lb = len(self.a), len(self.b)
self.__helper(0, la, 0, lb, self.matching_blocks)
self.matching_blocks.append( (la, lb, 0) )
if TRACE:
print '*** matching blocks', self.matching_blocks
return self.matching_blocks
# builds list of matching blocks covering a[alo:ahi] and
# b[blo:bhi], appending them in increasing order to answer
def __helper(self, alo, ahi, blo, bhi, answer):
i, j, k = x = self.find_longest_match(alo, ahi, blo, bhi)
# a[alo:i] vs b[blo:j] unknown
# a[i:i+k] same as b[j:j+k]
# a[i+k:ahi] vs b[j+k:bhi] unknown
if k:
if alo < i and blo < j:
self.__helper(alo, i, blo, j, answer)
answer.append(x)
if i+k < ahi and j+k < bhi:
self.__helper(i+k, ahi, j+k, bhi, answer)
def get_opcodes(self):
"""Return list of 5-tuples describing how to turn a into b.
Each tuple is of the form (tag, i1, i2, j1, j2). The first tuple
has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the
tuple preceding it, and likewise for j1 == the previous j2.
The tags are strings, with these meanings:
'replace': a[i1:i2] should be replaced by b[j1:j2]
'delete': a[i1:i2] should be deleted.
Note that j1==j2 in this case.
'insert': b[j1:j2] should be inserted at a[i1:i1].
Note that i1==i2 in this case.
'equal': a[i1:i2] == b[j1:j2]
>>> a = "qabxcd"
>>> b = "abycdf"
>>> s = SequenceMatcher(None, a, b)
>>> for tag, i1, i2, j1, j2 in s.get_opcodes():
... print ("%7s a[%d:%d] (%s) b[%d:%d] (%s)" %
... (tag, i1, i2, a[i1:i2], j1, j2, b[j1:j2]))
delete a[0:1] (q) b[0:0] ()
equal a[1:3] (ab) b[0:2] (ab)
replace a[3:4] (x) b[2:3] (y)
equal a[4:6] (cd) b[3:5] (cd)
insert a[6:6] () b[5:6] (f)
"""
if self.opcodes is not None:
return self.opcodes
i = j = 0
self.opcodes = answer = []
for ai, bj, size in self.get_matching_blocks():
# invariant: we've pumped out correct diffs to change
# a[:i] into b[:j], and the next matching block is
# a[ai:ai+size] == b[bj:bj+size]. So we need to pump
# out a diff to change a[i:ai] into b[j:bj], pump out
# the matching block, and move (i,j) beyond the match
tag = ''
if i < ai and j < bj:
tag = 'replace'
elif i < ai:
tag = 'delete'
elif j < bj:
tag = 'insert'
if tag:
answer.append( (tag, i, ai, j, bj) )
i, j = ai+size, bj+size
# the list of matching blocks is terminated by a
# sentinel with size 0
if size:
answer.append( ('equal', ai, i, bj, j) )
return answer
def ratio(self):
"""Return a measure of the sequences' similarity (float in [0,1]).
Where T is the total number of elements in both sequences, and
M is the number of matches, this is 2,0*M / T.
Note that this is 1 if the sequences are identical, and 0 if
they have nothing in common.
.ratio() is expensive to compute if you haven't already computed
.get_matching_blocks() or .get_opcodes(), in which case you may
want to try .quick_ratio() or .real_quick_ratio() first to get an
upper bound.
>>> s = SequenceMatcher(None, "abcd", "bcde")
>>> s.ratio()
0.75
>>> s.quick_ratio()
0.75
>>> s.real_quick_ratio()
1.0
"""
matches = reduce(lambda sum, triple: sum + triple[-1],
self.get_matching_blocks(), 0)
return 2.0 * matches / (len(self.a) + len(self.b))
def quick_ratio(self):
"""Return an upper bound on ratio() relatively quickly.
This isn't defined beyond that it is an upper bound on .ratio(), and
is faster to compute.
"""
# viewing a and b as multisets, set matches to the cardinality
# of their intersection; this counts the number of matches
# without regard to order, so is clearly an upper bound
if self.fullbcount is None:
self.fullbcount = fullbcount = {}
for elt in self.b:
fullbcount[elt] = fullbcount.get(elt, 0) + 1
fullbcount = self.fullbcount
# avail[x] is the number of times x appears in 'b' less the
# number of times we've seen it in 'a' so far ... kinda
avail = {}
availhas, matches = avail.has_key, 0
for elt in self.a:
if availhas(elt):
numb = avail[elt]
else:
numb = fullbcount.get(elt, 0)
avail[elt] = numb - 1
if numb > 0:
matches = matches + 1
return 2.0 * matches / (len(self.a) + len(self.b))
def real_quick_ratio(self):
"""Return an upper bound on ratio() very quickly.
This isn't defined beyond that it is an upper bound on .ratio(), and
is faster to compute than either .ratio() or .quick_ratio().
"""
la, lb = len(self.a), len(self.b)
# can't have more matches than the number of elements in the
# shorter sequence
return 2.0 * min(la, lb) / (la + lb)
def get_close_matches(word, possibilities, n=3, cutoff=0.6):
"""Use SequenceMatcher to return list of the best "good enough" matches.
word is a sequence for which close matches are desired (typically a
string).
possibilities is a list of sequences against which to match word
(typically a list of strings).
Optional arg n (default 3) is the maximum number of close matches to
return. n must be > 0.
Optional arg cutoff (default 0.6) is a float in [0, 1]. Possibilities
that don't score at least that similar to word are ignored.
The best (no more than n) matches among the possibilities are returned
in a list, sorted by similarity score, most similar first.
>>> get_close_matches("appel", ["ape", "apple", "peach", "puppy"])
['apple', 'ape']
>>> import keyword
>>> get_close_matches("wheel", keyword.kwlist)
['while']
>>> get_close_matches("apple", keyword.kwlist)
[]
>>> get_close_matches("accept", keyword.kwlist)
['except']
"""
if not n > 0:
raise ValueError("n must be > 0: " + `n`)
if not 0.0 <= cutoff <= 1.0:
raise ValueError("cutoff must be in [0.0, 1.0]: " + `cutoff`)
result = []
s = SequenceMatcher()
s.set_seq2(word)
for x in possibilities:
s.set_seq1(x)
if s.real_quick_ratio() >= cutoff and \
s.quick_ratio() >= cutoff and \
s.ratio() >= cutoff:
result.append((s.ratio(), x))
# Sort by score.
result.sort()
# Retain only the best n.
result = result[-n:]
# Move best-scorer to head of list.
result.reverse()
# Strip scores.
# Python 2.x list comprehensions: return [x for score, x in result]
return_result = []
for score, x in result:
return_result.append(x)
return return_result
def _test():
import doctest, difflib
return doctest.testmod(difflib)
if __name__ == "__main__":
_test()

346
lib/compat_ndiff.py Normal file
View File

@@ -0,0 +1,346 @@
#! /usr/bin/env python
# Module ndiff version 1.6.0
# Released to the public domain 08-Dec-2000,
# by Tim Peters (tim.one@home.com).
# Backported to Python 1.5.2 for ViewCVS by pf@artcom-gmbh.de, 24-Dec-2001
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
"""ndiff [-q] file1 file2
or
ndiff (-r1 | -r2) < ndiff_output > file1_or_file2
Print a human-friendly file difference report to stdout. Both inter-
and intra-line differences are noted. In the second form, recreate file1
(-r1) or file2 (-r2) on stdout, from an ndiff report on stdin.
In the first form, if -q ("quiet") is not specified, the first two lines
of output are
-: file1
+: file2
Each remaining line begins with a two-letter code:
"- " line unique to file1
"+ " line unique to file2
" " line common to both files
"? " line not present in either input file
Lines beginning with "? " attempt to guide the eye to intraline
differences, and were not present in either input file. These lines can be
confusing if the source files contain tab characters.
The first file can be recovered by retaining only lines that begin with
" " or "- ", and deleting those 2-character prefixes; use ndiff with -r1.
The second file can be recovered similarly, but by retaining only " " and
"+ " lines; use ndiff with -r2; or, on Unix, the second file can be
recovered by piping the output through
sed -n '/^[+ ] /s/^..//p'
See module comments for details and programmatic interface.
"""
__version__ = 1, 6, 1
# SequenceMatcher tries to compute a "human-friendly diff" between
# two sequences (chiefly picturing a file as a sequence of lines,
# and a line as a sequence of characters, here). Unlike e.g. UNIX(tm)
# diff, the fundamental notion is the longest *contiguous* & junk-free
# matching subsequence. That's what catches peoples' eyes. The
# Windows(tm) windiff has another interesting notion, pairing up elements
# that appear uniquely in each sequence. That, and the method here,
# appear to yield more intuitive difference reports than does diff. This
# method appears to be the least vulnerable to synching up on blocks
# of "junk lines", though (like blank lines in ordinary text files,
# or maybe "<P>" lines in HTML files). That may be because this is
# the only method of the 3 that has a *concept* of "junk" <wink>.
#
# Note that ndiff makes no claim to produce a *minimal* diff. To the
# contrary, minimal diffs are often counter-intuitive, because they
# synch up anywhere possible, sometimes accidental matches 100 pages
# apart. Restricting synch points to contiguous matches preserves some
# notion of locality, at the occasional cost of producing a longer diff.
#
# With respect to junk, an earlier version of ndiff simply refused to
# *start* a match with a junk element. The result was cases like this:
# before: private Thread currentThread;
# after: private volatile Thread currentThread;
# If you consider whitespace to be junk, the longest contiguous match
# not starting with junk is "e Thread currentThread". So ndiff reported
# that "e volatil" was inserted between the 't' and the 'e' in "private".
# While an accurate view, to people that's absurd. The current version
# looks for matching blocks that are entirely junk-free, then extends the
# longest one of those as far as possible but only with matching junk.
# So now "currentThread" is matched, then extended to suck up the
# preceding blank; then "private" is matched, and extended to suck up the
# following blank; then "Thread" is matched; and finally ndiff reports
# that "volatile " was inserted before "Thread". The only quibble
# remaining is that perhaps it was really the case that " volatile"
# was inserted after "private". I can live with that <wink>.
#
# NOTE on junk: the module-level names
# IS_LINE_JUNK
# IS_CHARACTER_JUNK
# can be set to any functions you like. The first one should accept
# a single string argument, and return true iff the string is junk.
# The default is whether the regexp r"\s*#?\s*$" matches (i.e., a
# line without visible characters, except for at most one splat).
# The second should accept a string of length 1 etc. The default is
# whether the character is a blank or tab (note: bad idea to include
# newline in this!).
#
# After setting those, you can call fcompare(f1name, f2name) with the
# names of the files you want to compare. The difference report
# is sent to stdout. Or you can call main(args), passing what would
# have been in sys.argv[1:] had the cmd-line form been used.
from compat_difflib import SequenceMatcher
TRACE = 0
# define what "junk" means
import re
def IS_LINE_JUNK(line, pat=re.compile(r"\s*#?\s*$").match):
return pat(line) is not None
def IS_CHARACTER_JUNK(ch, ws=" \t"):
return ch in ws
del re
# meant for dumping lines
def dump(tag, x, lo, hi):
for i in xrange(lo, hi):
print tag, x[i],
def plain_replace(a, alo, ahi, b, blo, bhi):
assert alo < ahi and blo < bhi
# dump the shorter block first -- reduces the burden on short-term
# memory if the blocks are of very different sizes
if bhi - blo < ahi - alo:
dump('+', b, blo, bhi)
dump('-', a, alo, ahi)
else:
dump('-', a, alo, ahi)
dump('+', b, blo, bhi)
# When replacing one block of lines with another, this guy searches
# the blocks for *similar* lines; the best-matching pair (if any) is
# used as a synch point, and intraline difference marking is done on
# the similar pair. Lots of work, but often worth it.
def fancy_replace(a, alo, ahi, b, blo, bhi):
if TRACE:
print '*** fancy_replace', alo, ahi, blo, bhi
dump('>', a, alo, ahi)
dump('<', b, blo, bhi)
# don't synch up unless the lines have a similarity score of at
# least cutoff; best_ratio tracks the best score seen so far
best_ratio, cutoff = 0.74, 0.75
cruncher = SequenceMatcher(IS_CHARACTER_JUNK)
eqi, eqj = None, None # 1st indices of equal lines (if any)
# search for the pair that matches best without being identical
# (identical lines must be junk lines, & we don't want to synch up
# on junk -- unless we have to)
for j in xrange(blo, bhi):
bj = b[j]
cruncher.set_seq2(bj)
for i in xrange(alo, ahi):
ai = a[i]
if ai == bj:
if eqi is None:
eqi, eqj = i, j
continue
cruncher.set_seq1(ai)
# computing similarity is expensive, so use the quick
# upper bounds first -- have seen this speed up messy
# compares by a factor of 3.
# note that ratio() is only expensive to compute the first
# time it's called on a sequence pair; the expensive part
# of the computation is cached by cruncher
if cruncher.real_quick_ratio() > best_ratio and \
cruncher.quick_ratio() > best_ratio and \
cruncher.ratio() > best_ratio:
best_ratio, best_i, best_j = cruncher.ratio(), i, j
if best_ratio < cutoff:
# no non-identical "pretty close" pair
if eqi is None:
# no identical pair either -- treat it as a straight replace
plain_replace(a, alo, ahi, b, blo, bhi)
return
# no close pair, but an identical pair -- synch up on that
best_i, best_j, best_ratio = eqi, eqj, 1.0
else:
# there's a close pair, so forget the identical pair (if any)
eqi = None
# a[best_i] very similar to b[best_j]; eqi is None iff they're not
# identical
if TRACE:
print '*** best_ratio', best_ratio, best_i, best_j
dump('>', a, best_i, best_i+1)
dump('<', b, best_j, best_j+1)
# pump out diffs from before the synch point
fancy_helper(a, alo, best_i, b, blo, best_j)
# do intraline marking on the synch pair
aelt, belt = a[best_i], b[best_j]
if eqi is None:
# pump out a '-', '?', '+', '?' quad for the synched lines
atags = btags = ""
cruncher.set_seqs(aelt, belt)
for tag, ai1, ai2, bj1, bj2 in cruncher.get_opcodes():
la, lb = ai2 - ai1, bj2 - bj1
if tag == 'replace':
atags = atags + '^' * la
btags = btags + '^' * lb
elif tag == 'delete':
atags = atags + '-' * la
elif tag == 'insert':
btags = btags + '+' * lb
elif tag == 'equal':
atags = atags + ' ' * la
btags = btags + ' ' * lb
else:
raise ValueError, 'unknown tag ' + `tag`
printq(aelt, belt, atags, btags)
else:
# the synch pair is identical
print ' ', aelt,
# pump out diffs from after the synch point
fancy_helper(a, best_i+1, ahi, b, best_j+1, bhi)
def fancy_helper(a, alo, ahi, b, blo, bhi):
if alo < ahi:
if blo < bhi:
fancy_replace(a, alo, ahi, b, blo, bhi)
else:
dump('-', a, alo, ahi)
elif blo < bhi:
dump('+', b, blo, bhi)
# Crap to deal with leading tabs in "?" output. Can hurt, but will
# probably help most of the time.
def printq(aline, bline, atags, btags):
common = min(count_leading(aline, "\t"),
count_leading(bline, "\t"))
common = min(common, count_leading(atags[:common], " "))
print "-", aline,
if count_leading(atags, " ") < len(atags):
print "?", "\t" * common + atags[common:]
print "+", bline,
if count_leading(btags, " ") < len(btags):
print "?", "\t" * common + btags[common:]
def count_leading(line, ch):
i, n = 0, len(line)
while i < n and line[i] == ch:
i = i+1
return i
def fail(msg):
import sys
out = sys.stderr.write
out(msg + "\n\n")
out(__doc__)
return 0
# open a file & return the file object; gripe and return 0 if it
# couldn't be opened
def fopen(fname):
try:
return open(fname, 'r')
except IOError, detail:
return fail("couldn't open " + fname + ": " + str(detail))
# open two files & spray the diff to stdout; return false iff a problem
def fcompare(f1name, f2name):
f1 = fopen(f1name)
f2 = fopen(f2name)
if not f1 or not f2:
return 0
a = f1.readlines(); f1.close()
b = f2.readlines(); f2.close()
cruncher = SequenceMatcher(IS_LINE_JUNK, a, b)
for tag, alo, ahi, blo, bhi in cruncher.get_opcodes():
if tag == 'replace':
fancy_replace(a, alo, ahi, b, blo, bhi)
elif tag == 'delete':
dump('-', a, alo, ahi)
elif tag == 'insert':
dump('+', b, blo, bhi)
elif tag == 'equal':
dump(' ', a, alo, ahi)
else:
raise ValueError, 'unknown tag ' + `tag`
return 1
# crack args (sys.argv[1:] is normal) & compare;
# return false iff a problem
def main(args):
import getopt
try:
opts, args = getopt.getopt(args, "qr:")
except getopt.error, detail:
return fail(str(detail))
noisy = 1
qseen = rseen = 0
for opt, val in opts:
if opt == "-q":
qseen = 1
noisy = 0
elif opt == "-r":
rseen = 1
whichfile = val
if qseen and rseen:
return fail("can't specify both -q and -r")
if rseen:
if args:
return fail("no args allowed with -r option")
if whichfile in "12":
restore(whichfile)
return 1
return fail("-r value must be 1 or 2")
if len(args) != 2:
return fail("need 2 filename args")
f1name, f2name = args
if noisy:
print '-:', f1name
print '+:', f2name
return fcompare(f1name, f2name)
def restore(which):
import sys
tag = {"1": "- ", "2": "+ "}[which]
prefixes = (" ", tag)
for line in sys.stdin.readlines():
if line[:2] in prefixes:
print line[2:],
if __name__ == '__main__':
import sys
args = sys.argv[1:]
if "-profile" in args:
import profile, pstats
args.remove("-profile")
statf = "ndiff.pro"
profile.run("main(args)", statf)
stats = pstats.Stats(statf)
stats.strip_dirs().sort_stats('time').print_stats()
else:
main(args)

507
lib/config.py Normal file
View File

@@ -0,0 +1,507 @@
# -*-python-*-
#
# Copyright (C) 1999-2011 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# config.py: configuration utilities
#
# -----------------------------------------------------------------------
import sys
import os
import string
import ConfigParser
import fnmatch
#########################################################################
#
# CONFIGURATION
# -------------
#
# There are three forms of configuration:
#
# 1. edit the viewvc.conf created by the viewvc-install(er)
# 2. as (1), but delete all unchanged entries from viewvc.conf
# 3. do not use viewvc.conf and just edit the defaults in this file
#
# Most users will want to use (1), but there are slight speed advantages
# to the other two options. Note that viewvc.conf values are a bit easier
# to work with since it is raw text, rather than python literal values.
#
#
# A WORD ABOUT OPTION LAYERING/OVERRIDES
# --------------------------------------
#
# ViewVC has three "layers" of configuration options:
#
# 1. base configuration options - very basic configuration bits
# found in sections like 'general', 'options', etc.
# 2. vhost overrides - these options overlay/override the base
# configuration on a per-vhost basis.
# 3. root overrides - these options overlay/override the base
# configuration and vhost overrides on a per-root basis.
#
# Here's a diagram of the valid overlays/overrides:
#
# PER-ROOT PER-VHOST BASE
#
# ,-----------. ,-----------.
# | vhost-*/ | | |
# | general | --> | general |
# | | | |
# `-----------' `-----------'
# ,-----------. ,-----------. ,-----------.
# | root-*/ | | vhost-*/ | | |
# | options | --> | options | --> | options |
# | | | | | |
# `-----------' `-----------' `-----------'
# ,-----------. ,-----------. ,-----------.
# | root-*/ | | vhost-*/ | | |
# | templates | --> | templates | --> | templates |
# | | | | | |
# `-----------' `-----------' `-----------'
# ,-----------. ,-----------. ,-----------.
# | root-*/ | | vhost-*/ | | |
# | utilities | --> | utilities | --> | utilities |
# | | | | | |
# `-----------' `-----------' `-----------'
# ,-----------. ,-----------.
# | vhost-*/ | | |
# | cvsdb | --> | cvsdb |
# | | | |
# `-----------' `-----------'
# ,-----------. ,-----------. ,-----------.
# | root-*/ | | vhost-*/ | | |
# | authz-* | --> | authz-* | --> | authz-* |
# | | | | | |
# `-----------' `-----------' `-----------'
# ,-----------.
# | |
# | vhosts |
# | |
# `-----------'
# ,-----------.
# | |
# | query |
# | |
# `-----------'
#
# ### TODO: Figure out what this all means for the 'kv' stuff.
#
#########################################################################
class Config:
_base_sections = (
# Base configuration sections.
'authz-*',
'cvsdb',
'general',
'options',
'query',
'templates',
'utilities',
)
_force_multi_value = (
# Configuration values with multiple, comma-separated values.
'allowed_views',
'cvs_roots',
'kv_files',
'languages',
'mime_types_files',
'root_parents',
'svn_roots',
)
_allowed_overrides = {
# Mapping of override types to allowed overridable sections.
'vhost' : ('authz-*',
'cvsdb',
'general',
'options',
'templates',
'utilities',
),
'root' : ('authz-*',
'options',
'templates',
'utilities',
)
}
def __init__(self):
self.root_options_overlayed = 0
for section in self._base_sections:
if section[-1] == '*':
continue
setattr(self, section, _sub_config())
def load_config(self, pathname, vhost=None):
"""Load the configuration file at PATHNAME, applying configuration
settings there as overrides to the built-in default values. If
VHOST is provided, also process the configuration overrides
specific to that virtual host."""
self.conf_path = os.path.isfile(pathname) and pathname or None
self.base = os.path.dirname(pathname)
self.parser = ConfigParser.ConfigParser()
self.parser.optionxform = lambda x: x # don't case-normalize option names.
self.parser.read(self.conf_path or [])
for section in self.parser.sections():
if self._is_allowed_section(section, self._base_sections):
self._process_section(self.parser, section, section)
if vhost and self.parser.has_section('vhosts'):
self._process_vhost(self.parser, vhost)
def load_kv_files(self, language):
"""Process the key/value (kv) files specified in the
configuration, merging their values into the configuration as
dotted heirarchical items."""
kv = _sub_config()
for fname in self.general.kv_files:
if fname[0] == '[':
idx = string.index(fname, ']')
parts = string.split(fname[1:idx], '.')
fname = string.strip(fname[idx+1:])
else:
parts = [ ]
fname = string.replace(fname, '%lang%', language)
parser = ConfigParser.ConfigParser()
parser.optionxform = lambda x: x # don't case-normalize option names.
parser.read(os.path.join(self.base, fname))
for section in parser.sections():
for option in parser.options(section):
full_name = parts + [section]
ob = kv
for name in full_name:
try:
ob = getattr(ob, name)
except AttributeError:
c = _sub_config()
setattr(ob, name, c)
ob = c
setattr(ob, option, parser.get(section, option))
return kv
def path(self, path):
"""Return PATH relative to the config file directory."""
return os.path.join(self.base, path)
def _process_section(self, parser, section, subcfg_name):
if not hasattr(self, subcfg_name):
setattr(self, subcfg_name, _sub_config())
sc = getattr(self, subcfg_name)
for opt in parser.options(section):
value = parser.get(section, opt)
if opt in self._force_multi_value:
value = map(string.strip, filter(None, string.split(value, ',')))
else:
try:
value = int(value)
except ValueError:
pass
### FIXME: This feels like unnecessary depth of knowledge for a
### semi-generic configuration object.
if opt == 'cvs_roots' or opt == 'svn_roots':
value = _parse_roots(opt, value)
setattr(sc, opt, value)
def _is_allowed_section(self, section, allowed_sections):
"""Return 1 iff SECTION is an allowed section, defined as being
explicitly present in the ALLOWED_SECTIONS list or present in the
form 'someprefix-*' in that list."""
for allowed_section in allowed_sections:
if allowed_section[-1] == '*':
if _startswith(section, allowed_section[:-1]):
return 1
elif allowed_section == section:
return 1
return 0
def _is_allowed_override(self, sectype, secspec, section):
"""Test if SECTION is an allowed override section for sections of
type SECTYPE ('vhosts' or 'root', currently) and type-specifier
SECSPEC (a rootname or vhostname, currently). If it is, return
the overridden base section name. If it's not an override section
at all, return None. And if it's an override section but not an
allowed one, raise IllegalOverrideSection."""
cv = '%s-%s/' % (sectype, secspec)
lcv = len(cv)
if section[:lcv] != cv:
return None
base_section = section[lcv:]
if self._is_allowed_section(base_section,
self._allowed_overrides[sectype]):
return base_section
raise IllegalOverrideSection(sectype, section)
def _process_vhost(self, parser, vhost):
# Find a vhost name for this VHOST, if any (else, we've nothing to do).
canon_vhost = self._find_canon_vhost(parser, vhost)
if not canon_vhost:
return
# Overlay any option sections associated with this vhost name.
for section in parser.sections():
base_section = self._is_allowed_override('vhost', canon_vhost, section)
if base_section:
self._process_section(parser, section, base_section)
def _find_canon_vhost(self, parser, vhost):
vhost = string.split(string.lower(vhost), ':')[0] # lower-case, no port
for canon_vhost in parser.options('vhosts'):
value = parser.get('vhosts', canon_vhost)
patterns = map(string.lower, map(string.strip,
filter(None, string.split(value, ','))))
for pat in patterns:
if fnmatch.fnmatchcase(vhost, pat):
return canon_vhost
return None
def overlay_root_options(self, rootname):
"""Overlay per-root options for ROOTNAME atop the existing option
set. This is a destructive change to the configuration."""
did_overlay = 0
if not self.conf_path:
return
for section in self.parser.sections():
base_section = self._is_allowed_override('root', rootname, section)
if base_section:
# We can currently only deal with root overlays happening
# once, so check that we've not yet done any overlaying of
# per-root options.
assert(self.root_options_overlayed == 0)
self._process_section(self.parser, section, base_section)
did_overlay = 1
# If we actually did any overlaying, remember this fact so we
# don't do it again later.
if did_overlay:
self.root_options_overlayed = 1
def _get_parser_items(self, parser, section):
"""Basically implement ConfigParser.items() for pre-Python-2.3 versions."""
try:
return self.parser.items(section)
except AttributeError:
d = {}
for option in parser.options(section):
d[option] = parser.get(section, option)
return d.items()
def get_authorizer_and_params_hack(self, rootname):
"""Return a 2-tuple containing the name and parameters of the
authorizer configured for use with ROOTNAME.
### FIXME: This whole thing is a hack caused by our not being able
### to non-destructively overlay root options when trying to do
### something like a root listing (which might need to get
### different authorizer bits for each and every root in the list).
### Until we have a good way to do that, we expose this function,
### which assumes that base and per-vhost configuration has been
### absorbed into this object and that per-root options have *not*
### been overlayed. See issue #371."""
# We assume that per-root options have *not* been overlayed.
assert(self.root_options_overlayed == 0)
if not self.conf_path:
return None, {}
# Figure out the authorizer by searching first for a per-root
# override, then falling back to the base/vhost configuration.
authorizer = None
root_options_section = 'root-%s/options' % (rootname)
if self.parser.has_section(root_options_section) \
and self.parser.has_option(root_options_section, 'authorizer'):
authorizer = self.parser.get(root_options_section, 'authorizer')
if not authorizer:
authorizer = self.options.authorizer
# No authorizer? Get outta here.
if not authorizer:
return None, {}
# Dig up the parameters for the authorizer, starting with the
# base/vhost items, then overlaying any root-specific ones we find.
params = {}
authz_section = 'authz-%s' % (authorizer)
if hasattr(self, authz_section):
sub_config = getattr(self, authz_section)
for attr in dir(sub_config):
params[attr] = getattr(sub_config, attr)
root_authz_section = 'root-%s/authz-%s' % (rootname, authorizer)
for section in self.parser.sections():
if section == root_authz_section:
for key, value in self._get_parser_items(self.parser, section):
params[key] = value
return authorizer, params
def get_authorizer_params(self, authorizer=None):
"""Return a dictionary of parameter names and values which belong
to the configured authorizer (or AUTHORIZER, if provided)."""
params = {}
if authorizer is None:
authorizer = self.options.authorizer
if authorizer:
authz_section = 'authz-%s' % (self.options.authorizer)
if hasattr(self, authz_section):
sub_config = getattr(self, authz_section)
for attr in dir(sub_config):
params[attr] = getattr(sub_config, attr)
return params
def set_defaults(self):
"Set some default values in the configuration."
self.general.cvs_roots = { }
self.general.svn_roots = { }
self.general.root_parents = []
self.general.default_root = ''
self.general.mime_types_files = ["mimetypes.conf"]
self.general.address = ''
self.general.kv_files = [ ]
self.general.languages = ['en-us']
self.utilities.rcs_dir = ''
if sys.platform == "win32":
self.utilities.cvsnt = 'cvs'
else:
self.utilities.cvsnt = None
self.utilities.svn = ''
self.utilities.diff = ''
self.utilities.cvsgraph = ''
self.options.root_as_url_component = 1
self.options.checkout_magic = 0
self.options.allowed_views = ['annotate', 'diff', 'markup', 'roots']
self.options.authorizer = None
self.options.mangle_email_addresses = 0
self.options.default_file_view = "log"
self.options.http_expiration_time = 600
self.options.generate_etags = 1
self.options.svn_ignore_mimetype = 0
self.options.svn_config_dir = None
self.options.use_rcsparse = 0
self.options.sort_by = 'file'
self.options.sort_group_dirs = 1
self.options.hide_attic = 1
self.options.hide_errorful_entries = 0
self.options.log_sort = 'date'
self.options.diff_format = 'h'
self.options.hide_cvsroot = 1
self.options.hr_breakable = 1
self.options.hr_funout = 1
self.options.hr_ignore_white = 0
self.options.hr_ignore_keyword_subst = 1
self.options.hr_intraline = 0
self.options.allow_compress = 0
self.options.template_dir = "templates"
self.options.docroot = None
self.options.show_subdir_lastmod = 0
self.options.show_roots_lastmod = 0
self.options.show_logs = 1
self.options.show_log_in_markup = 1
self.options.cross_copies = 1
self.options.use_localtime = 0
self.options.short_log_len = 80
self.options.enable_syntax_coloration = 1
self.options.tabsize = 8
self.options.detect_encoding = 0
self.options.use_cvsgraph = 0
self.options.cvsgraph_conf = "cvsgraph.conf"
self.options.use_re_search = 0
self.options.dir_pagesize = 0
self.options.log_pagesize = 0
self.options.log_pagesextra = 3
self.options.limit_changes = 100
self.templates.diff = None
self.templates.directory = None
self.templates.error = None
self.templates.file = None
self.templates.graph = None
self.templates.log = None
self.templates.query = None
self.templates.query_form = None
self.templates.query_results = None
self.templates.roots = None
self.cvsdb.enabled = 0
self.cvsdb.host = ''
self.cvsdb.port = 3306
self.cvsdb.database_name = ''
self.cvsdb.user = ''
self.cvsdb.passwd = ''
self.cvsdb.readonly_user = ''
self.cvsdb.readonly_passwd = ''
self.cvsdb.row_limit = 1000
self.cvsdb.rss_row_limit = 100
self.cvsdb.check_database_for_root = 0
self.query.viewvc_base_url = None
def _startswith(somestr, substr):
return somestr[:len(substr)] == substr
def _parse_roots(config_name, config_value):
roots = { }
for root in config_value:
pos = string.find(root, ':')
if pos < 0:
raise MalformedRoot(config_name, root)
name, path = map(string.strip, (root[:pos], root[pos+1:]))
roots[name] = path
return roots
class ViewVCConfigurationError(Exception):
pass
class IllegalOverrideSection(ViewVCConfigurationError):
def __init__(self, override_type, section_name):
self.section_name = section_name
self.override_type = override_type
def __str__(self):
return "malformed configuration: illegal %s override section: %s" \
% (self.override_type, self.section_name)
class MalformedRoot(ViewVCConfigurationError):
def __init__(self, config_name, value_given):
Exception.__init__(self, config_name, value_given)
self.config_name = config_name
self.value_given = value_given
def __str__(self):
return "malformed configuration: '%s' uses invalid syntax: %s" \
% (self.config_name, self.value_given)
class _sub_config:
pass
if not hasattr(sys, 'hexversion'):
# Python 1.5 or 1.5.1. fix the syntax for ConfigParser options.
import regex
ConfigParser.option_cre = regex.compile('^\([-A-Za-z0-9._]+\)\(:\|['
+ string.whitespace
+ ']*=\)\(.*\)$')

980
lib/cvsdb.py Normal file
View File

@@ -0,0 +1,980 @@
# -*-python-*-
#
# Copyright (C) 1999-2011 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
import os
import sys
import string
import time
import fnmatch
import re
import vclib
import dbi
## Current commits database schema version number.
##
## Version 0 was the original Bonsai-compatible version.
##
## Version 1 added the 'metadata' table (which holds the 'version' key)
## and renamed all the 'repository'-related stuff to be 'root'-
##
CURRENT_SCHEMA_VERSION = 1
## error
error = "cvsdb error"
## CheckinDatabase provides all interfaces needed to the SQL database
## back-end; it needs to be subclassed, and have its "Connect" method
## defined to actually be complete; it should run well off of any DBI 2.0
## complient database interface
class CheckinDatabase:
def __init__(self, host, port, user, passwd, database):
self._host = host
self._port = port
self._user = user
self._passwd = passwd
self._database = database
self._version = None
## database lookup caches
self._get_cache = {}
self._get_id_cache = {}
self._desc_id_cache = {}
def Connect(self):
self.db = dbi.connect(
self._host, self._port, self._user, self._passwd, self._database)
cursor = self.db.cursor()
cursor.execute("SET AUTOCOMMIT=1")
table_list = self.GetTableList()
if 'metadata' in table_list:
version = self.GetMetadataValue("version")
if version is None:
self._version = 0
else:
self._version = int(version)
else:
self._version = 0
if self._version > CURRENT_SCHEMA_VERSION:
raise DatabaseVersionError("Database version %d is newer than the "
"last version supported by this "
"software." % (self._version))
def sql_get_id(self, table, column, value, auto_set):
sql = "SELECT id FROM %s WHERE %s=%%s" % (table, column)
sql_args = (value, )
cursor = self.db.cursor()
cursor.execute(sql, sql_args)
try:
(id, ) = cursor.fetchone()
except TypeError:
if not auto_set:
return None
else:
return str(int(id))
## insert the new identifier
sql = "INSERT INTO %s(%s) VALUES(%%s)" % (table, column)
sql_args = (value, )
cursor.execute(sql, sql_args)
return self.sql_get_id(table, column, value, 0)
def get_id(self, table, column, value, auto_set):
## attempt to retrieve from cache
try:
return self._get_id_cache[table][column][value]
except KeyError:
pass
id = self.sql_get_id(table, column, value, auto_set)
if id == None:
return None
## add to cache
try:
temp = self._get_id_cache[table]
except KeyError:
temp = self._get_id_cache[table] = {}
try:
temp2 = temp[column]
except KeyError:
temp2 = temp[column] = {}
temp2[value] = id
return id
def sql_get(self, table, column, id):
sql = "SELECT %s FROM %s WHERE id=%%s" % (column, table)
sql_args = (id, )
cursor = self.db.cursor()
cursor.execute(sql, sql_args)
try:
(value, ) = cursor.fetchone()
except TypeError:
return None
return value
def get(self, table, column, id):
## attempt to retrieve from cache
try:
return self._get_cache[table][column][id]
except KeyError:
pass
value = self.sql_get(table, column, id)
if value == None:
return None
## add to cache
try:
temp = self._get_cache[table]
except KeyError:
temp = self._get_cache[table] = {}
try:
temp2 = temp[column]
except KeyError:
temp2 = temp[column] = {}
temp2[id] = value
return value
def get_list(self, table, field_index):
sql = "SELECT * FROM %s" % (table)
cursor = self.db.cursor()
cursor.execute(sql)
list = []
while 1:
row = cursor.fetchone()
if row == None:
break
list.append(row[field_index])
return list
def GetCommitsTable(self):
return self._version >= 1 and 'commits' or 'checkins'
def GetTableList(self):
sql = "SHOW TABLES"
cursor = self.db.cursor()
cursor.execute(sql)
list = []
while 1:
row = cursor.fetchone()
if row == None:
break
list.append(row[0])
return list
def GetMetadataValue(self, name):
sql = "SELECT value FROM metadata WHERE name=%s"
sql_args = (name)
cursor = self.db.cursor()
cursor.execute(sql, sql_args)
try:
(value,) = cursor.fetchone()
except TypeError:
return None
return value
def SetMetadataValue(self, name, value):
assert(self._version > 0)
sql = "REPLACE INTO metadata (name, value) VALUES (%s, %s)"
sql_args = (name, value)
cursor = self.db.cursor()
try:
cursor.execute(sql, sql_args)
except Exception, e:
raise Exception("Error setting metadata: '%s'\n"
"\tname = %s\n"
"\tvalue = %s\n"
% (str(e), name, value))
def GetBranchID(self, branch, auto_set = 1):
return self.get_id("branches", "branch", branch, auto_set)
def GetBranch(self, id):
return self.get("branches", "branch", id)
def GetDirectoryID(self, dir, auto_set = 1):
return self.get_id("dirs", "dir", dir, auto_set)
def GetDirectory(self, id):
return self.get("dirs", "dir", id)
def GetFileID(self, file, auto_set = 1):
return self.get_id("files", "file", file, auto_set)
def GetFile(self, id):
return self.get("files", "file", id)
def GetAuthorID(self, author, auto_set = 1):
return self.get_id("people", "who", author, auto_set)
def GetAuthor(self, id):
return self.get("people", "who", id)
def GetRepositoryID(self, repository, auto_set = 1):
return self.get_id("repositories", "repository", repository, auto_set)
def GetRepository(self, id):
return self.get("repositories", "repository", id)
def SQLGetDescriptionID(self, description, auto_set = 1):
## lame string hash, blame Netscape -JMP
hash = len(description)
sql = "SELECT id FROM descs WHERE hash=%s AND description=%s"
sql_args = (hash, description)
cursor = self.db.cursor()
cursor.execute(sql, sql_args)
try:
(id, ) = cursor.fetchone()
except TypeError:
if not auto_set:
return None
else:
return str(int(id))
sql = "INSERT INTO descs (hash,description) values (%s,%s)"
sql_args = (hash, description)
cursor.execute(sql, sql_args)
return self.GetDescriptionID(description, 0)
def GetDescriptionID(self, description, auto_set = 1):
## attempt to retrieve from cache
hash = len(description)
try:
return self._desc_id_cache[hash][description]
except KeyError:
pass
id = self.SQLGetDescriptionID(description, auto_set)
if id == None:
return None
## add to cache
try:
temp = self._desc_id_cache[hash]
except KeyError:
temp = self._desc_id_cache[hash] = {}
temp[description] = id
return id
def GetDescription(self, id):
return self.get("descs", "description", id)
def GetRepositoryList(self):
return self.get_list("repositories", 1)
def GetBranchList(self):
return self.get_list("branches", 1)
def GetAuthorList(self):
return self.get_list("people", 1)
def AddCommitList(self, commit_list):
for commit in commit_list:
self.AddCommit(commit)
def AddCommit(self, commit):
ci_when = dbi.DateTimeFromTicks(commit.GetTime() or 0.0)
ci_type = commit.GetTypeString()
who_id = self.GetAuthorID(commit.GetAuthor())
repository_id = self.GetRepositoryID(commit.GetRepository())
directory_id = self.GetDirectoryID(commit.GetDirectory())
file_id = self.GetFileID(commit.GetFile())
revision = commit.GetRevision()
sticky_tag = "NULL"
branch_id = self.GetBranchID(commit.GetBranch())
plus_count = commit.GetPlusCount() or '0'
minus_count = commit.GetMinusCount() or '0'
description_id = self.GetDescriptionID(commit.GetDescription())
sql = "REPLACE INTO %s" % (self.GetCommitsTable())
sql = sql + \
" (type,ci_when,whoid,repositoryid,dirid,fileid,revision,"\
" stickytag,branchid,addedlines,removedlines,descid)"\
"VALUES(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"
sql_args = (ci_type, ci_when, who_id, repository_id,
directory_id, file_id, revision, sticky_tag, branch_id,
plus_count, minus_count, description_id)
cursor = self.db.cursor()
try:
cursor.execute(sql, sql_args)
except Exception, e:
raise Exception("Error adding commit: '%s'\n"
"Values were:\n"
"\ttype = %s\n"
"\tci_when = %s\n"
"\twhoid = %s\n"
"\trepositoryid = %s\n"
"\tdirid = %s\n"
"\tfileid = %s\n"
"\trevision = %s\n"
"\tstickytag = %s\n"
"\tbranchid = %s\n"
"\taddedlines = %s\n"
"\tremovedlines = %s\n"
"\tdescid = %s\n"
% ((str(e), ) + sql_args))
def SQLQueryListString(self, field, query_entry_list):
sqlList = []
for query_entry in query_entry_list:
data = query_entry.data
## figure out the correct match type
if query_entry.match == "exact":
match = "="
elif query_entry.match == "like":
match = " LIKE "
elif query_entry.match == "glob":
match = " REGEXP "
# Use fnmatch to translate the glob into a regular
# expression. Sadly, we have to account for the fact
# that in Python 2.6, fnmatch.translate() started
# sticking '\Z(?ms)' at the end of the regular
# expression instead of just '$', and doesn't prepend
# the '^'.
data = fnmatch.translate(data)
if data[0] != '^':
data = '^' + data
if data[-7:] == '\Z(?ms)':
data = data[:-7] + '$'
elif query_entry.match == "regex":
match = " REGEXP "
elif query_entry.match == "notregex":
match = " NOT REGEXP "
sqlList.append("%s%s%s" % (field, match, self.db.literal(data)))
return "(%s)" % (string.join(sqlList, " OR "))
def CreateSQLQueryString(self, query, detect_leftover=0):
commits_table = self.GetCommitsTable()
tableList = [(commits_table, None)]
condList = []
if len(query.repository_list):
tableList.append(("repositories",
"(%s.repositoryid=repositories.id)"
% (commits_table)))
temp = self.SQLQueryListString("repositories.repository",
query.repository_list)
condList.append(temp)
if len(query.branch_list):
tableList.append(("branches",
"(%s.branchid=branches.id)" % (commits_table)))
temp = self.SQLQueryListString("branches.branch",
query.branch_list)
condList.append(temp)
if len(query.directory_list):
tableList.append(("dirs",
"(%s.dirid=dirs.id)" % (commits_table)))
temp = self.SQLQueryListString("dirs.dir", query.directory_list)
condList.append(temp)
if len(query.file_list):
tableList.append(("files",
"(%s.fileid=files.id)" % (commits_table)))
temp = self.SQLQueryListString("files.file", query.file_list)
condList.append(temp)
if len(query.author_list):
tableList.append(("people",
"(%s.whoid=people.id)" % (commits_table)))
temp = self.SQLQueryListString("people.who", query.author_list)
condList.append(temp)
if len(query.comment_list):
tableList.append(("descs",
"(%s.descid=descs.id)" % (commits_table)))
temp = self.SQLQueryListString("descs.description",
query.comment_list)
condList.append(temp)
if query.from_date:
temp = "(%s.ci_when>=\"%s\")" \
% (commits_table, str(query.from_date))
condList.append(temp)
if query.to_date:
temp = "(%s.ci_when<=\"%s\")" \
% (commits_table, str(query.to_date))
condList.append(temp)
if query.sort == "date":
order_by = "ORDER BY %s.ci_when DESC,descid" % (commits_table)
elif query.sort == "author":
tableList.append(("people",
"(%s.whoid=people.id)" % (commits_table)))
order_by = "ORDER BY people.who,descid"
elif query.sort == "file":
tableList.append(("files",
"(%s.fileid=files.id)" % (commits_table)))
order_by = "ORDER BY files.file,descid"
## exclude duplicates from the table list, and split out join
## conditions from table names. In future, the join conditions
## might be handled by INNER JOIN statements instead of WHERE
## clauses, but MySQL 3.22 apparently doesn't support them well.
tables = []
joinConds = []
for (table, cond) in tableList:
if table not in tables:
tables.append(table)
if cond is not None: joinConds.append(cond)
tables = string.join(tables, ",")
conditions = string.join(joinConds + condList, " AND ")
conditions = conditions and "WHERE %s" % conditions
## apply the query's row limit, if any (so we avoid really
## slamming a server with a large database)
limit = ""
if query.limit:
if detect_leftover:
limit = "LIMIT %s" % (str(query.limit + 1))
else:
limit = "LIMIT %s" % (str(query.limit))
sql = "SELECT %s.* FROM %s %s %s %s" \
% (commits_table, tables, conditions, order_by, limit)
return sql
def RunQuery(self, query):
sql = self.CreateSQLQueryString(query, 1)
cursor = self.db.cursor()
cursor.execute(sql)
query.SetExecuted()
row_count = 0
while 1:
row = cursor.fetchone()
if not row:
break
row_count = row_count + 1
if query.limit and (row_count > query.limit):
query.SetLimitReached()
break
(dbType, dbCI_When, dbAuthorID, dbRepositoryID, dbDirID,
dbFileID, dbRevision, dbStickyTag, dbBranchID, dbAddedLines,
dbRemovedLines, dbDescID) = row
commit = LazyCommit(self)
if dbType == 'Add':
commit.SetTypeAdd()
elif dbType == 'Remove':
commit.SetTypeRemove()
else:
commit.SetTypeChange()
commit.SetTime(dbi.TicksFromDateTime(dbCI_When))
commit.SetFileID(dbFileID)
commit.SetDirectoryID(dbDirID)
commit.SetRevision(dbRevision)
commit.SetRepositoryID(dbRepositoryID)
commit.SetAuthorID(dbAuthorID)
commit.SetBranchID(dbBranchID)
commit.SetPlusCount(dbAddedLines)
commit.SetMinusCount(dbRemovedLines)
commit.SetDescriptionID(dbDescID)
query.AddCommit(commit)
def CheckCommit(self, commit):
repository_id = self.GetRepositoryID(commit.GetRepository(), 0)
if repository_id == None:
return None
dir_id = self.GetDirectoryID(commit.GetDirectory(), 0)
if dir_id == None:
return None
file_id = self.GetFileID(commit.GetFile(), 0)
if file_id == None:
return None
sql = "SELECT * FROM %s WHERE "\
" repositoryid=%%s "\
" AND dirid=%%s"\
" AND fileid=%%s"\
" AND revision=%%s"\
% (self.GetCommitsTable())
sql_args = (repository_id, dir_id, file_id, commit.GetRevision())
cursor = self.db.cursor()
cursor.execute(sql, sql_args)
try:
(ci_type, ci_when, who_id, repository_id,
dir_id, file_id, revision, sticky_tag, branch_id,
plus_count, minus_count, description_id) = cursor.fetchone()
except TypeError:
return None
return commit
def sql_delete(self, table, key, value, keep_fkey = None):
sql = "DELETE FROM %s WHERE %s=%%s" % (table, key)
sql_args = (value, )
if keep_fkey:
sql += " AND %s NOT IN (SELECT %s FROM %s WHERE %s = %%s)" \
% (key, keep_fkey, self.GetCommitsTable(), keep_fkey)
sql_args = (value, value)
cursor = self.db.cursor()
cursor.execute(sql, sql_args)
def sql_purge(self, table, key, fkey, ftable):
sql = "DELETE FROM %s WHERE %s NOT IN (SELECT %s FROM %s)" \
% (table, key, fkey, ftable)
cursor = self.db.cursor()
cursor.execute(sql)
def PurgeRepository(self, repository):
rep_id = self.GetRepositoryID(repository, auto_set=0)
if not rep_id:
raise UnknownRepositoryError("Unknown repository '%s'"
% (repository))
if (self._version >= 1):
self.sql_delete('repositories', 'id', rep_id)
self.sql_purge('commits', 'repositoryid', 'id', 'repositories')
self.sql_purge('files', 'id', 'fileid', 'commits')
self.sql_purge('dirs', 'id', 'dirid', 'commits')
self.sql_purge('branches', 'id', 'branchid', 'commits')
self.sql_purge('descs', 'id', 'descid', 'commits')
self.sql_purge('people', 'id', 'whoid', 'commits')
else:
sql = "SELECT * FROM checkins WHERE repositoryid=%s"
sql_args = (rep_id, )
cursor = self.db.cursor()
cursor.execute(sql, sql_args)
checkins = []
while 1:
try:
(ci_type, ci_when, who_id, repository_id,
dir_id, file_id, revision, sticky_tag, branch_id,
plus_count, minus_count, description_id) = \
cursor.fetchone()
except TypeError:
break
checkins.append([file_id, dir_id, branch_id,
description_id, who_id])
#self.sql_delete('repositories', 'id', rep_id)
self.sql_delete('checkins', 'repositoryid', rep_id)
for checkin in checkins:
self.sql_delete('files', 'id', checkin[0], 'fileid')
self.sql_delete('dirs', 'id', checkin[1], 'dirid')
self.sql_delete('branches', 'id', checkin[2], 'branchid')
self.sql_delete('descs', 'id', checkin[3], 'descid')
self.sql_delete('people', 'id', checkin[4], 'whoid')
# Reset all internal id caches. We could be choosier here,
# but let's just be as safe as possible.
self._get_cache = {}
self._get_id_cache = {}
self._desc_id_cache = {}
class DatabaseVersionError(Exception):
pass
class UnknownRepositoryError(Exception):
pass
## the Commit class holds data on one commit, the representation is as
## close as possible to how it should be committed and retrieved to the
## database engine
class Commit:
## static constants for type of commit
CHANGE = 0
ADD = 1
REMOVE = 2
def __init__(self):
self.__directory = ''
self.__file = ''
self.__repository = ''
self.__revision = ''
self.__author = ''
self.__branch = ''
self.__pluscount = ''
self.__minuscount = ''
self.__description = ''
self.__gmt_time = 0.0
self.__type = Commit.CHANGE
def SetRepository(self, repository):
self.__repository = repository
def GetRepository(self):
return self.__repository
def SetDirectory(self, dir):
self.__directory = dir
def GetDirectory(self):
return self.__directory
def SetFile(self, file):
self.__file = file
def GetFile(self):
return self.__file
def SetRevision(self, revision):
self.__revision = revision
def GetRevision(self):
return self.__revision
def SetTime(self, gmt_time):
if gmt_time is None:
### We're just going to assume that a datestamp of The Epoch
### ain't real.
self.__gmt_time = 0.0
else:
self.__gmt_time = float(gmt_time)
def GetTime(self):
return self.__gmt_time and self.__gmt_time or None
def SetAuthor(self, author):
self.__author = author
def GetAuthor(self):
return self.__author
def SetBranch(self, branch):
self.__branch = branch or ''
def GetBranch(self):
return self.__branch
def SetPlusCount(self, pluscount):
self.__pluscount = pluscount
def GetPlusCount(self):
return self.__pluscount
def SetMinusCount(self, minuscount):
self.__minuscount = minuscount
def GetMinusCount(self):
return self.__minuscount
def SetDescription(self, description):
self.__description = description
def GetDescription(self):
return self.__description
def SetTypeChange(self):
self.__type = Commit.CHANGE
def SetTypeAdd(self):
self.__type = Commit.ADD
def SetTypeRemove(self):
self.__type = Commit.REMOVE
def GetType(self):
return self.__type
def GetTypeString(self):
if self.__type == Commit.CHANGE:
return 'Change'
elif self.__type == Commit.ADD:
return 'Add'
elif self.__type == Commit.REMOVE:
return 'Remove'
## LazyCommit overrides a few methods of Commit to only retrieve
## it's properties as they are needed
class LazyCommit(Commit):
def __init__(self, db):
Commit.__init__(self)
self.__db = db
def SetFileID(self, dbFileID):
self.__dbFileID = dbFileID
def GetFileID(self):
return self.__dbFileID
def GetFile(self):
return self.__db.GetFile(self.__dbFileID)
def SetDirectoryID(self, dbDirID):
self.__dbDirID = dbDirID
def GetDirectoryID(self):
return self.__dbDirID
def GetDirectory(self):
return self.__db.GetDirectory(self.__dbDirID)
def SetRepositoryID(self, dbRepositoryID):
self.__dbRepositoryID = dbRepositoryID
def GetRepositoryID(self):
return self.__dbRepositoryID
def GetRepository(self):
return self.__db.GetRepository(self.__dbRepositoryID)
def SetAuthorID(self, dbAuthorID):
self.__dbAuthorID = dbAuthorID
def GetAuthorID(self):
return self.__dbAuthorID
def GetAuthor(self):
return self.__db.GetAuthor(self.__dbAuthorID)
def SetBranchID(self, dbBranchID):
self.__dbBranchID = dbBranchID
def GetBranchID(self):
return self.__dbBranchID
def GetBranch(self):
return self.__db.GetBranch(self.__dbBranchID)
def SetDescriptionID(self, dbDescID):
self.__dbDescID = dbDescID
def GetDescriptionID(self):
return self.__dbDescID
def GetDescription(self):
return self.__db.GetDescription(self.__dbDescID)
## QueryEntry holds data on one match-type in the SQL database
## match is: "exact", "like", or "regex"
class QueryEntry:
def __init__(self, data, match):
self.data = data
self.match = match
## CheckinDatabaseQuery is an object which contains the search
## parameters for a query to the Checkin Database and -- after the
## query is executed -- the data returned by the query.
class CheckinDatabaseQuery:
def __init__(self):
## sorting
self.sort = "date"
## repository to query
self.repository_list = []
self.branch_list = []
self.directory_list = []
self.file_list = []
self.author_list = []
self.comment_list = []
## date range in DBI 2.0 timedate objects
self.from_date = None
self.to_date = None
## limit on number of rows to return
self.limit = None
self.limit_reached = 0
## list of commits -- filled in by CVS query
self.commit_list = []
## commit_cb provides a callback for commits as they
## are added
self.commit_cb = None
## has this query been run?
self.executed = 0
def SetRepository(self, repository, match = "exact"):
self.repository_list.append(QueryEntry(repository, match))
def SetBranch(self, branch, match = "exact"):
self.branch_list.append(QueryEntry(branch, match))
def SetDirectory(self, directory, match = "exact"):
self.directory_list.append(QueryEntry(directory, match))
def SetFile(self, file, match = "exact"):
self.file_list.append(QueryEntry(file, match))
def SetAuthor(self, author, match = "exact"):
self.author_list.append(QueryEntry(author, match))
def SetComment(self, comment, match = "exact"):
self.comment_list.append(QueryEntry(comment, match))
def SetSortMethod(self, sort):
self.sort = sort
def SetFromDateObject(self, ticks):
self.from_date = dbi.DateTimeFromTicks(ticks)
def SetToDateObject(self, ticks):
self.to_date = dbi.DateTimeFromTicks(ticks)
def SetFromDateHoursAgo(self, hours_ago):
ticks = time.time() - (3600 * hours_ago)
self.from_date = dbi.DateTimeFromTicks(ticks)
def SetFromDateDaysAgo(self, days_ago):
ticks = time.time() - (86400 * days_ago)
self.from_date = dbi.DateTimeFromTicks(ticks)
def SetToDateDaysAgo(self, days_ago):
ticks = time.time() - (86400 * days_ago)
self.to_date = dbi.DateTimeFromTicks(ticks)
def SetLimit(self, limit):
self.limit = limit;
def AddCommit(self, commit):
self.commit_list.append(commit)
def SetExecuted(self):
self.executed = 1
def SetLimitReached(self):
self.limit_reached = 1
def GetLimitReached(self):
assert self.executed
return self.limit_reached
def GetCommitList(self):
assert self.executed
return self.commit_list
##
## entrypoints
##
def CreateCommit():
return Commit()
def CreateCheckinQuery():
return CheckinDatabaseQuery()
def ConnectDatabase(cfg, readonly=0):
if readonly:
user = cfg.cvsdb.readonly_user
passwd = cfg.cvsdb.readonly_passwd
else:
user = cfg.cvsdb.user
passwd = cfg.cvsdb.passwd
db = CheckinDatabase(cfg.cvsdb.host, cfg.cvsdb.port, user, passwd,
cfg.cvsdb.database_name)
db.Connect()
return db
def ConnectDatabaseReadOnly(cfg):
return ConnectDatabase(cfg, 1)
def GetCommitListFromRCSFile(repository, path_parts, revision=None):
commit_list = []
directory = string.join(path_parts[:-1], "/")
file = path_parts[-1]
revs = repository.itemlog(path_parts, revision, vclib.SORTBY_DEFAULT,
0, 0, {"cvs_pass_rev": 1})
for rev in revs:
commit = CreateCommit()
commit.SetRepository(repository.rootpath)
commit.SetDirectory(directory)
commit.SetFile(file)
commit.SetRevision(rev.string)
commit.SetAuthor(rev.author)
commit.SetDescription(rev.log)
commit.SetTime(rev.date)
if rev.changed:
# extract the plus/minus and drop the sign
plus, minus = string.split(rev.changed)
commit.SetPlusCount(plus[1:])
commit.SetMinusCount(minus[1:])
if rev.dead:
commit.SetTypeRemove()
else:
commit.SetTypeChange()
else:
commit.SetTypeAdd()
commit_list.append(commit)
# if revision is on a branch which has at least one tag
if len(rev.number) > 2 and rev.branches:
commit.SetBranch(rev.branches[0].name)
return commit_list
def GetUnrecordedCommitList(repository, path_parts, db):
commit_list = GetCommitListFromRCSFile(repository, path_parts)
unrecorded_commit_list = []
for commit in commit_list:
result = db.CheckCommit(commit)
if not result:
unrecorded_commit_list.append(commit)
return unrecorded_commit_list
_re_likechars = re.compile(r"([_%\\])")
def EscapeLike(literal):
"""Escape literal string for use in a MySQL LIKE pattern"""
return re.sub(_re_likechars, r"\\\1", literal)
def FindRepository(db, path):
"""Find repository path in database given path to subdirectory
Returns normalized repository path and relative directory path"""
path = os.path.normpath(path)
dirs = []
while path:
rep = os.path.normcase(path)
if db.GetRepositoryID(rep, 0) is None:
path, pdir = os.path.split(path)
if not pdir:
return None, None
dirs.append(pdir)
else:
break
dirs.reverse()
return rep, dirs
def CleanRepository(path):
"""Return normalized top-level repository path"""
return os.path.normcase(os.path.normpath(path))

63
lib/dbi.py Normal file
View File

@@ -0,0 +1,63 @@
# -*-python-*-
#
# Copyright (C) 1999-2006 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
import sys
import time
import types
import re
import compat
import MySQLdb
# set to 1 to store commit times in UTC, or 0 to use the ViewVC machine's
# local timezone. Using UTC is recommended because it ensures that the
# database will remain valid even if it is moved to another machine or the host
# computer's time zone is changed. UTC also avoids the ambiguity associated
# with daylight saving time (for example if a computer in New York recorded the
# local time 2002/10/27 1:30 am, there would be no way to tell whether the
# actual time was recorded before or after clocks were rolled back). Use local
# times for compatibility with databases used by ViewCVS 0.92 and earlier
# versions.
utc_time = 1
def DateTimeFromTicks(ticks):
"""Return a MySQL DATETIME value from a unix timestamp"""
if utc_time:
t = time.gmtime(ticks)
else:
t = time.localtime(ticks)
return "%04d-%02d-%02d %02d:%02d:%02d" % t[:6]
_re_datetime = re.compile('([0-9]{4})-([0-9][0-9])-([0-9][0-9]) '
'([0-9][0-9]):([0-9][0-9]):([0-9][0-9])')
def TicksFromDateTime(datetime):
"""Return a unix timestamp from a MySQL DATETIME value"""
if type(datetime) == types.StringType:
# datetime is a MySQL DATETIME string
matches = _re_datetime.match(datetime).groups()
t = tuple(map(int, matches)) + (0, 0, 0)
elif hasattr(datetime, "timetuple"):
# datetime is a Python >=2.3 datetime.DateTime object
t = datetime.timetuple()
else:
# datetime is an eGenix mx.DateTime object
t = datetime.tuple()
if utc_time:
return compat.timegm(t)
else:
return time.mktime(t[:8] + (-1,))
def connect(host, port, user, passwd, db):
return MySQLdb.connect(host=host, port=port, user=user, passwd=passwd, db=db)

203
lib/debug.py Normal file
View File

@@ -0,0 +1,203 @@
# -*-python-*-
#
# Copyright (C) 1999-2008 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# Note: a t_start/t_end pair consumes about 0.00005 seconds on a P3/700.
# the lambda form (when debugging is disabled) should be even faster.
#
import sys
# Set to non-zero to track and print processing times
SHOW_TIMES = 0
# Set to non-zero to display child process info
SHOW_CHILD_PROCESSES = 0
# Set to a server-side path to force the tarball view to generate the
# tarball as a file on the server, instead of transmitting the data
# back to the browser. This enables easy display of error
# considitions in the browser, as well as tarball inspection on the
# server. NOTE: The file will be a TAR archive, *not* gzip-compressed.
TARFILE_PATH = ''
if SHOW_TIMES:
import time
_timers = { }
_times = { }
def t_start(which):
_timers[which] = time.time()
def t_end(which):
t = time.time() - _timers[which]
if _times.has_key(which):
_times[which] = _times[which] + t
else:
_times[which] = t
def t_dump(out):
out.write('<div>')
names = _times.keys()
names.sort()
for name in names:
out.write('%s: %.6fs<br/>\n' % (name, _times[name]))
out.write('</div>')
else:
t_start = t_end = t_dump = lambda *args: None
class ViewVCException:
def __init__(self, msg, status=None):
self.msg = msg
self.status = status
def __str__(self):
if self.status:
return '%s: %s' % (self.status, self.msg)
return "ViewVC Unrecoverable Error: %s" % self.msg
def PrintException(server, exc_data):
status = exc_data['status']
msg = exc_data['msg']
tb = exc_data['stacktrace']
server.header(status=status)
server.write("<h3>An Exception Has Occurred</h3>\n")
s = ''
if msg:
s = '<p><pre>%s</pre></p>' % server.escape(msg)
if status:
s = s + ('<h4>HTTP Response Status</h4>\n<p><pre>\n%s</pre></p><hr />\n'
% status)
server.write(s)
server.write("<h4>Python Traceback</h4>\n<p><pre>")
server.write(server.escape(tb))
server.write("</pre></p>\n")
def GetExceptionData():
# capture the exception before doing anything else
exc_type, exc, exc_tb = sys.exc_info()
exc_dict = {
'status' : None,
'msg' : None,
'stacktrace' : None,
}
try:
import traceback, string
if isinstance(exc, ViewVCException):
exc_dict['msg'] = exc.msg
exc_dict['status'] = exc.status
tb = string.join(traceback.format_exception(exc_type, exc, exc_tb), '')
exc_dict['stacktrace'] = tb
finally:
# prevent circular reference. sys.exc_info documentation warns
# "Assigning the traceback return value to a local variable in a function
# that is handling an exception will cause a circular reference..."
# This is all based on 'exc_tb', and we're now done with it. Toss it.
del exc_tb
return exc_dict
if SHOW_CHILD_PROCESSES:
class Process:
def __init__(self, command, inStream, outStream, errStream):
self.command = command
self.debugIn = inStream
self.debugOut = outStream
self.debugErr = errStream
import sapi
if not sapi.server is None:
if not sapi.server.pageGlobals.has_key('processes'):
sapi.server.pageGlobals['processes'] = [self]
else:
sapi.server.pageGlobals['processes'].append(self)
def DumpChildren(server):
import os
if not server.pageGlobals.has_key('processes'):
return
server.header()
lastOut = None
i = 0
for k in server.pageGlobals['processes']:
i = i + 1
server.write("<table>\n")
server.write("<tr><td colspan=\"2\">Child Process%i</td></tr>" % i)
server.write("<tr>\n <td style=\"vertical-align:top\">Command Line</td> <td><pre>")
server.write(server.escape(k.command))
server.write("</pre></td>\n</tr>\n")
server.write("<tr>\n <td style=\"vertical-align:top\">Standard In:</td> <td>")
if k.debugIn is lastOut and not lastOut is None:
server.write("<em>Output from process %i</em>" % (i - 1))
elif k.debugIn:
server.write("<pre>")
server.write(server.escape(k.debugIn.getvalue()))
server.write("</pre>")
server.write("</td>\n</tr>\n")
if k.debugOut is k.debugErr:
server.write("<tr>\n <td style=\"vertical-align:top\">Standard Out & Error:</td> <td><pre>")
if k.debugOut:
server.write(server.escape(k.debugOut.getvalue()))
server.write("</pre></td>\n</tr>\n")
else:
server.write("<tr>\n <td style=\"vertical-align:top\">Standard Out:</td> <td><pre>")
if k.debugOut:
server.write(server.escape(k.debugOut.getvalue()))
server.write("</pre></td>\n</tr>\n")
server.write("<tr>\n <td style=\"vertical-align:top\">Standard Error:</td> <td><pre>")
if k.debugErr:
server.write(server.escape(k.debugErr.getvalue()))
server.write("</pre></td>\n</tr>\n")
server.write("</table>\n")
server.flush()
lastOut = k.debugOut
server.write("<table>\n")
server.write("<tr><td colspan=\"2\">Environment Variables</td></tr>")
for k, v in os.environ.items():
server.write("<tr>\n <td style=\"vertical-align:top\"><pre>")
server.write(server.escape(k))
server.write("</pre></td>\n <td style=\"vertical-align:top\"><pre>")
server.write(server.escape(v))
server.write("</pre></td>\n</tr>")
server.write("</table>")
else:
def DumpChildren(server):
pass

886
lib/ezt.py Normal file
View File

@@ -0,0 +1,886 @@
#!/usr/bin/env python
"""ezt.py -- easy templating
ezt templates are simply text files in whatever format you so desire
(such as XML, HTML, etc.) which contain directives sprinkled
throughout. With these directives it is possible to generate the
dynamic content from the ezt templates.
These directives are enclosed in square brackets. If you are a
C-programmer, you might be familar with the #ifdef directives of the C
preprocessor 'cpp'. ezt provides a similar concept. Additionally EZT
has a 'for' directive, which allows it to iterate (repeat) certain
subsections of the template according to sequence of data items
provided by the application.
The final rendering is performed by the method generate() of the Template
class. Building template instances can either be done using external
EZT files (convention: use the suffix .ezt for such files):
>>> template = Template("../templates/log.ezt")
or by calling the parse() method of a template instance directly with
a EZT template string:
>>> template = Template()
>>> template.parse('''<html><head>
... <title>[title_string]</title></head>
... <body><h1>[title_string]</h1>
... [for a_sequence] <p>[a_sequence]</p>
... [end] <hr />
... The [person] is [if-any state]in[else]out[end].
... </body>
... </html>
... ''')
The application should build a dictionary 'data' and pass it together
with the output fileobject to the templates generate method:
>>> data = {'title_string' : "A Dummy Page",
... 'a_sequence' : ['list item 1', 'list item 2', 'another element'],
... 'person': "doctor",
... 'state' : None }
>>> import sys
>>> template.generate(sys.stdout, data)
<html><head>
<title>A Dummy Page</title></head>
<body><h1>A Dummy Page</h1>
<p>list item 1</p>
<p>list item 2</p>
<p>another element</p>
<hr />
The doctor is out.
</body>
</html>
Template syntax error reporting should be improved. Currently it is
very sparse (template line numbers would be nice):
>>> Template().parse("[if-any where] foo [else] bar [end unexpected args]")
Traceback (innermost last):
File "<stdin>", line 1, in ?
File "ezt.py", line 220, in parse
self.program = self._parse(text)
File "ezt.py", line 275, in _parse
raise ArgCountSyntaxError(str(args[1:]))
ArgCountSyntaxError: ['unexpected', 'args']
>>> Template().parse("[if unmatched_end]foo[end]")
Traceback (innermost last):
File "<stdin>", line 1, in ?
File "ezt.py", line 206, in parse
self.program = self._parse(text)
File "ezt.py", line 266, in _parse
raise UnmatchedEndError()
UnmatchedEndError
Directives
==========
Several directives allow the use of dotted qualified names refering to objects
or attributes of objects contained in the data dictionary given to the
.generate() method.
Qualified names
---------------
Qualified names have two basic forms: a variable reference, or a string
constant. References are a name from the data dictionary with optional
dotted attributes (where each intermediary is an object with attributes,
of course).
Examples:
[varname]
[ob.attr]
["string"]
Simple directives
-----------------
[QUAL_NAME]
This directive is simply replaced by the value of the qualified name.
If the value is a number it's converted to a string before being
outputted. If it is None, nothing is outputted. If it is a python file
object (i.e. any object with a "read" method), it's contents are
outputted. If it is a callback function (any callable python object
is assumed to be a callback function), it is invoked and passed an EZT
Context object as an argument.
[QUAL_NAME QUAL_NAME ...]
If the first value is a callback function, it is invoked with an EZT
Context object as a first argument, and the rest of the values as
additional arguments.
Otherwise, the first value defines a substitution format, specifying
constant text and indices of the additional arguments. The arguments
are substituted and the result is inserted into the output stream.
Example:
["abc %0 def %1 ghi %0" foo bar.baz]
Note that the first value can be any type of qualified name -- a string
constant or a variable reference. Use %% to substitute a percent sign.
Argument indices are 0-based.
[include "filename"] or [include QUAL_NAME]
This directive is replaced by content of the named include file. Note
that a string constant is more efficient -- the target file is compiled
inline. In the variable form, the target file is compiled and executed
at runtime.
Block directives
----------------
[for QUAL_NAME] ... [end]
The text within the [for ...] directive and the corresponding [end]
is repeated for each element in the sequence referred to by the
qualified name in the for directive. Within the for block this
identifiers now refers to the actual item indexed by this loop
iteration.
[if-any QUAL_NAME [QUAL_NAME2 ...]] ... [else] ... [end]
Test if any QUAL_NAME value is not None or an empty string or list.
The [else] clause is optional. CAUTION: Numeric values are
converted to string, so if QUAL_NAME refers to a numeric value 0,
the then-clause is substituted!
[if-index INDEX_FROM_FOR odd] ... [else] ... [end]
[if-index INDEX_FROM_FOR even] ... [else] ... [end]
[if-index INDEX_FROM_FOR first] ... [else] ... [end]
[if-index INDEX_FROM_FOR last] ... [else] ... [end]
[if-index INDEX_FROM_FOR NUMBER] ... [else] ... [end]
These five directives work similar to [if-any], but are only useful
within a [for ...]-block (see above). The odd/even directives are
for example useful to choose different background colors for
adjacent rows in a table. Similar the first/last directives might
be used to remove certain parts (for example "Diff to previous"
doesn't make sense, if there is no previous).
[is QUAL_NAME STRING] ... [else] ... [end]
[is QUAL_NAME QUAL_NAME] ... [else] ... [end]
The [is ...] directive is similar to the other conditional
directives above. But it allows to compare two value references or
a value reference with some constant string.
[define VARIABLE] ... [end]
The [define ...] directive allows you to create and modify template
variables from within the template itself. Essentially, any data
between inside the [define ...] and its matching [end] will be
expanded using the other template parsing and output generation
rules, and then stored as a string value assigned to the variable
VARIABLE. The new (or changed) variable is then available for use
with other mechanisms such as [is ...] or [if-any ...], as long as
they appear later in the template.
[format STRING] ... [end]
The format directive controls how the values substituted into
templates are escaped before they are put into the output stream. It
has no effect on the literal text of the templates, only the output
from [QUAL_NAME ...] directives. STRING can be one of "raw" "html"
"xml" or "uri". The "raw" mode leaves the output unaltered; the "html"
and "xml" modes escape special characters using entity escapes (like
&quot; and &gt;); the "uri" mode escapes characters using hexadecimal
escape sequences (like %20 and %7e).
[format CALLBACK]
Python applications using EZT can provide custom formatters as callback
variables. "[format CALLBACK][QUAL_NAME][end]" is in most cases
equivalent to "[CALLBACK QUAL_NAME]"
"""
#
# Copyright (C) 2001-2007 Greg Stein. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
#
# This software is maintained by Greg and is available at:
# http://svn.webdav.org/repos/projects/ezt/trunk/
#
import string
import re
from types import StringType, IntType, FloatType, LongType, TupleType
import os
import cgi
import urllib
try:
import cStringIO
except ImportError:
import StringIO
cStringIO = StringIO
#
# Formatting types
#
FORMAT_RAW = 'raw'
FORMAT_HTML = 'html'
FORMAT_XML = 'xml'
FORMAT_URI = 'uri'
#
# This regular expression matches three alternatives:
# expr: DIRECTIVE | BRACKET | COMMENT
# DIRECTIVE: '[' ITEM (whitespace ITEM)* ']
# ITEM: STRING | NAME
# STRING: '"' (not-slash-or-dquote | '\' anychar)* '"'
# NAME: (alphanum | '_' | '-' | '.')+
# BRACKET: '[[]'
# COMMENT: '[#' not-rbracket* ']'
#
# When used with the split() method, the return value will be composed of
# non-matching text and the two paren groups (DIRECTIVE and BRACKET). Since
# the COMMENT matches are not placed into a group, they are considered a
# "splitting" value and simply dropped.
#
_item = r'(?:"(?:[^\\"]|\\.)*"|[-\w.]+)'
_re_parse = re.compile(r'\[(%s(?: +%s)*)\]|(\[\[\])|\[#[^\]]*\]' % (_item, _item))
_re_args = re.compile(r'"(?:[^\\"]|\\.)*"|[-\w.]+')
# block commands and their argument counts
_block_cmd_specs = { 'if-index':2, 'for':1, 'is':2, 'define':1, 'format':1 }
_block_cmds = _block_cmd_specs.keys()
# two regular expresssions for compressing whitespace. the first is used to
# compress any whitespace including a newline into a single newline. the
# second regex is used to compress runs of whitespace into a single space.
_re_newline = re.compile('[ \t\r\f\v]*\n\\s*')
_re_whitespace = re.compile(r'\s\s+')
# this regex is used to substitute arguments into a value. we split the value,
# replace the relevant pieces, and then put it all back together. splitting
# will produce a list of: TEXT ( splitter TEXT )*. splitter will be '%' or
# an integer.
_re_subst = re.compile('%(%|[0-9]+)')
class Template:
def __init__(self, fname=None, compress_whitespace=1,
base_format=FORMAT_RAW):
self.compress_whitespace = compress_whitespace
if fname:
self.parse_file(fname, base_format)
def parse_file(self, fname, base_format=FORMAT_RAW):
"fname -> a string object with pathname of file containg an EZT template."
self.parse(_FileReader(fname), base_format)
def parse(self, text_or_reader, base_format=FORMAT_RAW):
"""Parse the template specified by text_or_reader.
The argument should be a string containing the template, or it should
specify a subclass of ezt.Reader which can read templates. The base
format for printing values is given by base_format.
"""
if not isinstance(text_or_reader, Reader):
# assume the argument is a plain text string
text_or_reader = _TextReader(text_or_reader)
self.program = self._parse(text_or_reader, base_format=base_format)
def generate(self, fp, data):
if hasattr(data, '__getitem__') or callable(getattr(data, 'keys', None)):
# a dictionary-like object was passed. convert it to an
# attribute-based object.
class _data_ob:
def __init__(self, d):
vars(self).update(d)
data = _data_ob(data)
ctx = Context(fp)
ctx.data = data
ctx.for_iterators = { }
ctx.defines = { }
self._execute(self.program, ctx)
def _parse(self, reader, for_names=None, file_args=(), base_format=None):
"""text -> string object containing the template.
This is a private helper function doing the real work for method parse.
It returns the parsed template as a 'program'. This program is a sequence
made out of strings or (function, argument) 2-tuples.
Note: comment directives [# ...] are automatically dropped by _re_parse.
"""
# parse the template program into: (TEXT DIRECTIVE BRACKET)* TEXT
parts = _re_parse.split(reader.text)
program = [ ]
stack = [ ]
if not for_names:
for_names = [ ]
if base_format:
program.append((self._cmd_format, _formatters[base_format]))
for i in range(len(parts)):
piece = parts[i]
which = i % 3 # discriminate between: TEXT DIRECTIVE BRACKET
if which == 0:
# TEXT. append if non-empty.
if piece:
if self.compress_whitespace:
piece = _re_whitespace.sub(' ', _re_newline.sub('\n', piece))
program.append(piece)
elif which == 2:
# BRACKET directive. append '[' if present.
if piece:
program.append('[')
elif piece:
# DIRECTIVE is present.
args = _re_args.findall(piece)
cmd = args[0]
if cmd == 'else':
if len(args) > 1:
raise ArgCountSyntaxError(str(args[1:]))
### check: don't allow for 'for' cmd
idx = stack[-1][1]
true_section = program[idx:]
del program[idx:]
stack[-1][3] = true_section
elif cmd == 'end':
if len(args) > 1:
raise ArgCountSyntaxError(str(args[1:]))
# note: true-section may be None
try:
cmd, idx, args, true_section = stack.pop()
except IndexError:
raise UnmatchedEndError()
else_section = program[idx:]
if cmd == 'format':
program.append((self._cmd_end_format, None))
else:
func = getattr(self, '_cmd_' + re.sub('-', '_', cmd))
program[idx:] = [ (func, (args, true_section, else_section)) ]
if cmd == 'for':
for_names.pop()
elif cmd in _block_cmds:
if len(args) > _block_cmd_specs[cmd] + 1:
raise ArgCountSyntaxError(str(args[1:]))
### this assumes arg1 is always a ref unless cmd is 'define'
if cmd != 'define':
args[1] = _prepare_ref(args[1], for_names, file_args)
# handle arg2 for the 'is' command
if cmd == 'is':
args[2] = _prepare_ref(args[2], for_names, file_args)
elif cmd == 'for':
for_names.append(args[1][0]) # append the refname
elif cmd == 'format':
if args[1][0]:
# argument is a variable reference
formatter = args[1]
else:
# argument is a string constant referring to built-in formatter
formatter = _formatters.get(args[1][1])
if not formatter:
raise UnknownFormatConstantError(str(args[1:]))
program.append((self._cmd_format, formatter))
# remember the cmd, current pos, args, and a section placeholder
stack.append([cmd, len(program), args[1:], None])
elif cmd == 'include':
if args[1][0] == '"':
include_filename = args[1][1:-1]
f_args = [ ]
for arg in args[2:]:
f_args.append(_prepare_ref(arg, for_names, file_args))
program.extend(self._parse(reader.read_other(include_filename),
for_names, f_args))
else:
if len(args) != 2:
raise ArgCountSyntaxError(str(args))
program.append((self._cmd_include,
(_prepare_ref(args[1], for_names, file_args),
reader)))
elif cmd == 'if-any':
f_args = [ ]
for arg in args[1:]:
f_args.append(_prepare_ref(arg, for_names, file_args))
stack.append(['if-any', len(program), f_args, None])
else:
# implied PRINT command
f_args = [ ]
for arg in args:
f_args.append(_prepare_ref(arg, for_names, file_args))
program.append((self._cmd_print, f_args))
if stack:
### would be nice to say which blocks...
raise UnclosedBlocksError()
return program
def _execute(self, program, ctx):
"""This private helper function takes a 'program' sequence as created
by the method '_parse' and executes it step by step. strings are written
to the file object 'fp' and functions are called.
"""
for step in program:
if isinstance(step, StringType):
ctx.fp.write(step)
else:
step[0](step[1], ctx)
def _cmd_print(self, valrefs, ctx):
value = _get_value(valrefs[0], ctx)
args = map(lambda valref, ctx=ctx: _get_value(valref, ctx), valrefs[1:])
try:
_write_value(value, args, ctx)
except TypeError:
raise Exception("Unprintable value type for '%s'" % (str(valrefs[0][0])))
def _cmd_format(self, formatter, ctx):
if type(formatter) is TupleType:
formatter = _get_value(formatter, ctx)
ctx.formatters.append(formatter)
def _cmd_end_format(self, valref, ctx):
ctx.formatters.pop()
def _cmd_include(self, (valref, reader), ctx):
fname = _get_value(valref, ctx)
### note: we don't have the set of for_names to pass into this parse.
### I don't think there is anything to do but document it.
self._execute(self._parse(reader.read_other(fname)), ctx)
def _cmd_if_any(self, args, ctx):
"If any value is a non-empty string or non-empty list, then T else F."
(valrefs, t_section, f_section) = args
value = 0
for valref in valrefs:
if _get_value(valref, ctx):
value = 1
break
self._do_if(value, t_section, f_section, ctx)
def _cmd_if_index(self, args, ctx):
((valref, value), t_section, f_section) = args
iterator = ctx.for_iterators[valref[0]]
if value == 'even':
value = iterator.index % 2 == 0
elif value == 'odd':
value = iterator.index % 2 == 1
elif value == 'first':
value = iterator.index == 0
elif value == 'last':
value = iterator.is_last()
else:
value = iterator.index == int(value)
self._do_if(value, t_section, f_section, ctx)
def _cmd_is(self, args, ctx):
((left_ref, right_ref), t_section, f_section) = args
value = _get_value(right_ref, ctx)
value = string.lower(_get_value(left_ref, ctx)) == string.lower(value)
self._do_if(value, t_section, f_section, ctx)
def _do_if(self, value, t_section, f_section, ctx):
if t_section is None:
t_section = f_section
f_section = None
if value:
section = t_section
else:
section = f_section
if section is not None:
self._execute(section, ctx)
def _cmd_for(self, args, ctx):
((valref,), unused, section) = args
list = _get_value(valref, ctx)
if isinstance(list, StringType):
raise NeedSequenceError("The value of '%s' is not a sequence"
% (valref[0]))
refname = valref[0]
ctx.for_iterators[refname] = iterator = _iter(list)
for unused in iterator:
self._execute(section, ctx)
del ctx.for_iterators[refname]
def _cmd_define(self, args, ctx):
((name,), unused, section) = args
origfp = ctx.fp
ctx.fp = cStringIO.StringIO()
if section is not None:
self._execute(section, ctx)
ctx.defines[name] = ctx.fp.getvalue()
ctx.fp = origfp
def boolean(value):
"Return a value suitable for [if-any bool_var] usage in a template."
if value:
return 'yes'
return None
def _prepare_ref(refname, for_names, file_args):
"""refname -> a string containing a dotted identifier. example:"foo.bar.bang"
for_names -> a list of active for sequences.
Returns a `value reference', a 3-tuple made out of (refname, start, rest),
for fast access later.
"""
# is the reference a string constant?
if refname[0] == '"':
return None, refname[1:-1], None
parts = string.split(refname, '.')
start = parts[0]
rest = parts[1:]
# if this is an include-argument, then just return the prepared ref
if start[:3] == 'arg':
try:
idx = int(start[3:])
except ValueError:
pass
else:
if idx < len(file_args):
orig_refname, start, more_rest = file_args[idx]
if more_rest is None:
# the include-argument was a string constant
return None, start, None
# prepend the argument's "rest" for our further processing
rest[:0] = more_rest
# rewrite the refname to ensure that any potential 'for' processing
# has the correct name
### this can make it hard for debugging include files since we lose
### the 'argNNN' names
if not rest:
return start, start, [ ]
refname = start + '.' + string.join(rest, '.')
if for_names:
# From last to first part, check if this reference is part of a for loop
for i in range(len(parts), 0, -1):
name = string.join(parts[:i], '.')
if name in for_names:
return refname, name, parts[i:]
return refname, start, rest
def _get_value((refname, start, rest), ctx):
"""(refname, start, rest) -> a prepared `value reference' (see above).
ctx -> an execution context instance.
Does a name space lookup within the template name space. Active
for blocks take precedence over data dictionary members with the
same name.
"""
if rest is None:
# it was a string constant
return start
# get the starting object
if ctx.for_iterators.has_key(start):
ob = ctx.for_iterators[start].last_item
elif ctx.defines.has_key(start):
ob = ctx.defines[start]
elif hasattr(ctx.data, start):
ob = getattr(ctx.data, start)
else:
raise UnknownReference(refname)
# walk the rest of the dotted reference
for attr in rest:
try:
ob = getattr(ob, attr)
except AttributeError:
raise UnknownReference(refname)
# make sure we return a string instead of some various Python types
if isinstance(ob, IntType) \
or isinstance(ob, LongType) \
or isinstance(ob, FloatType):
return str(ob)
if ob is None:
return ''
# string or a sequence
return ob
def _print_formatted(formatters, ctx, chunk):
# print chunk to ctx.fp after running it sequentially through formatters
for formatter in formatters:
chunk = formatter(chunk)
ctx.fp.write(chunk)
def _write_value(value, args, ctx):
# value is a callback function, generates its own output
if callable(value):
apply(value, [ctx] + list(args))
return
# squirrel away formatters in case one of them recursively calls
# _write_value() -- we'll use them (in reverse order) to format our
# output.
formatters = ctx.formatters[:]
formatters.reverse()
try:
# if the value has a 'read' attribute, then it is a stream: copy it
if hasattr(value, 'read'):
while 1:
chunk = value.read(16384)
if not chunk:
break
_print_formatted(formatters, ctx, chunk)
# value is a substitution pattern
elif args:
parts = _re_subst.split(value)
for i in range(len(parts)):
piece = parts[i]
if i%2 == 1 and piece != '%':
idx = int(piece)
if idx < len(args):
piece = args[idx]
else:
piece = '<undef>'
_print_formatted(formatters, ctx, piece)
# plain old value, write to output
else:
_print_formatted(formatters, ctx, value)
finally:
# restore our formatters
formatters.reverse()
ctx.formatters = formatters
class TemplateData:
"""A custom dictionary-like object that allows one-time definition
of keys, and only value fetches and changes, and key deletions,
thereafter.
EZT doesn't require the use of this special class -- a normal
dict-type data dictionary works fine. But use of this class will
assist those who want the data sent to their templates to have a
consistent set of keys."""
def __init__(self, initial_data={}):
self._items = initial_data
def __getitem__(self, key):
return self._items.__getitem__(key)
def __setitem__(self, key, item):
assert self._items.has_key(key)
return self._items.__setitem__(key, item)
def __delitem__(self, key):
return self._items.__delitem__(key)
def keys(self):
return self._items.keys()
def merge(self, template_data):
"""Merge the data in TemplataData instance TEMPLATA_DATA into this
instance. Avoid the temptation to use this conditionally in your
code -- it rather defeats the purpose of this class."""
assert isinstance(template_data, TemplateData)
self._items.update(template_data._items)
class Context:
"""A container for the execution context"""
def __init__(self, fp):
self.fp = fp
self.formatters = []
def write(self, value, args=()):
_write_value(value, args, self)
class Reader:
"Abstract class which allows EZT to detect Reader objects."
class _FileReader(Reader):
"""Reads templates from the filesystem."""
def __init__(self, fname):
self.text = open(fname, 'rb').read()
self._dir = os.path.dirname(fname)
def read_other(self, relative):
return _FileReader(os.path.join(self._dir, relative))
class _TextReader(Reader):
"""'Reads' a template from provided text."""
def __init__(self, text):
self.text = text
def read_other(self, relative):
raise BaseUnavailableError()
class _Iterator:
"""Specialized iterator for EZT that counts items and can look ahead
Implements standard iterator interface and provides an is_last() method
and two public members:
index - integer index of the current item
last_item - last item returned by next()"""
def __init__(self, sequence):
self._iter = iter(sequence)
def next(self):
if hasattr(self, '_next_item'):
self.last_item = self._next_item
del self._next_item
else:
self.last_item = self._iter.next() # may raise StopIteration
if hasattr(self, 'index'):
self.index = self.index + 1
else:
self.index = 0
return self.last_item
def is_last(self):
"""Return true if the current item is the last in the sequence"""
# the only way we can tell if the current item is last is to call next()
# and store the return value so it doesn't get lost
if not hasattr(self, '_next_item'):
try:
self._next_item = self._iter.next()
except StopIteration:
return 1
return 0
def __iter__(self):
return self
class _OldIterator:
"""Alternate implemention of _Iterator for old Pythons without iterators
This class implements the sequence protocol, instead of the iterator
interface, so it's really not an iterator at all. But it can be used in
python "for" loops as a drop-in replacement for _Iterator. It also provides
the is_last() method and "last_item" and "index" members described in the
_Iterator docstring."""
def __init__(self, sequence):
self._seq = sequence
def __getitem__(self, index):
self.last_item = self._seq[index] # may raise IndexError
self.index = index
return self.last_item
def is_last(self):
return self.index + 1 >= len(self._seq)
try:
iter
except NameError:
_iter = _OldIterator
else:
_iter = _Iterator
class EZTException(Exception):
"""Parent class of all EZT exceptions."""
class ArgCountSyntaxError(EZTException):
"""A bracket directive got the wrong number of arguments."""
class UnknownReference(EZTException):
"""The template references an object not contained in the data dictionary."""
class NeedSequenceError(EZTException):
"""The object dereferenced by the template is no sequence (tuple or list)."""
class UnclosedBlocksError(EZTException):
"""This error may be simply a missing [end]."""
class UnmatchedEndError(EZTException):
"""This error may be caused by a misspelled if directive."""
class BaseUnavailableError(EZTException):
"""Base location is unavailable, which disables includes."""
class UnknownFormatConstantError(EZTException):
"""The format specifier is an unknown value."""
def _raw_formatter(s):
return s
def _html_formatter(s):
return cgi.escape(s)
def _xml_formatter(s):
s = s.replace('&', '&#x26;')
s = s.replace('<', '&#x3C;')
s = s.replace('>', '&#x3E;')
return s
def _uri_formatter(s):
return urllib.quote(s)
_formatters = {
FORMAT_RAW : _raw_formatter,
FORMAT_HTML : _html_formatter,
FORMAT_XML : _xml_formatter,
FORMAT_URI : _uri_formatter,
}
# --- standard test environment ---
def test_parse():
assert _re_parse.split('[a]') == ['', '[a]', None, '']
assert _re_parse.split('[a] [b]') == \
['', '[a]', None, ' ', '[b]', None, '']
assert _re_parse.split('[a c] [b]') == \
['', '[a c]', None, ' ', '[b]', None, '']
assert _re_parse.split('x [a] y [b] z') == \
['x ', '[a]', None, ' y ', '[b]', None, ' z']
assert _re_parse.split('[a "b" c "d"]') == \
['', '[a "b" c "d"]', None, '']
assert _re_parse.split(r'["a \"b[foo]" c.d f]') == \
['', '["a \\"b[foo]" c.d f]', None, '']
def _test(argv):
import doctest, ezt
verbose = "-v" in argv
return doctest.testmod(ezt, verbose=verbose)
if __name__ == "__main__":
# invoke unit test for this module:
import sys
sys.exit(_test(sys.argv)[0])

190
lib/idiff.py Normal file
View File

@@ -0,0 +1,190 @@
# -*-python-*-
#
# Copyright (C) 1999-2010 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# idiff: display differences between files highlighting intraline changes
#
# -----------------------------------------------------------------------
from __future__ import generators
import difflib
import sys
import re
import ezt
import sapi
def sidebyside(fromlines, tolines, context):
"""Generate side by side diff"""
### for some reason mdiff chokes on \n's in input lines
line_strip = lambda line: line.rstrip("\n")
fromlines = map(line_strip, fromlines)
tolines = map(line_strip, tolines)
gap = False
for fromdata, todata, flag in difflib._mdiff(fromlines, tolines, context):
if fromdata is None and todata is None and flag is None:
gap = True
else:
from_item = _mdiff_split(flag, fromdata)
to_item = _mdiff_split(flag, todata)
yield _item(gap=ezt.boolean(gap), columns=(from_item, to_item))
gap = False
_re_mdiff = re.compile("\0([+-^])(.*?)\1")
def _mdiff_split(flag, (line_number, text)):
"""Break up row from mdiff output into segments"""
segments = []
pos = 0
while True:
m = _re_mdiff.search(text, pos)
if not m:
segments.append(_item(text=sapi.escape(text[pos:]), type=None))
break
if m.start() > pos:
segments.append(_item(text=sapi.escape(text[pos:m.start()]), type=None))
if m.group(1) == "+":
segments.append(_item(text=sapi.escape(m.group(2)), type="add"))
elif m.group(1) == "-":
segments.append(_item(text=sapi.escape(m.group(2)), type="remove"))
elif m.group(1) == "^":
segments.append(_item(text=sapi.escape(m.group(2)), type="change"))
pos = m.end()
return _item(segments=segments, line_number=line_number)
def unified(fromlines, tolines, context):
"""Generate unified diff"""
diff = difflib.Differ().compare(fromlines, tolines)
lastrow = None
for row in _trim_context(diff, context):
if row[0].startswith("? "):
yield _differ_split(lastrow, row[0])
lastrow = None
else:
if lastrow:
yield _differ_split(lastrow, None)
lastrow = row
if lastrow:
yield _differ_split(lastrow, None)
def _trim_context(lines, context_size):
"""Trim context lines that don't surround changes from Differ results
yields (line, leftnum, rightnum, gap) tuples"""
# circular buffer to hold context lines
context_buffer = [None] * (context_size or 0)
context_start = context_len = 0
# number of context lines left to print after encountering a change
context_owed = 0
# current line numbers
leftnum = rightnum = 0
# whether context lines have been dropped
gap = False
for line in lines:
row = save = None
if line.startswith("- "):
leftnum = leftnum + 1
row = line, leftnum, None
context_owed = context_size
elif line.startswith("+ "):
rightnum = rightnum + 1
row = line, None, rightnum
context_owed = context_size
else:
if line.startswith(" "):
leftnum = leftnum = leftnum + 1
rightnum = rightnum = rightnum + 1
if context_owed > 0:
context_owed = context_owed - 1
elif context_size is not None:
save = True
row = line, leftnum, rightnum
if save:
# don't yield row right away, store it in buffer
context_buffer[(context_start + context_len) % context_size] = row
if context_len == context_size:
context_start = (context_start + 1) % context_size
gap = True
else:
context_len = context_len + 1
else:
# yield row, but first drain stuff in buffer
context_len == context_size
while context_len:
yield context_buffer[context_start] + (gap,)
gap = False
context_start = (context_start + 1) % context_size
context_len = context_len - 1
yield row + (gap,)
gap = False
_re_differ = re.compile(r"[+-^]+")
def _differ_split(row, guide):
"""Break row into segments using guide line"""
line, left_number, right_number, gap = row
if left_number and right_number:
type = ""
elif left_number:
type = "remove"
elif right_number:
type = "add"
segments = []
pos = 2
if guide:
assert guide.startswith("? ")
for m in _re_differ.finditer(guide, pos):
if m.start() > pos:
segments.append(_item(text=sapi.escape(line[pos:m.start()]), type=None))
segments.append(_item(text=sapi.escape(line[m.start():m.end()]),
type="change"))
pos = m.end()
segments.append(_item(text=sapi.escape(line[pos:]), type=None))
return _item(gap=ezt.boolean(gap), type=type, segments=segments,
left_number=left_number, right_number=right_number)
class _item:
def __init__(self, **kw):
vars(self).update(kw)
try:
### Using difflib._mdiff function here was the easiest way of obtaining
### intraline diffs for use in ViewVC, but it doesn't exist prior to
### Python 2.4 and is not part of the public difflib API, so for now
### fall back if it doesn't exist.
difflib._mdiff
except AttributeError:
sidebyside = None

191
lib/popen.py Normal file
View File

@@ -0,0 +1,191 @@
# -*-python-*-
#
# Copyright (C) 1999-2009 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# popen.py: a replacement for os.popen()
#
# This implementation of popen() provides a cmd + args calling sequence,
# rather than a system() type of convention. The shell facilities are not
# available, but that implies we can avoid worrying about shell hacks in
# the arguments.
#
# -----------------------------------------------------------------------
import os
import sys
import sapi
import threading
import string
if sys.platform == "win32":
import win32popen
import win32event
import win32process
import debug
import StringIO
def popen(cmd, args, mode, capture_err=1):
if sys.platform == "win32":
command = win32popen.CommandLine(cmd, args)
if string.find(mode, 'r') >= 0:
hStdIn = None
if debug.SHOW_CHILD_PROCESSES:
dbgIn, dbgOut = None, StringIO.StringIO()
handle, hStdOut = win32popen.MakeSpyPipe(0, 1, (dbgOut,))
if capture_err:
hStdErr = hStdOut
dbgErr = dbgOut
else:
dbgErr = StringIO.StringIO()
x, hStdErr = win32popen.MakeSpyPipe(None, 1, (dbgErr,))
else:
handle, hStdOut = win32popen.CreatePipe(0, 1)
if capture_err:
hStdErr = hStdOut
else:
hStdErr = win32popen.NullFile(1)
else:
if debug.SHOW_CHILD_PROCESSES:
dbgIn, dbgOut, dbgErr = StringIO.StringIO(), StringIO.StringIO(), StringIO.StringIO()
hStdIn, handle = win32popen.MakeSpyPipe(1, 0, (dbgIn,))
x, hStdOut = win32popen.MakeSpyPipe(None, 1, (dbgOut,))
x, hStdErr = win32popen.MakeSpyPipe(None, 1, (dbgErr,))
else:
hStdIn, handle = win32popen.CreatePipe(0, 1)
hStdOut = None
hStdErr = None
phandle, pid, thandle, tid = win32popen.CreateProcess(command, hStdIn, hStdOut, hStdErr)
if debug.SHOW_CHILD_PROCESSES:
debug.Process(command, dbgIn, dbgOut, dbgErr)
return _pipe(win32popen.File2FileObject(handle, mode), phandle)
# flush the stdio buffers since we are about to change the FD under them
sys.stdout.flush()
sys.stderr.flush()
r, w = os.pipe()
pid = os.fork()
if pid:
# in the parent
# close the descriptor that we don't need and return the other one.
if string.find(mode, 'r') >= 0:
os.close(w)
return _pipe(os.fdopen(r, mode), pid)
os.close(r)
return _pipe(os.fdopen(w, mode), pid)
# in the child
# we'll need /dev/null for the discarded I/O
null = os.open('/dev/null', os.O_RDWR)
if string.find(mode, 'r') >= 0:
# hook stdout/stderr to the "write" channel
os.dup2(w, 1)
# "close" stdin; the child shouldn't use it
### this isn't quite right... we may want the child to read from stdin
os.dup2(null, 0)
# what to do with errors?
if capture_err:
os.dup2(w, 2)
else:
os.dup2(null, 2)
else:
# hook stdin to the "read" channel
os.dup2(r, 0)
# "close" stdout/stderr; the child shouldn't use them
### this isn't quite right... we may want the child to write to these
os.dup2(null, 1)
os.dup2(null, 2)
# don't need these FDs any more
os.close(null)
os.close(r)
os.close(w)
# the stdin/stdout/stderr are all set up. exec the target
try:
os.execvp(cmd, (cmd,) + tuple(args))
except:
# aid debugging, if the os.execvp above fails for some reason:
print "<h2>exec failed:</h2><pre>", cmd, string.join(args), "</pre>"
raise
# crap. shouldn't be here.
sys.exit(127)
class _pipe:
"Wrapper for a file which can wait() on a child process at close time."
def __init__(self, file, child_pid, done_event = None, thread = None):
self.file = file
self.child_pid = child_pid
if sys.platform == "win32":
if done_event:
self.wait_for = (child_pid, done_event)
else:
self.wait_for = (child_pid,)
else:
self.thread = thread
def eof(self):
### should be calling file.eof() here instead of file.close(), there
### may be data in the pipe or buffer after the process exits
if sys.platform == "win32":
r = win32event.WaitForMultipleObjects(self.wait_for, 1, 0)
if r == win32event.WAIT_OBJECT_0:
self.file.close()
self.file = None
return win32process.GetExitCodeProcess(self.child_pid)
return None
if self.thread and self.thread.isAlive():
return None
pid, status = os.waitpid(self.child_pid, os.WNOHANG)
if pid:
self.file.close()
self.file = None
return status
return None
def close(self):
if self.file:
self.file.close()
self.file = None
if sys.platform == "win32":
win32event.WaitForMultipleObjects(self.wait_for, 1, win32event.INFINITE)
return win32process.GetExitCodeProcess(self.child_pid)
else:
if self.thread:
self.thread.join()
if type(self.child_pid) == type([]):
for pid in self.child_pid:
exit = os.waitpid(pid, 0)[1]
return exit
else:
return os.waitpid(self.child_pid, 0)[1]
return None
def __getattr__(self, name):
return getattr(self.file, name)
def __del__(self):
self.close()

541
lib/py2html.py Executable file
View File

@@ -0,0 +1,541 @@
#!/usr/bin/python -u
""" Python Highlighter Version: 0.8
py2html.py [options] files...
options:
-h print help
- read from stdin, write to stdout
-stdout read from files, write to stdout
-files read from files, write to filename+'.html' (default)
-format:
html output XHTML page (default)
rawhtml output pure XHTML (without headers, titles, etc.)
-mode:
color output in color (default)
mono output b/w (for printing)
-title:Title use 'Title' as title of the generated page
-bgcolor:color use color as background-color for page
-header:file use contents of file as header
-footer:file use contents of file as footer
-URL replace all occurances of 'URL: link' with
'<a href="link">link</a>'; this is always enabled
in CGI mode
-v verbose
Takes the input, assuming it is Python code and formats it into
colored XHTML. When called without parameters the script tries to
work in CGI mode. It looks for a field 'script=URL' and tries to
use that URL as input file. If it can't find this field, the path
info (the part of the URL following the CGI script name) is
tried. In case no host is given, the host where the CGI script
lives and HTTP are used.
* Uses Just van Rossum's PyFontify version 0.3 to tag Python scripts.
You can get it via his homepage on starship:
URL: http://starship.python.net/crew/just
"""
__comments__ = """
The following snippet is a small shell script I use for viewing
Python scripts via less on Unix:
pyless:
#!/bin/sh
# Browse pretty printed Python code using ANSI codes for highlighting
py2html -stdout -format:ansi -mode:color $* | less -r
History:
0.8: Added patch by Patrick Lynch to have py2html.py use style
sheets for markup
0.7: Added patch by Ville Skytt<74> to make py2html.py output
valid XHTML.
0.6: Fixed a bug in .escape_html(); thanks to Vespe Savikko for
finding this one.
0.5: Added a few suggestions by Kevin Ng to make the CGI version
a little more robust.
"""
__copyright__ = """\
Copyright (c) 1998-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
Copyright (c) 2000-2002, eGenix.com Software GmbH; mailto:info@egenix.com
Distributed under the terms and conditions of the eGenix.com Public
License. See http://www.egenix.com/files/python/mxLicense.html for
details, or contact the author. All Rights Reserved.\
"""
__version__ = '0.8'
__cgifooter__ = ('\n<pre># code highlighted using <a href='
'"http://www.lemburg.com/files/python/">py2html.py</a> '
'version %s</pre>\n' % __version__)
import sys,string,re
# Adjust path so that PyFontify is found...
sys.path.append('.')
### Constants
# URL of the input form the user is redirected to in case no script=xxx
# form field is given. The URL *must* be absolute. Leave blank to
# have the script issue an error instead.
INPUT_FORM = 'http://www.lemburg.com/files/python/SoftwareDescriptions.html#py2html.py'
# HTML DOCTYPE and XML namespace
HTML_DOCTYPE = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
HTML_XMLNS = ' xmlns="http://www.w3.org/1999/xhtml"'
### Helpers
def fileio(file, mode='rb', data=None, close=0):
if type(file) == type(''):
f = open(file,mode)
close = 1
else:
f = file
if data:
f.write(data)
else:
data = f.read()
if close: f.close()
return data
### Converter class
class PrettyPrint:
""" generic Pretty Printer class
* supports tagging Python scripts in the following ways:
# format/mode | color mono
# --------------------------
# rawhtml | x x (HTML without headers, etc.)
# html | x x (a HTML page with HEAD&BODY:)
# ansi | x x (with Ansi-escape sequences)
* interfaces:
file_filter -- takes two files: input & output (may be stdin/stdout)
filter -- takes a string and returns the highlighted version
* to create an instance use:
c = PrettyPrint(tagfct,format,mode)
where format and mode must be strings according to the
above table if you plan to use PyFontify.fontify as
tagfct
* the tagfct has to take one argument, text, and return a taglist
(format: [(id,left,right,sublist),...], where id is the
"name" given to the slice left:right in text and sublist is a
taglist for tags inside the slice or None)
"""
# misc settings
title = ''
bgcolor = '#FFFFFF'
css = ''
header = ''
footer = ''
replace_URLs = 0
# formats to be used
formats = {}
def __init__(self,tagfct=None,format='html',mode='color'):
self.tag = tagfct
self.set_mode = getattr(self,'set_mode_%s_%s' % (format, mode))
self.filter = getattr(self,'filter_%s' % format)
def file_filter(self,infile,outfile):
self.set_mode()
text = fileio(infile,'r')
if type(infile) == type('') and self.title == '':
self.title = infile
fileio(outfile,'w',self.filter(text))
### Set pre- and postfixes for formats & modes
#
# These methods must set self.formats to a dictionary having
# an entry for every tag returned by the tagging function.
#
# The format used is simple:
# tag:(prefix,postfix)
# where prefix and postfix are either strings or callable objects,
# that return a string (they are called with the matching tag text
# as only parameter). prefix is inserted in front of the tag, postfix
# is inserted right after the tag.
def set_mode_html_color(self):
self.css = """
<STYLE TYPE="text/css">
<!--
body{ background: %s; }
.PY_KEYWORD{ color: #0000C0; font-weight: bold; }
.PY_COMMENT{ color: #000080; }
.PY_PARAMETER{ color: #C00000; }
.PY_IDENTIFIER{ color: #C00000; font-weight: bold; }
.PY_STRING{ color: #008000; }
-->
</STYLE> """ % self.bgcolor
self.formats = {
'all':('<pre>','</pre>'),
'comment':('<span class="PY_COMMENT">','</span>'),
'keyword':('<span class="PY_KEYWORD">','</span>'),
'parameter':('<span class="PY_PARAMETER">','</span>'),
'identifier':( lambda x,strip=string.strip:
'<a name="%s"><span class="PY_IDENTIFIER">' % (strip(x)),
'</span></a>'),
'string':('<span class="PY_STRING">','</span>')
}
set_mode_rawhtml_color = set_mode_html_color
def set_mode_html_mono(self):
self.css = """
<STYLE TYPE="text/css">
<!--
body{ background-color: %s }
.PY_KEYWORD{ text-decoration: underline }
.PY_COMMENT{ }
.PY_PARAMETER{ }
.PY_IDENTIFIER{ font-weight: bold}
.PY_STRING{ font-style: italic}
-->
</STYLE> """ % self.bgcolor
self.formats = {
'all':('<pre>','</pre>'),
'comment':('<span class="PY_COMMENT">','</span>'),
'keyword':( '<span class="PY_KEYWORD">','</span>'),
'parameter':('<span class="PY_PARAMETER">','</span>'),
'identifier':( lambda x,strip=string.strip:
'<a name="%s"><span class="PY_IDENTIFIER">' % (strip(x)),
'</span></a>'),
'string':('<span class="PY_STRING">','</span>')
}
set_mode_rawhtml_mono = set_mode_html_mono
def set_mode_ansi_mono(self):
self.formats = {
'all':('',''),
'comment':('\033[2m','\033[m'),
'keyword':('\033[4m','\033[m'),
'parameter':('',''),
'identifier':('\033[1m','\033[m'),
'string':('','')
}
def set_mode_ansi_color(self):
self.formats = {
'all':('',''),
'comment':('\033[34;2m','\033[m'),
'keyword':('\033[1;34m','\033[m'),
'parameter':('',''),
'identifier':('\033[1;31m','\033[m'),
'string':('\033[32;2m','\033[m')
}
### Filters for Python scripts given as string
def escape_html(self,text):
t = (('&','&amp;'),('<','&lt;'),('>','&gt;'))
for x,y in t:
text = string.join(string.split(text,x),y)
return text
def filter_html(self,text):
output = self.fontify(self.escape_html(text))
if self.replace_URLs:
output = re.sub('URL:([ \t]+)([^ \n\r<]+)',
'URL:\\1<a href="\\2">\\2</a>',output)
html = """%s<html%s>
<head>
<title>%s</title>
<!--css-->
%s
</head>
<body>
<!--header-->
%s
<!--script-->
%s
<!--footer-->
%s
</body></html>\n"""%(HTML_DOCTYPE,
HTML_XMLNS,
self.title,
self.css,
self.header,
output,
self.footer)
return html
def filter_rawhtml(self,text):
output = self.fontify(self.escape_html(text))
if self.replace_URLs:
output = re.sub('URL:([ \t]+)([^ \n\r<]+)',
'URL:\\1<a href="\\2">\\2</a>',output)
return self.header + output + self.footer
def filter_ansi(self,text):
output = self.fontify(text)
return self.header + output + self.footer
### Fontify engine
def fontify(self,pytext):
# parse
taglist = self.tag(pytext)
# prepend special 'all' tag:
taglist[:0] = [('all',0,len(pytext),None)]
# prepare splitting
splits = []
addsplits(splits,pytext,self.formats,taglist)
# do splitting & inserting
splits.sort()
l = []
li = 0
for ri,dummy,insert in splits:
if ri > li: l.append(pytext[li:ri])
l.append(insert)
li = ri
if li < len(pytext): l.append(pytext[li:])
return string.join(l,'')
def addsplits(splits,text,formats,taglist):
""" Helper for .fontify()
"""
for id,left,right,sublist in taglist:
try:
pre,post = formats[id]
except KeyError:
# sys.stderr.write('Warning: no format for %s specified\n'%repr(id))
pre,post = '',''
if type(pre) != type(''):
pre = pre(text[left:right])
if type(post) != type(''):
post = post(text[left:right])
# len(splits) is a dummy used to make sorting stable
splits.append((left,len(splits),pre))
if sublist:
addsplits(splits,text,formats,sublist)
splits.append((right,len(splits),post))
def write_html_error(titel,text):
print """\
%s<html%s><head><title>%s</title></head>
<body>
<h2>%s</h2>
%s
</body></html>
""" % (HTML_DOCTYPE,HTML_XMLNS,titel,titel,text)
def redirect_to(url):
sys.stdout.write('Content-Type: text/html\r\n')
sys.stdout.write('Status: 302\r\n')
sys.stdout.write('Location: %s\r\n\r\n' % url)
print """
%s<html%s><head>
<title>302 Moved Temporarily</title>
</head><body>
<h1>302 Moved Temporarily</h1>
The document has moved to <a href="%s">%s</a>.<p></p>
</body></html>
""" % (HTML_DOCTYPE,HTML_XMLNS,url,url)
def main(cmdline):
""" main(cmdline) -- process cmdline as if it were sys.argv
"""
# parse options/files
options = []
optvalues = {}
for o in cmdline[1:]:
if o[0] == '-':
if ':' in o:
k,v = tuple(string.split(o,':'))
optvalues[k] = v
options.append(k)
else:
options.append(o)
else:
break
files = cmdline[len(options)+1:]
### create converting object
# load fontifier
if '-marcs' in options:
# use mxTextTool's tagging engine as fontifier
from mx.TextTools import tag
from mx.TextTools.Examples.Python import python_script
tagfct = lambda text,tag=tag,pytable=python_script: \
tag(text,pytable)[1]
print "Py2HTML: using Marc's tagging engine"
else:
# load Just's fontifier
try:
import PyFontify
if PyFontify.__version__ < '0.3': raise ValueError
tagfct = PyFontify.fontify
except:
print """
Sorry, but this script needs the PyFontify.py module version 0.3;
You can download it from Just's homepage at
URL: http://starship.python.net/crew/just
"""
sys.exit()
if '-format' in options:
format = optvalues['-format']
else:
# use default
format = 'html'
if '-mode' in options:
mode = optvalues['-mode']
else:
# use default
mode = 'color'
c = PrettyPrint(tagfct,format,mode)
convert = c.file_filter
### start working
if '-title' in options:
c.title = optvalues['-title']
if '-bgcolor' in options:
c.bgcolor = optvalues['-bgcolor']
if '-header' in options:
try:
f = open(optvalues['-header'])
c.header = f.read()
f.close()
except IOError:
if verbose: print 'IOError: header file not found'
if '-footer' in options:
try:
f = open(optvalues['-footer'])
c.footer = f.read()
f.close()
except IOError:
if verbose: print 'IOError: footer file not found'
if '-URL' in options:
c.replace_URLs = 1
if '-' in options:
convert(sys.stdin,sys.stdout)
sys.exit()
if '-h' in options:
print __doc__
sys.exit()
if len(files) == 0:
# Turn URL processing on
c.replace_URLs = 1
# Try CGI processing...
import cgi,urllib,urlparse,os
form = cgi.FieldStorage()
if not form.has_key('script'):
# Ok, then try pathinfo
if not os.environ.has_key('PATH_INFO'):
if INPUT_FORM:
redirect_to(INPUT_FORM)
else:
sys.stdout.write('Content-Type: text/html\r\n\r\n')
write_html_error('Missing Parameter',
'Missing script=URL field in request')
sys.exit(1)
url = os.environ['PATH_INFO'][1:] # skip the leading slash
else:
url = form['script'].value
sys.stdout.write('Content-Type: text/html\r\n\r\n')
scheme, host, path, params, query, frag = urlparse.urlparse(url)
if not host:
scheme = 'http'
if os.environ.has_key('HTTP_HOST'):
host = os.environ['HTTP_HOST']
else:
host = 'localhost'
url = urlparse.urlunparse((scheme, host, path, params, query, frag))
#print url; sys.exit()
network = urllib.URLopener()
try:
tempfile,headers = network.retrieve(url)
except IOError,reason:
write_html_error('Error opening "%s"' % url,
'The given URL could not be opened. Reason: %s' %\
str(reason))
sys.exit(1)
f = open(tempfile,'rb')
c.title = url
c.footer = __cgifooter__
convert(f,sys.stdout)
f.close()
network.close()
sys.exit()
if '-stdout' in options:
filebreak = '-'*72
for f in files:
try:
if len(files) > 1:
print filebreak
print 'File:',f
print filebreak
convert(f,sys.stdout)
except IOError:
pass
else:
verbose = ('-v' in options)
if verbose:
print 'Py2HTML: working on',
for f in files:
try:
if verbose: print f,
convert(f,f+'.html')
except IOError:
if verbose: print '(IOError!)',
if verbose:
print
print 'Done.'
if __name__=='__main__':
main(sys.argv)

479
lib/query.py Normal file
View File

@@ -0,0 +1,479 @@
#!/usr/bin/env python
# -*-python-*-
#
# Copyright (C) 1999-2010 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# CGI script to process and display queries to CVSdb
#
# This script is part of the ViewVC package. More information can be
# found at http://viewvc.org
#
# -----------------------------------------------------------------------
import os
import sys
import string
import time
import cvsdb
import viewvc
import ezt
import debug
import urllib
import fnmatch
class FormData:
def __init__(self, form):
self.valid = 0
self.repository = ""
self.branch = ""
self.directory = ""
self.file = ""
self.who = ""
self.sortby = ""
self.date = ""
self.hours = 0
self.decode_thyself(form)
def decode_thyself(self, form):
try:
self.repository = string.strip(form["repository"].value)
except KeyError:
pass
except TypeError:
pass
else:
self.valid = 1
try:
self.branch = string.strip(form["branch"].value)
except KeyError:
pass
except TypeError:
pass
else:
self.valid = 1
try:
self.directory = string.strip(form["directory"].value)
except KeyError:
pass
except TypeError:
pass
else:
self.valid = 1
try:
self.file = string.strip(form["file"].value)
except KeyError:
pass
except TypeError:
pass
else:
self.valid = 1
try:
self.who = string.strip(form["who"].value)
except KeyError:
pass
except TypeError:
pass
else:
self.valid = 1
try:
self.sortby = string.strip(form["sortby"].value)
except KeyError:
pass
except TypeError:
pass
try:
self.date = string.strip(form["date"].value)
except KeyError:
pass
except TypeError:
pass
try:
self.hours = int(form["hours"].value)
except KeyError:
pass
except TypeError:
pass
except ValueError:
pass
else:
self.valid = 1
## returns a tuple-list (mod-str, string)
def listparse_string(str):
return_list = []
cmd = ""
temp = ""
escaped = 0
state = "eat leading whitespace"
for c in str:
## handle escaped charactors
if not escaped and c == "\\":
escaped = 1
continue
## strip leading white space
if state == "eat leading whitespace":
if c in string.whitespace:
continue
else:
state = "get command or data"
## parse to '"' or ","
if state == "get command or data":
## just add escaped charactors
if escaped:
escaped = 0
temp = temp + c
continue
## the data is in quotes after the command
elif c == "\"":
cmd = temp
temp = ""
state = "get quoted data"
continue
## this tells us there was no quoted data, therefore no
## command; add the command and start over
elif c == ",":
## strip ending whitespace on un-quoted data
temp = string.rstrip(temp)
return_list.append( ("", temp) )
temp = ""
state = "eat leading whitespace"
continue
## record the data
else:
temp = temp + c
continue
## parse until ending '"'
if state == "get quoted data":
## just add escaped charactors
if escaped:
escaped = 0
temp = temp + c
continue
## look for ending '"'
elif c == "\"":
return_list.append( (cmd, temp) )
cmd = ""
temp = ""
state = "eat comma after quotes"
continue
## record the data
else:
temp = temp + c
continue
## parse until ","
if state == "eat comma after quotes":
if c in string.whitespace:
continue
elif c == ",":
state = "eat leading whitespace"
continue
else:
print "format error"
sys.exit(1)
if cmd or temp:
return_list.append((cmd, temp))
return return_list
def decode_command(cmd):
if cmd == "r":
return "regex"
elif cmd == "l":
return "like"
else:
return "exact"
def form_to_cvsdb_query(cfg, form_data):
query = cvsdb.CreateCheckinQuery()
query.SetLimit(cfg.cvsdb.row_limit)
if form_data.repository:
for cmd, str in listparse_string(form_data.repository):
cmd = decode_command(cmd)
query.SetRepository(str, cmd)
if form_data.branch:
for cmd, str in listparse_string(form_data.branch):
cmd = decode_command(cmd)
query.SetBranch(str, cmd)
if form_data.directory:
for cmd, str in listparse_string(form_data.directory):
cmd = decode_command(cmd)
query.SetDirectory(str, cmd)
if form_data.file:
for cmd, str in listparse_string(form_data.file):
cmd = decode_command(cmd)
query.SetFile(str, cmd)
if form_data.who:
for cmd, str in listparse_string(form_data.who):
cmd = decode_command(cmd)
query.SetAuthor(str, cmd)
if form_data.sortby == "author":
query.SetSortMethod("author")
elif form_data.sortby == "file":
query.SetSortMethod("file")
else:
query.SetSortMethod("date")
if form_data.date:
if form_data.date == "hours" and form_data.hours:
query.SetFromDateHoursAgo(form_data.hours)
elif form_data.date == "day":
query.SetFromDateDaysAgo(1)
elif form_data.date == "week":
query.SetFromDateDaysAgo(7)
elif form_data.date == "month":
query.SetFromDateDaysAgo(31)
return query
def prev_rev(rev):
'''Returns a string representing the previous revision of the argument.'''
r = string.split(rev, '.')
# decrement final revision component
r[-1] = str(int(r[-1]) - 1)
# prune if we pass the beginning of the branch
if len(r) > 2 and r[-1] == '0':
r = r[:-2]
return string.join(r, '.')
def is_forbidden(cfg, cvsroot_name, module):
'''Return 1 if MODULE in CVSROOT_NAME is forbidden; return 0 otherwise.'''
# CVSROOT_NAME might be None here if the data comes from an
# unconfigured root. This interfaces doesn't care that the root
# isn't configured, but if that's the case, it will consult only
# the base and per-vhost configuration for authorizer and
# authorizer parameters.
if cvsroot_name:
authorizer, params = cfg.get_authorizer_and_params_hack(cvsroot_name)
else:
authorizer = cfg.options.authorizer
params = cfg.get_authorizer_params()
# If CVSROOT_NAME isn't configured to use an authorizer, nothing
# is forbidden. If it's configured to use something other than
# the 'forbidden' authorizer, complain. Otherwise, check for
# forbiddenness per the PARAMS as expected.
if not authorizer:
return 0
if authorizer != 'forbidden':
raise Exception("The 'forbidden' authorizer is the only one supported "
"by this interface. The '%s' root is configured to "
"use a different one." % (cvsroot_name))
forbidden = params.get('forbidden', '')
forbidden = map(string.strip, filter(None, string.split(forbidden, ',')))
default = 0
for pat in forbidden:
if pat[0] == '!':
default = 1
if fnmatch.fnmatchcase(module, pat[1:]):
return 0
elif fnmatch.fnmatchcase(module, pat):
return 1
return default
def build_commit(server, cfg, desc, files, cvsroots, viewvc_link):
ob = _item(num_files=len(files), files=[])
ob.log = desc and string.replace(server.escape(desc), '\n', '<br />') or ''
for commit in files:
repository = commit.GetRepository()
directory = commit.GetDirectory()
cvsroot_name = cvsroots.get(repository)
## find the module name (if any)
try:
module = filter(None, string.split(directory, '/'))[0]
except IndexError:
module = None
## skip commits we aren't supposed to show
if module and ((module == 'CVSROOT' and cfg.options.hide_cvsroot) \
or is_forbidden(cfg, cvsroot_name, module)):
continue
ctime = commit.GetTime()
if not ctime:
ctime = "&nbsp;"
else:
if (cfg.options.use_localtime):
ctime = time.strftime("%y/%m/%d %H:%M %Z", time.localtime(ctime))
else:
ctime = time.strftime("%y/%m/%d %H:%M", time.gmtime(ctime)) \
+ ' UTC'
## make the file link
try:
file = (directory and directory + "/") + commit.GetFile()
except:
raise Exception, str([directory, commit.GetFile()])
## If we couldn't find the cvsroot path configured in the
## viewvc.conf file, or we don't have a VIEWVC_LINK, then
## don't make the link.
if cvsroot_name and viewvc_link:
flink = '[%s] <a href="%s/%s?root=%s">%s</a>' % (
cvsroot_name, viewvc_link, urllib.quote(file),
cvsroot_name, file)
if commit.GetType() == commit.CHANGE:
dlink = '%s/%s?root=%s&amp;view=diff&amp;r1=%s&amp;r2=%s' % (
viewvc_link, urllib.quote(file), cvsroot_name,
prev_rev(commit.GetRevision()), commit.GetRevision())
else:
dlink = None
else:
flink = '[%s] %s' % (repository, file)
dlink = None
ob.files.append(_item(date=ctime,
author=commit.GetAuthor(),
link=flink,
rev=commit.GetRevision(),
branch=commit.GetBranch(),
plus=int(commit.GetPlusCount()),
minus=int(commit.GetMinusCount()),
type=commit.GetTypeString(),
difflink=dlink,
))
return ob
def run_query(server, cfg, form_data, viewvc_link):
query = form_to_cvsdb_query(cfg, form_data)
db = cvsdb.ConnectDatabaseReadOnly(cfg)
db.RunQuery(query)
commit_list = query.GetCommitList()
if not commit_list:
return [ ], 0
row_limit_reached = query.GetLimitReached()
commits = [ ]
files = [ ]
cvsroots = {}
viewvc.expand_root_parents(cfg)
rootitems = cfg.general.svn_roots.items() + cfg.general.cvs_roots.items()
for key, value in rootitems:
cvsroots[cvsdb.CleanRepository(value)] = key
current_desc = commit_list[0].GetDescription()
for commit in commit_list:
desc = commit.GetDescription()
if current_desc == desc:
files.append(commit)
continue
commits.append(build_commit(server, cfg, current_desc, files,
cvsroots, viewvc_link))
files = [ commit ]
current_desc = desc
## add the last file group to the commit list
commits.append(build_commit(server, cfg, current_desc, files,
cvsroots, viewvc_link))
# Strip out commits that don't have any files attached to them. The
# files probably aren't present because they've been blocked via
# forbiddenness.
def _only_with_files(commit):
return len(commit.files) > 0
commits = filter(_only_with_files, commits)
return commits, row_limit_reached
def main(server, cfg, viewvc_link):
try:
form = server.FieldStorage()
form_data = FormData(form)
if form_data.valid:
commits, row_limit_reached = run_query(server, cfg,
form_data, viewvc_link)
query = None
else:
commits = [ ]
row_limit_reached = 0
query = 'skipped'
docroot = cfg.options.docroot
if docroot is None and viewvc_link:
docroot = viewvc_link + '/' + viewvc.docroot_magic_path
data = ezt.TemplateData({
'cfg' : cfg,
'address' : cfg.general.address,
'vsn' : viewvc.__version__,
'repository' : server.escape(form_data.repository),
'branch' : server.escape(form_data.branch),
'directory' : server.escape(form_data.directory),
'file' : server.escape(form_data.file),
'who' : server.escape(form_data.who),
'docroot' : docroot,
'sortby' : form_data.sortby,
'date' : form_data.date,
'query' : query,
'row_limit_reached' : ezt.boolean(row_limit_reached),
'commits' : commits,
'num_commits' : len(commits),
'rss_href' : None,
'hours' : form_data.hours and form_data.hours or 2,
})
# generate the page
server.header()
template = viewvc.get_view_template(cfg, "query")
template.generate(server.file(), data)
except SystemExit, e:
pass
except:
exc_info = debug.GetExceptionData()
server.header(status=exc_info['status'])
debug.PrintException(server, exc_info)
class _item:
def __init__(self, **kw):
vars(self).update(kw)

447
lib/sapi.py Normal file
View File

@@ -0,0 +1,447 @@
# -*-python-*-
#
# Copyright (C) 1999-2010 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# generic server api - currently supports normal cgi, mod_python, and
# active server pages
#
# -----------------------------------------------------------------------
import types
import string
import os
import sys
import re
import cgi
# global server object. It will be either a CgiServer, a WsgiServer,
# or a proxy to an AspServer or ModPythonServer object.
server = None
# Simple HTML string escaping. Note that we always escape the
# double-quote character -- ViewVC shouldn't ever need to preserve
# that character as-is, and sometimes needs to embed escaped values
# into HTML attributes.
def escape(s):
s = str(s)
s = string.replace(s, '&', '&amp;')
s = string.replace(s, '>', '&gt;')
s = string.replace(s, '<', '&lt;')
s = string.replace(s, '"', "&quot;")
return s
class Server:
def __init__(self):
self.pageGlobals = {}
def self(self):
return self
def escape(self, s):
return escape(s)
def close(self):
pass
class ThreadedServer(Server):
def __init__(self):
Server.__init__(self)
self.inheritableOut = 0
global server
if not isinstance(server, ThreadedServerProxy):
server = ThreadedServerProxy()
if not isinstance(sys.stdout, File):
sys.stdout = File(server)
server.registerThread(self)
def file(self):
return File(self)
def close(self):
server.unregisterThread()
class ThreadedServerProxy:
"""In a multithreaded server environment, ThreadedServerProxy stores the
different server objects being used to display pages and transparently
forwards access to them based on the current thread id."""
def __init__(self):
self.__dict__['servers'] = { }
global thread
import thread
def registerThread(self, server):
self.__dict__['servers'][thread.get_ident()] = server
def unregisterThread(self):
del self.__dict__['servers'][thread.get_ident()]
def self(self):
"""This function bypasses the getattr and setattr trickery and returns
the actual server object."""
return self.__dict__['servers'][thread.get_ident()]
def __getattr__(self, key):
return getattr(self.self(), key)
def __setattr__(self, key, value):
setattr(self.self(), key, value)
def __delattr__(self, key):
delattr(self.self(), key)
class File:
def __init__(self, server):
self.closed = 0
self.mode = 'w'
self.name = "<AspFile file>"
self.softspace = 0
self.server = server
def write(self, s):
self.server.write(s)
def writelines(self, list):
for s in list:
self.server.write(s)
def flush(self):
self.server.flush()
def truncate(self, size):
pass
def close(self):
pass
class CgiServer(Server):
def __init__(self, inheritableOut = 1):
Server.__init__(self)
self.headerSent = 0
self.headers = []
self.inheritableOut = inheritableOut
self.iis = os.environ.get('SERVER_SOFTWARE', '')[:13] == 'Microsoft-IIS'
if sys.platform == "win32" and inheritableOut:
import msvcrt
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
global server
server = self
def addheader(self, name, value):
self.headers.append((name, value))
def header(self, content_type='text/html; charset=UTF-8', status=None):
if not self.headerSent:
self.headerSent = 1
extraheaders = ''
for (name, value) in self.headers:
extraheaders = extraheaders + '%s: %s\r\n' % (name, value)
# The only way ViewVC pages and error messages are visible under
# IIS is if a 200 error code is returned. Otherwise IIS instead
# sends the static error page corresponding to the code number.
if status is None or (status[:3] != '304' and self.iis):
status = ''
else:
status = 'Status: %s\r\n' % status
sys.stdout.write('%sContent-Type: %s\r\n%s\r\n'
% (status, content_type, extraheaders))
def redirect(self, url):
if self.iis: url = fix_iis_url(self, url)
self.addheader('Location', url)
self.header(status='301 Moved')
sys.stdout.write('This document is located <a href="%s">here</a>.\n' % url)
def getenv(self, name, value=None):
ret = os.environ.get(name, value)
if self.iis and name == 'PATH_INFO' and ret:
ret = fix_iis_path_info(self, ret)
return ret
def params(self):
return cgi.parse()
def FieldStorage(fp=None, headers=None, outerboundary="",
environ=os.environ, keep_blank_values=0, strict_parsing=0):
return cgi.FieldStorage(fp, headers, outerboundary, environ,
keep_blank_values, strict_parsing)
def write(self, s):
sys.stdout.write(s)
def flush(self):
sys.stdout.flush()
def file(self):
return sys.stdout
class WsgiServer(Server):
def __init__(self, environ, start_response):
Server.__init__(self)
self._environ = environ
self._start_response = start_response;
self._headers = []
self._wsgi_write = None
self.headerSent = False
global server
server = self
global cgi
import cgi
def addheader(self, name, value):
self._headers.append((name, value))
def header(self, content_type='text/html; charset=UTF-8', status=None):
if not status:
status = "200 OK"
if not self.headerSent:
self.headerSent = True
self._headers.insert(0, ("Content-Type", content_type),)
self._wsgi_write = self._start_response("%s" % status, self._headers)
def redirect(self, url):
"""Redirect client to url. This discards any data that has been queued
to be sent to the user. But there should never by any anyway.
"""
self.addheader('Location', url)
self.header(status='301 Moved')
self._wsgi_write('This document is located <a href="%s">here</a>.' % url)
def getenv(self, name, value=None):
return self._environ.get(name, value)
def params(self):
return cgi.parse(environ=self._environ, fp=self._environ["wsgi.input"])
def FieldStorage(self, fp=None, headers=None, outerboundary="",
environ=os.environ, keep_blank_values=0, strict_parsing=0):
return cgi.FieldStorage(self._environ["wsgi.input"], headers,
outerboundary, self._environ, keep_blank_values,
strict_parsing)
def write(self, s):
self._wsgi_write(s)
def flush(self):
pass
def file(self):
return File(self)
class AspServer(ThreadedServer):
def __init__(self, Server, Request, Response, Application):
ThreadedServer.__init__(self)
self.headerSent = 0
self.server = Server
self.request = Request
self.response = Response
self.application = Application
def addheader(self, name, value):
self.response.AddHeader(name, value)
def header(self, content_type=None, status=None):
# Normally, setting self.response.ContentType after headers have already
# been sent simply results in an AttributeError exception, but sometimes
# it leads to a fatal ASP error. For this reason I'm keeping the
# self.headerSent member and only checking for the exception as a
# secondary measure
if not self.headerSent:
try:
self.headerSent = 1
if content_type is None:
self.response.ContentType = 'text/html; charset=UTF-8'
else:
self.response.ContentType = content_type
if status is not None: self.response.Status = status
except AttributeError:
pass
def redirect(self, url):
self.response.Redirect(url)
def getenv(self, name, value = None):
ret = self.request.ServerVariables(name)()
if not type(ret) is types.UnicodeType:
return value
ret = str(ret)
if name == 'PATH_INFO':
ret = fix_iis_path_info(self, ret)
return ret
def params(self):
p = {}
for i in self.request.Form:
p[str(i)] = map(str, self.request.Form[i])
for i in self.request.QueryString:
p[str(i)] = map(str, self.request.QueryString[i])
return p
def FieldStorage(self, fp=None, headers=None, outerboundary="",
environ=os.environ, keep_blank_values=0, strict_parsing=0):
# Code based on a very helpful usenet post by "Max M" (maxm@mxm.dk)
# Subject "Re: Help! IIS and Python"
# http://groups.google.com/groups?selm=3C7C0AB6.2090307%40mxm.dk
from StringIO import StringIO
from cgi import FieldStorage
environ = {}
for i in self.request.ServerVariables:
environ[str(i)] = str(self.request.ServerVariables(i)())
# this would be bad for uploaded files, could use a lot of memory
binaryContent, size = self.request.BinaryRead(int(environ['CONTENT_LENGTH']))
fp = StringIO(str(binaryContent))
fs = FieldStorage(fp, None, "", environ, keep_blank_values, strict_parsing)
fp.close()
return fs
def write(self, s):
t = type(s)
if t is types.StringType:
s = buffer(s)
elif not t is types.BufferType:
s = buffer(str(s))
self.response.BinaryWrite(s)
def flush(self):
self.response.Flush()
_re_status = re.compile("\\d+")
class ModPythonServer(ThreadedServer):
def __init__(self, request):
ThreadedServer.__init__(self)
self.request = request
self.headerSent = 0
def addheader(self, name, value):
self.request.headers_out.add(name, value)
def header(self, content_type=None, status=None):
if content_type is None:
self.request.content_type = 'text/html; charset=UTF-8'
else:
self.request.content_type = content_type
self.headerSent = 1
if status is not None:
m = _re_status.match(status)
if not m is None:
self.request.status = int(m.group())
def redirect(self, url):
import mod_python.apache
self.request.headers_out['Location'] = url
self.request.status = mod_python.apache.HTTP_MOVED_TEMPORARILY
self.request.write("You are being redirected to <a href=\"%s\">%s</a>"
% (url, url))
def getenv(self, name, value = None):
try:
return self.request.subprocess_env[name]
except KeyError:
return value
def params(self):
import mod_python.util
if self.request.args is None:
return {}
else:
return mod_python.util.parse_qs(self.request.args)
def FieldStorage(self, fp=None, headers=None, outerboundary="",
environ=os.environ, keep_blank_values=0, strict_parsing=0):
import mod_python.util
return mod_python.util.FieldStorage(self.request, keep_blank_values, strict_parsing)
def write(self, s):
self.request.write(s)
def flush(self):
pass
def fix_iis_url(server, url):
"""When a CGI application under IIS outputs a "Location" header with a url
beginning with a forward slash, IIS tries to optimise the redirect by not
returning any output from the original CGI script at all and instead just
returning the new page in its place. Because of this, the browser does
not know it is getting a different page than it requested. As a result,
The address bar that appears in the browser window shows the wrong location
and if the new page is in a different folder than the old one, any relative
links on it will be broken.
This function can be used to circumvent the IIS "optimization" of local
redirects. If it is passed a location that begins with a forward slash it
will return a URL constructed with the information in CGI environment.
If it is passed a URL or any location that doens't begin with a forward slash
it will return just argument unaltered.
"""
if url[0] == '/':
if server.getenv('HTTPS') == 'on':
dport = "443"
prefix = "https://"
else:
dport = "80"
prefix = "http://"
prefix = prefix + server.getenv('HTTP_HOST')
if server.getenv('SERVER_PORT') != dport:
prefix = prefix + ":" + server.getenv('SERVER_PORT')
return prefix + url
return url
def fix_iis_path_info(server, path_info):
"""Fix the PATH_INFO value in IIS"""
# If the viewvc cgi's are in the /viewvc/ folder on the web server and a
# request looks like
#
# /viewvc/viewvc.cgi/myproject/?someoption
#
# The CGI environment variables on IIS will look like this:
#
# SCRIPT_NAME = /viewvc/viewvc.cgi
# PATH_INFO = /viewvc/viewvc.cgi/myproject/
#
# Whereas on Apache they look like:
#
# SCRIPT_NAME = /viewvc/viewvc.cgi
# PATH_INFO = /myproject/
#
# This function converts the IIS PATH_INFO into the nonredundant form
# expected by ViewVC
return path_info[len(server.getenv('SCRIPT_NAME', '')):]

60
lib/vcauth/__init__.py Normal file
View File

@@ -0,0 +1,60 @@
# -*-python-*-
#
# Copyright (C) 2006-2010 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
"""Generic API for implementing authorization checks employed by ViewVC."""
import string
import vclib
class GenericViewVCAuthorizer:
"""Abstract class encapsulating version control authorization routines."""
def __init__(self, username=None, params={}):
"""Create a GenericViewVCAuthorizer object which will be used to
validate that USERNAME has the permissions needed to view version
control repositories (in whole or in part). PARAMS is a
dictionary of custom parameters for the authorizer."""
pass
def check_root_access(self, rootname):
"""Return 1 iff the associated username is permitted to read ROOTNAME."""
pass
def check_universal_access(self, rootname):
"""Return 1 if the associated username is permitted to read every
path in the repository at every revision, 0 if the associated
username is prohibited from reading any path in the repository, or
None if no such determination can be made (perhaps because the
cost of making it is too great)."""
pass
def check_path_access(self, rootname, path_parts, pathtype, rev=None):
"""Return 1 iff the associated username is permitted to read
revision REV of the path PATH_PARTS (of type PATHTYPE) in
repository ROOTNAME."""
pass
##############################################################################
class ViewVCAuthorizer(GenericViewVCAuthorizer):
"""The uber-permissive authorizer."""
def check_root_access(self, rootname):
return 1
def check_universal_access(self, rootname):
return 1
def check_path_access(self, rootname, path_parts, pathtype, rev=None):
return 1

View File

@@ -0,0 +1,53 @@
# -*-python-*-
#
# Copyright (C) 2006-2010 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
import vcauth
import vclib
import fnmatch
import string
class ViewVCAuthorizer(vcauth.GenericViewVCAuthorizer):
"""A simple top-level module authorizer."""
def __init__(self, username, params={}):
forbidden = params.get('forbidden', '')
self.forbidden = map(string.strip,
filter(None, string.split(forbidden, ',')))
def check_root_access(self, rootname):
return 1
def check_universal_access(self, rootname):
# If there aren't any forbidden paths, we can grant universal read
# access. Otherwise, we make no claim.
if not self.forbidden:
return 1
return None
def check_path_access(self, rootname, path_parts, pathtype, rev=None):
# No path? No problem.
if not path_parts:
return 1
# Not a directory? We aren't interested.
if pathtype != vclib.DIR:
return 1
# At this point we're looking at a directory path.
module = path_parts[0]
default = 1
for pat in self.forbidden:
if pat[0] == '!':
default = 0
if fnmatch.fnmatchcase(module, pat[1:]):
return 1
elif fnmatch.fnmatchcase(module, pat):
return 0
return default

View File

@@ -0,0 +1,65 @@
# -*-python-*-
#
# Copyright (C) 2008-2010 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
import vcauth
import vclib
import fnmatch
import string
import re
def _split_regexp(restr):
"""Return a 2-tuple consisting of a compiled regular expression
object and a boolean flag indicating if that object should be
interpreted inversely."""
if restr[0] == '!':
return re.compile(restr[1:]), 1
return re.compile(restr), 0
class ViewVCAuthorizer(vcauth.GenericViewVCAuthorizer):
"""A simple regular-expression-based authorizer."""
def __init__(self, username, params={}):
forbidden = params.get('forbiddenre', '')
self.forbidden = map(lambda x: _split_regexp(string.strip(x)),
filter(None, string.split(forbidden, ',')))
def _check_root_path_access(self, root_path):
default = 1
for forbidden, negated in self.forbidden:
if negated:
default = 0
if forbidden.search(root_path):
return 1
elif forbidden.search(root_path):
return 0
return default
def check_root_access(self, rootname):
return self._check_root_path_access(rootname)
def check_universal_access(self, rootname):
# If there aren't any forbidden regexps, we can grant universal
# read access. Otherwise, we make no claim.
if not self.forbidden:
return 1
return None
def check_path_access(self, rootname, path_parts, pathtype, rev=None):
root_path = rootname
if path_parts:
root_path = root_path + '/' + string.join(path_parts, '/')
if pathtype == vclib.DIR:
root_path = root_path + '/'
else:
root_path = root_path + '/'
return self._check_root_path_access(root_path)

View File

@@ -0,0 +1,270 @@
# -*-python-*-
#
# Copyright (C) 2006-2011 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
# (c) 2006 Sergey Lapin <slapin@dataart.com>
import vcauth
import string
import os.path
import debug
from ConfigParser import ConfigParser
class ViewVCAuthorizer(vcauth.GenericViewVCAuthorizer):
"""Subversion authz authorizer module"""
def __init__(self, username, params={}):
self.rootpaths = { } # {root -> { paths -> access boolean for USERNAME }}
# Get the authz file location from a passed-in parameter.
self.authz_file = params.get('authzfile')
if not self.authz_file:
raise debug.ViewVCException("No authzfile configured")
if not os.path.exists(self.authz_file):
raise debug.ViewVCException("Configured authzfile file not found")
# See if the admin wants us to do case normalization of usernames.
self.force_username_case = params.get('force_username_case')
if self.force_username_case == "upper":
self.username = username.upper()
elif self.force_username_case == "lower":
self.username = username.lower()
elif not self.force_username_case:
self.username = username
else:
raise debug.ViewVCException("Invalid value for force_username_case "
"option")
def _get_paths_for_root(self, rootname):
if self.rootpaths.has_key(rootname):
return self.rootpaths[rootname]
paths_for_root = { }
# Parse the authz file, replacing ConfigParser's optionxform()
# method with something that won't futz with the case of the
# option names.
cp = ConfigParser()
cp.optionxform = lambda x: x
try:
cp.read(self.authz_file)
except:
raise debug.ViewVCException("Unable to parse configured authzfile file")
# Figure out if there are any aliases for the current username
aliases = []
if cp.has_section('aliases'):
for alias in cp.options('aliases'):
entry = cp.get('aliases', alias)
if entry == self.username:
aliases.append(alias)
# Figure out which groups USERNAME has a part of.
groups = []
if cp.has_section('groups'):
all_groups = []
def _process_group(groupname):
"""Inline function to handle groups within groups.
For a group to be within another group in SVN, the group
definitions must be in the correct order in the config file.
ie. If group A is a member of group B then group A must be
defined before group B in the [groups] section.
Unfortunately, the ConfigParser class provides no way of
finding the order in which groups were defined so, for reasons
of practicality, this function lets you get away with them
being defined in the wrong order. Recursion is guarded
against though."""
# If we already know the user is part of this already-
# processed group, return that fact.
if groupname in groups:
return 1
# Otherwise, ensure we don't process a group twice.
if groupname in all_groups:
return 0
# Store the group name in a global list so it won't be processed again
all_groups.append(groupname)
group_member = 0
groupname = groupname.strip()
entries = string.split(cp.get('groups', groupname), ',')
for entry in entries:
entry = string.strip(entry)
if entry == self.username:
group_member = 1
break
elif entry[0:1] == "@" and _process_group(entry[1:]):
group_member = 1
break
elif entry[0:1] == "&" and entry[1:] in aliases:
group_member = 1
break
if group_member:
groups.append(groupname)
return group_member
# Process the groups
for group in cp.options('groups'):
_process_group(group)
def _userspec_matches_user(userspec):
# If there is an inversion character, recurse and return the
# opposite result.
if userspec[0:1] == '~':
return not _userspec_matches_user(userspec[1:])
# See if the userspec applies to our current user.
return userspec == '*' \
or userspec == self.username \
or (self.username is not None and userspec == "$authenticated") \
or (self.username is None and userspec == "$anonymous") \
or (userspec[0:1] == "@" and userspec[1:] in groups) \
or (userspec[0:1] == "&" and userspec[1:] in aliases)
def _process_access_section(section):
"""Inline function for determining user access in a single
config secction. Return a two-tuple (ALLOW, DENY) containing
the access determination for USERNAME in a given authz file
SECTION (if any)."""
# Figure if this path is explicitly allowed or denied to USERNAME.
allow = deny = 0
for user in cp.options(section):
user = string.strip(user)
if _userspec_matches_user(user):
# See if the 'r' permission is among the ones granted to
# USER. If so, we can stop looking. (Entry order is not
# relevant -- we'll use the most permissive entry, meaning
# one 'allow' is all we need.)
allow = string.find(cp.get(section, user), 'r') != -1
deny = not allow
if allow:
break
return allow, deny
# Read the other (non-"groups") sections, and figure out in which
# repositories USERNAME or his groups have read rights. We'll
# first check groups that have no specific repository designation,
# then superimpose those that have a repository designation which
# matches the one we're asking about.
root_sections = []
for section in cp.sections():
# Skip the "groups" section -- we handled that already.
if section == 'groups':
continue
if section == 'aliases':
continue
# Process root-agnostic access sections; skip (but remember)
# root-specific ones that match our root; ignore altogether
# root-specific ones that don't match our root. While we're at
# it, go ahead and figure out the repository path we're talking
# about.
if section.find(':') == -1:
path = section
else:
name, path = string.split(section, ':', 1)
if name == rootname:
root_sections.append(section)
continue
# Check for a specific access determination.
allow, deny = _process_access_section(section)
# If we got an explicit access determination for this path and this
# USERNAME, record it.
if allow or deny:
if path != '/':
path = '/' + string.join(filter(None, string.split(path, '/')), '/')
paths_for_root[path] = allow
# Okay. Superimpose those root-specific values now.
for section in root_sections:
# Get the path again.
name, path = string.split(section, ':', 1)
# Check for a specific access determination.
allow, deny = _process_access_section(section)
# If we got an explicit access determination for this path and this
# USERNAME, record it.
if allow or deny:
if path != '/':
path = '/' + string.join(filter(None, string.split(path, '/')), '/')
paths_for_root[path] = allow
# If the root isn't readable, there's no point in caring about all
# the specific paths the user can't see. Just point the rootname
# to a None paths dictionary.
root_is_readable = 0
for path in paths_for_root.keys():
if paths_for_root[path]:
root_is_readable = 1
break
if not root_is_readable:
paths_for_root = None
self.rootpaths[rootname] = paths_for_root
return paths_for_root
def check_root_access(self, rootname):
paths = self._get_paths_for_root(rootname)
return (paths is not None) and 1 or 0
def check_universal_access(self, rootname):
paths = self._get_paths_for_root(rootname)
if not paths: # None or empty.
return 0
# Search the access determinations. If there's a mix, we can't
# claim a universal access determination.
found_allow = 0
found_deny = 0
for access in paths.values():
if access:
found_allow = 1
else:
found_deny = 1
if found_allow and found_deny:
return None
# We didn't find both allowances and denials, so we must have
# found one or the other. Denials only is a universal denial.
if found_deny:
return 0
# ... but allowances only is only a universal allowance if read
# access is granted to the root directory.
if found_allow and paths.has_key('/'):
return 1
# Anything else is indeterminable.
return None
def check_path_access(self, rootname, path_parts, pathtype, rev=None):
# Crawl upward from the path represented by PATH_PARTS toward to
# the root of the repository, looking for an explicitly grant or
# denial of access.
paths = self._get_paths_for_root(rootname)
if paths is None:
return 0
parts = path_parts[:]
while parts:
path = '/' + string.join(parts, '/')
if paths.has_key(path):
return paths[path]
del parts[-1]
return paths.get('/', 0)

424
lib/vclib/__init__.py Normal file
View File

@@ -0,0 +1,424 @@
# -*-python-*-
#
# Copyright (C) 1999-2011 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
"""Version Control lib is an abstract API to access versioning systems
such as CVS.
"""
import string
import types
# item types returned by Repository.itemtype().
FILE = 'FILE'
DIR = 'DIR'
# diff types recognized by Repository.rawdiff().
UNIFIED = 1
CONTEXT = 2
SIDE_BY_SIDE = 3
# root types returned by Repository.roottype().
CVS = 'cvs'
SVN = 'svn'
# action kinds found in ChangedPath.action
ADDED = 'added'
DELETED = 'deleted'
REPLACED = 'replaced'
MODIFIED = 'modified'
# log sort keys
SORTBY_DEFAULT = 0 # default/no sorting
SORTBY_DATE = 1 # sorted by date, youngest first
SORTBY_REV = 2 # sorted by revision, youngest first
# ======================================================================
#
class Repository:
"""Abstract class representing a repository."""
def rootname(self):
"""Return the name of this repository."""
def roottype(self):
"""Return the type of this repository (vclib.CVS, vclib.SVN, ...)."""
def rootpath(self):
"""Return the location of this repository."""
def authorizer(self):
"""Return the vcauth.Authorizer object associated with this
repository, or None if no such association has been made."""
def open(self):
"""Open a connection to the repository."""
def itemtype(self, path_parts, rev):
"""Return the type of the item (file or dir) at the given path and revision
The result will be vclib.DIR or vclib.FILE
The path is specified as a list of components, relative to the root
of the repository. e.g. ["subdir1", "subdir2", "filename"]
rev is the revision of the item to check
"""
pass
def openfile(self, path_parts, rev, options):
"""Open a file object to read file contents at a given path and revision.
The return value is a 2-tuple of containg the file object and revision
number in canonical form.
The path is specified as a list of components, relative to the root
of the repository. e.g. ["subdir1", "subdir2", "filename"]
rev is the revision of the file to check out
options is a dictionary of implementation specific options
"""
def listdir(self, path_parts, rev, options):
"""Return list of files in a directory
The result is a list of DirEntry objects
The path is specified as a list of components, relative to the root
of the repository. e.g. ["subdir1", "subdir2", "filename"]
rev is the revision of the directory to list
options is a dictionary of implementation specific options
"""
def dirlogs(self, path_parts, rev, entries, options):
"""Augment directory entries with log information
New properties will be set on all of the DirEntry objects in the entries
list. At the very least, a "rev" property will be set to a revision
number or None if the entry doesn't have a number. Other properties that
may be set include "date", "author", "log", "size", and "lockinfo".
The path is specified as a list of components, relative to the root
of the repository. e.g. ["subdir1", "subdir2", "filename"]
rev is the revision of the directory listing and will effect which log
messages are returned
entries is a list of DirEntry objects returned from a previous call to
the listdir() method
options is a dictionary of implementation specific options
"""
def itemlog(self, path_parts, rev, sortby, first, limit, options):
"""Retrieve an item's log information
The result is a list of Revision objects
The path is specified as a list of components, relative to the root
of the repository. e.g. ["subdir1", "subdir2", "filename"]
rev is the revision of the item to return information about
sortby indicates the way in which the returned list should be
sorted (SORTBY_DEFAULT, SORTBY_DATE, SORTBY_REV)
first is the 0-based index of the first Revision returned (after
sorting, if any, has occured)
limit is the maximum number of returned Revisions, or 0 to return
all available data
options is a dictionary of implementation specific options
"""
def itemprops(self, path_parts, rev):
"""Return a dictionary mapping property names to property values
for properties stored on an item.
The path is specified as a list of components, relative to the root
of the repository. e.g. ["subdir1", "subdir2", "filename"]
rev is the revision of the item to return information about.
"""
def rawdiff(self, path_parts1, rev1, path_parts2, rev2, type, options={}):
"""Return a diff (in GNU diff format) of two file revisions
type is the requested diff type (UNIFIED, CONTEXT, etc)
options is a dictionary that can contain the following options plus
implementation-specific options
context - integer, number of context lines to include
funout - boolean, include C function names
ignore_white - boolean, ignore whitespace
Return value is a python file object
"""
def annotate(self, path_parts, rev):
"""Return a list of annotate file content lines and a revision.
The result is a list of Annotation objects, sorted by their
line_number components.
"""
def revinfo(self, rev):
"""Return information about a global revision
rev is the revision of the item to return information about
Return value is a 5-tuple containing: the date, author, log
message, a list of ChangedPath items representing paths changed,
and a dictionary mapping property names to property values for
properties stored on an item.
Raise vclib.UnsupportedFeature if the version control system
doesn't support a global revision concept.
"""
def isexecutable(self, path_parts, rev):
"""Return true iff a given revision of a versioned file is to be
considered an executable program or script.
The path is specified as a list of components, relative to the root
of the repository. e.g. ["subdir1", "subdir2", "filename"]
rev is the revision of the item to return information about
"""
# ======================================================================
class DirEntry:
"""Instances represent items in a directory listing"""
def __init__(self, name, kind, errors=[]):
"""Create a new DirEntry() item:
NAME: The name of the directory entry
KIND: The path kind of the entry (vclib.DIR, vclib.FILE)
ERRORS: A list of error strings representing problems encountered
while determining the other info about this entry
"""
self.name = name
self.kind = kind
self.errors = errors
class Revision:
"""Instances holds information about revisions of versioned resources"""
def __init__(self, number, string, date, author, changed, log, size, lockinfo):
"""Create a new Revision() item:
NUMBER: Revision in an integer-based, sortable format
STRING: Revision as a string
DATE: Seconds since Epoch (GMT) that this revision was created
AUTHOR: Author of the revision
CHANGED: Lines-changed (contextual diff) information
LOG: Log message associated with the creation of this revision
SIZE: Size (in bytes) of this revision's fulltext (files only)
LOCKINFO: Information about locks held on this revision
"""
self.number = number
self.string = string
self.date = date
self.author = author
self.changed = changed
self.log = log
self.size = size
self.lockinfo = lockinfo
def __cmp__(self, other):
return cmp(self.number, other.number)
class Annotation:
"""Instances represent per-line file annotation information"""
def __init__(self, text, line_number, rev, prev_rev, author, date):
"""Create a new Annotation() item:
TEXT: Raw text of a line of file contents
LINE_NUMBER: Line number on which the line is found
REV: Revision in which the line was last modified
PREV_REV: Revision prior to 'rev'
AUTHOR: Author who last modified the line
DATE: Date on which the line was last modified, in seconds since
the epoch, GMT
"""
self.text = text
self.line_number = line_number
self.rev = rev
self.prev_rev = prev_rev
self.author = author
self.date = date
class ChangedPath:
"""Instances represent changes to paths"""
def __init__(self, path_parts, rev, pathtype, base_path_parts,
base_rev, action, copied, text_changed, props_changed):
"""Create a new ChangedPath() item:
PATH_PARTS: Path that was changed
REV: Revision represented by this change
PATHTYPE: Type of this path (vclib.DIR, vclib.FILE, ...)
BASE_PATH_PARTS: Previous path for this changed item
BASE_REV: Previous revision for this changed item
ACTION: Kind of change (vclib.ADDED, vclib.DELETED, ...)
COPIED: Boolean -- was this path copied from elsewhere?
TEXT_CHANGED: Boolean -- did the file's text change?
PROPS_CHANGED: Boolean -- did the item's metadata change?
"""
self.path_parts = path_parts
self.rev = rev
self.pathtype = pathtype
self.base_path_parts = base_path_parts
self.base_rev = base_rev
self.action = action
self.copied = copied
self.text_changed = text_changed
self.props_changed = props_changed
# ======================================================================
class Error(Exception):
pass
class ReposNotFound(Error):
pass
class UnsupportedFeature(Error):
pass
class ItemNotFound(Error):
def __init__(self, path):
# use '/' rather than os.sep because this is for user consumption, and
# it was defined using URL separators
if type(path) in (types.TupleType, types.ListType):
path = string.join(path, '/')
Error.__init__(self, path)
class InvalidRevision(Error):
def __init__(self, revision=None):
if revision is None:
Error.__init__(self, "Invalid revision")
else:
Error.__init__(self, "Invalid revision " + str(revision))
class NonTextualFileContents(Error):
pass
# ======================================================================
# Implementation code used by multiple vclib modules
import popen
import os
import time
def _diff_args(type, options):
"""generate argument list to pass to diff or rcsdiff"""
args = []
if type == CONTEXT:
if options.has_key('context'):
if options['context'] is None:
args.append('--context=-1')
else:
args.append('--context=%i' % options['context'])
else:
args.append('-c')
elif type == UNIFIED:
if options.has_key('context'):
if options['context'] is None:
args.append('--unified=-1')
else:
args.append('--unified=%i' % options['context'])
else:
args.append('-u')
elif type == SIDE_BY_SIDE:
args.append('--side-by-side')
args.append('--width=164')
else:
raise NotImplementedError
if options.get('funout', 0):
args.append('-p')
if options.get('ignore_white', 0):
args.append('-w')
return args
class _diff_fp:
"""File object reading a diff between temporary files, cleaning up
on close"""
def __init__(self, temp1, temp2, info1=None, info2=None, diff_cmd='diff', diff_opts=[]):
self.temp1 = temp1
self.temp2 = temp2
args = diff_opts[:]
if info1 and info2:
args.extend(["-L", self._label(info1), "-L", self._label(info2)])
args.extend([temp1, temp2])
self.fp = popen.popen(diff_cmd, args, "r")
def read(self, bytes):
return self.fp.read(bytes)
def readline(self):
return self.fp.readline()
def close(self):
try:
if self.fp:
self.fp.close()
self.fp = None
finally:
try:
if self.temp1:
os.remove(self.temp1)
self.temp1 = None
finally:
if self.temp2:
os.remove(self.temp2)
self.temp2 = None
def __del__(self):
self.close()
def _label(self, (path, date, rev)):
date = date and time.strftime('%Y/%m/%d %H:%M:%S', time.gmtime(date))
return "%s\t%s\t%s" % (path, date, rev)
def check_root_access(repos):
"""Return 1 iff the associated username is permitted to read REPOS,
as determined by consulting REPOS's Authorizer object (if any)."""
auth = repos.authorizer()
if not auth:
return 1
return auth.check_root_access(repos.rootname())
def check_path_access(repos, path_parts, pathtype=None, rev=None):
"""Return 1 iff the associated username is permitted to read
revision REV of the path PATH_PARTS (of type PATHTYPE) in repository
REPOS, as determined by consulting REPOS's Authorizer object (if any)."""
auth = repos.authorizer()
if not auth:
return 1
if not pathtype:
pathtype = repos.itemtype(path_parts, rev)
return auth.check_path_access(repos.rootname(), path_parts, pathtype, rev)

View File

@@ -0,0 +1,43 @@
# -*-python-*-
#
# Copyright (C) 1999-2008 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
import os
import os.path
def canonicalize_rootpath(rootpath):
return os.path.normpath(rootpath)
def expand_root_parent(parent_path):
# Each subdirectory of PARENT_PATH that contains a child
# "CVSROOT/config" is added the set of returned roots. Or, if the
# PARENT_PATH itself contains a child "CVSROOT/config", then all its
# subdirectories are returned as roots.
roots = {}
subpaths = os.listdir(parent_path)
cvsroot = os.path.exists(os.path.join(parent_path, "CVSROOT", "config"))
for rootname in subpaths:
rootpath = os.path.join(parent_path, rootname)
if cvsroot \
or (os.path.exists(os.path.join(rootpath, "CVSROOT", "config"))):
roots[rootname] = canonicalize_rootpath(rootpath)
return roots
def CVSRepository(name, rootpath, authorizer, utilities, use_rcsparse):
rootpath = canonicalize_rootpath(rootpath)
if use_rcsparse:
import ccvs
return ccvs.CCVSRepository(name, rootpath, authorizer, utilities)
else:
import bincvs
return bincvs.BinCVSRepository(name, rootpath, authorizer, utilities)

1225
lib/vclib/ccvs/bincvs.py Normal file

File diff suppressed because it is too large Load Diff

458
lib/vclib/ccvs/blame.py Normal file
View File

@@ -0,0 +1,458 @@
#!/usr/bin/env python
# -*-python-*-
#
# Copyright (C) 1999-2011 The ViewCVS Group. All Rights Reserved.
# Copyright (C) 2000 Curt Hagenlocher <curt@hagenlocher.org>
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# blame.py: Annotate each line of a CVS file with its author,
# revision #, date, etc.
#
# -----------------------------------------------------------------------
#
# This file is based on the cvsblame.pl portion of the Bonsai CVS tool,
# developed by Steve Lamm for Netscape Communications Corporation. More
# information about Bonsai can be found at
# http://www.mozilla.org/bonsai.html
#
# cvsblame.pl, in turn, was based on Scott Furman's cvsblame script
#
# -----------------------------------------------------------------------
import string
import re
import time
import math
import rcsparse
import vclib
class CVSParser(rcsparse.Sink):
# Precompiled regular expressions
trunk_rev = re.compile('^[0-9]+\\.[0-9]+$')
last_branch = re.compile('(.*)\\.[0-9]+')
is_branch = re.compile('^(.*)\\.0\\.([0-9]+)$')
d_command = re.compile('^d(\d+)\\s(\\d+)')
a_command = re.compile('^a(\d+)\\s(\\d+)')
SECONDS_PER_DAY = 86400
def __init__(self):
self.Reset()
def Reset(self):
self.last_revision = {}
self.prev_revision = {}
self.revision_date = {}
self.revision_author = {}
self.revision_branches = {}
self.next_delta = {}
self.prev_delta = {}
self.tag_revision = {}
self.timestamp = {}
self.revision_ctime = {}
self.revision_age = {}
self.revision_log = {}
self.revision_deltatext = {}
self.revision_map = [] # map line numbers to revisions
self.lines_added = {}
self.lines_removed = {}
# Map a tag to a numerical revision number. The tag can be a symbolic
# branch tag, a symbolic revision tag, or an ordinary numerical
# revision number.
def map_tag_to_revision(self, tag_or_revision):
try:
revision = self.tag_revision[tag_or_revision]
match = self.is_branch.match(revision)
if match:
branch = match.group(1) + '.' + match.group(2)
if self.last_revision.get(branch):
return self.last_revision[branch]
else:
return match.group(1)
else:
return revision
except:
return ''
# Construct an ordered list of ancestor revisions to the given
# revision, starting with the immediate ancestor and going back
# to the primordial revision (1.1).
#
# Note: The generated path does not traverse the tree the same way
# that the individual revision deltas do. In particular,
# the path traverses the tree "backwards" on branches.
def ancestor_revisions(self, revision):
ancestors = []
revision = self.prev_revision.get(revision)
while revision:
ancestors.append(revision)
revision = self.prev_revision.get(revision)
return ancestors
# Split deltatext specified by rev to each line.
def deltatext_split(self, rev):
lines = string.split(self.revision_deltatext[rev], '\n')
if lines[-1] == '':
del lines[-1]
return lines
# Extract the given revision from the digested RCS file.
# (Essentially the equivalent of cvs up -rXXX)
def extract_revision(self, revision):
path = []
add_lines_remaining = 0
start_line = 0
count = 0
while revision:
path.append(revision)
revision = self.prev_delta.get(revision)
path.reverse()
path = path[1:] # Get rid of head revision
text = self.deltatext_split(self.head_revision)
# Iterate, applying deltas to previous revision
for revision in path:
adjust = 0
diffs = self.deltatext_split(revision)
self.lines_added[revision] = 0
self.lines_removed[revision] = 0
lines_added_now = 0
lines_removed_now = 0
for command in diffs:
dmatch = self.d_command.match(command)
amatch = self.a_command.match(command)
if add_lines_remaining > 0:
# Insertion lines from a prior "a" command
text.insert(start_line + adjust, command)
add_lines_remaining = add_lines_remaining - 1
adjust = adjust + 1
elif dmatch:
# "d" - Delete command
start_line = string.atoi(dmatch.group(1))
count = string.atoi(dmatch.group(2))
begin = start_line + adjust - 1
del text[begin:begin + count]
adjust = adjust - count
lines_removed_now = lines_removed_now + count
elif amatch:
# "a" - Add command
start_line = string.atoi(amatch.group(1))
count = string.atoi(amatch.group(2))
add_lines_remaining = count
lines_added_now = lines_added_now + count
else:
raise RuntimeError, 'Error parsing diff commands'
self.lines_added[revision] = self.lines_added[revision] + lines_added_now
self.lines_removed[revision] = self.lines_removed[revision] + lines_removed_now
return text
def set_head_revision(self, revision):
self.head_revision = revision
def set_principal_branch(self, branch_name):
self.principal_branch = branch_name
def define_tag(self, name, revision):
# Create an associate array that maps from tag name to
# revision number and vice-versa.
self.tag_revision[name] = revision
def set_comment(self, comment):
self.file_description = comment
def set_description(self, description):
self.rcs_file_description = description
# Construct dicts that represent the topology of the RCS tree
# and other arrays that contain info about individual revisions.
#
# The following dicts are created, keyed by revision number:
# self.revision_date -- e.g. "96.02.23.00.21.52"
# self.timestamp -- seconds since 12:00 AM, Jan 1, 1970 GMT
# self.revision_author -- e.g. "tom"
# self.revision_branches -- descendant branch revisions, separated by spaces,
# e.g. "1.21.4.1 1.21.2.6.1"
# self.prev_revision -- revision number of previous *ancestor* in RCS tree.
# Traversal of this array occurs in the direction
# of the primordial (1.1) revision.
# self.prev_delta -- revision number of previous revision which forms
# the basis for the edit commands in this revision.
# This causes the tree to be traversed towards the
# trunk when on a branch, and towards the latest trunk
# revision when on the trunk.
# self.next_delta -- revision number of next "delta". Inverts prev_delta.
#
# Also creates self.last_revision, keyed by a branch revision number, which
# indicates the latest revision on a given branch,
# e.g. self.last_revision{"1.2.8"} == 1.2.8.5
def define_revision(self, revision, timestamp, author, state,
branches, next):
self.tag_revision[revision] = revision
branch = self.last_branch.match(revision).group(1)
self.last_revision[branch] = revision
#self.revision_date[revision] = date
self.timestamp[revision] = timestamp
# Pretty print the date string
ltime = time.localtime(self.timestamp[revision])
formatted_date = time.strftime("%d %b %Y %H:%M", ltime)
self.revision_ctime[revision] = formatted_date
# Save age
self.revision_age[revision] = ((time.time() - self.timestamp[revision])
/ self.SECONDS_PER_DAY)
# save author
self.revision_author[revision] = author
# ignore the state
# process the branch information
branch_text = ''
for branch in branches:
self.prev_revision[branch] = revision
self.next_delta[revision] = branch
self.prev_delta[branch] = revision
branch_text = branch_text + branch + ''
self.revision_branches[revision] = branch_text
# process the "next revision" information
if next:
self.next_delta[revision] = next
self.prev_delta[next] = revision
is_trunk_revision = self.trunk_rev.match(revision) is not None
if is_trunk_revision:
self.prev_revision[revision] = next
else:
self.prev_revision[next] = revision
# Construct associative arrays containing info about individual revisions.
#
# The following associative arrays are created, keyed by revision number:
# revision_log -- log message
# revision_deltatext -- Either the complete text of the revision,
# in the case of the head revision, or the
# encoded delta between this revision and another.
# The delta is either with respect to the successor
# revision if this revision is on the trunk or
# relative to its immediate predecessor if this
# revision is on a branch.
def set_revision_info(self, revision, log, text):
self.revision_log[revision] = log
self.revision_deltatext[revision] = text
def parse_cvs_file(self, rcs_pathname, opt_rev = None, opt_m_timestamp = None):
# Args in: opt_rev - requested revision
# opt_m - time since modified
# Args out: revision_map
# timestamp
# revision_deltatext
# CheckHidden(rcs_pathname)
try:
rcsfile = open(rcs_pathname, 'rb')
except:
raise RuntimeError, ('error: %s appeared to be under CVS control, ' +
'but the RCS file is inaccessible.') % rcs_pathname
rcsparse.parse(rcsfile, self)
rcsfile.close()
if opt_rev in [None, '', 'HEAD']:
# Explicitly specified topmost revision in tree
revision = self.head_revision
else:
# Symbolic tag or specific revision number specified.
revision = self.map_tag_to_revision(opt_rev)
if revision == '':
raise RuntimeError, 'error: -r: No such revision: ' + opt_rev
# The primordial revision is not always 1.1! Go find it.
primordial = revision
while self.prev_revision.get(primordial):
primordial = self.prev_revision[primordial]
# Don't display file at all, if -m option is specified and no
# changes have been made in the specified file.
if opt_m_timestamp and self.timestamp[revision] < opt_m_timestamp:
return ''
# Figure out how many lines were in the primordial, i.e. version 1.1,
# check-in by moving backward in time from the head revision to the
# first revision.
line_count = 0
if self.revision_deltatext.get(self.head_revision):
tmp_array = self.deltatext_split(self.head_revision)
line_count = len(tmp_array)
skip = 0
rev = self.prev_revision.get(self.head_revision)
while rev:
diffs = self.deltatext_split(rev)
for command in diffs:
dmatch = self.d_command.match(command)
amatch = self.a_command.match(command)
if skip > 0:
# Skip insertion lines from a prior "a" command
skip = skip - 1
elif dmatch:
# "d" - Delete command
start_line = string.atoi(dmatch.group(1))
count = string.atoi(dmatch.group(2))
line_count = line_count - count
elif amatch:
# "a" - Add command
start_line = string.atoi(amatch.group(1))
count = string.atoi(amatch.group(2))
skip = count
line_count = line_count + count
else:
raise RuntimeError, 'error: illegal RCS file'
rev = self.prev_revision.get(rev)
# Now, play the delta edit commands *backwards* from the primordial
# revision forward, but rather than applying the deltas to the text of
# each revision, apply the changes to an array of revision numbers.
# This creates a "revision map" -- an array where each element
# represents a line of text in the given revision but contains only
# the revision number in which the line was introduced rather than
# the line text itself.
#
# Note: These are backward deltas for revisions on the trunk and
# forward deltas for branch revisions.
# Create initial revision map for primordial version.
self.revision_map = [primordial] * line_count
ancestors = [revision, ] + self.ancestor_revisions(revision)
ancestors = ancestors[:-1] # Remove "1.1"
last_revision = primordial
ancestors.reverse()
for revision in ancestors:
is_trunk_revision = self.trunk_rev.match(revision) is not None
if is_trunk_revision:
diffs = self.deltatext_split(last_revision)
# Revisions on the trunk specify deltas that transform a
# revision into an earlier revision, so invert the translation
# of the 'diff' commands.
for command in diffs:
if skip > 0:
skip = skip - 1
else:
dmatch = self.d_command.match(command)
amatch = self.a_command.match(command)
if dmatch:
start_line = string.atoi(dmatch.group(1))
count = string.atoi(dmatch.group(2))
temp = []
while count > 0:
temp.append(revision)
count = count - 1
self.revision_map = (self.revision_map[:start_line - 1] +
temp + self.revision_map[start_line - 1:])
elif amatch:
start_line = string.atoi(amatch.group(1))
count = string.atoi(amatch.group(2))
del self.revision_map[start_line:start_line + count]
skip = count
else:
raise RuntimeError, 'Error parsing diff commands'
else:
# Revisions on a branch are arranged backwards from those on
# the trunk. They specify deltas that transform a revision
# into a later revision.
adjust = 0
diffs = self.deltatext_split(revision)
for command in diffs:
if skip > 0:
skip = skip - 1
else:
dmatch = self.d_command.match(command)
amatch = self.a_command.match(command)
if dmatch:
start_line = string.atoi(dmatch.group(1))
count = string.atoi(dmatch.group(2))
adj_begin = start_line + adjust - 1
adj_end = start_line + adjust - 1 + count
del self.revision_map[adj_begin:adj_end]
adjust = adjust - count
elif amatch:
start_line = string.atoi(amatch.group(1))
count = string.atoi(amatch.group(2))
skip = count
temp = []
while count > 0:
temp.append(revision)
count = count - 1
self.revision_map = (self.revision_map[:start_line + adjust] +
temp + self.revision_map[start_line + adjust:])
adjust = adjust + skip
else:
raise RuntimeError, 'Error parsing diff commands'
last_revision = revision
return revision
class BlameSource:
def __init__(self, rcs_file, opt_rev=None):
# Parse the CVS file
parser = CVSParser()
revision = parser.parse_cvs_file(rcs_file, opt_rev)
count = len(parser.revision_map)
lines = parser.extract_revision(revision)
if len(lines) != count:
raise RuntimeError, 'Internal consistency error'
# set up some state variables
self.revision = revision
self.lines = lines
self.num_lines = count
self.parser = parser
# keep track of where we are during an iteration
self.idx = -1
self.last = None
def __getitem__(self, idx):
if idx == self.idx:
return self.last
if idx >= self.num_lines:
raise IndexError("No more annotations")
if idx != self.idx + 1:
raise BlameSequencingError()
# Get the line and metadata for it.
rev = self.parser.revision_map[idx]
prev_rev = self.parser.prev_revision.get(rev)
line_number = idx + 1
author = self.parser.revision_author[rev]
thisline = self.lines[idx]
### TODO: Put a real date in here.
item = vclib.Annotation(thisline, line_number, rev, prev_rev, author, None)
self.last = item
self.idx = idx
return item
class BlameSequencingError(Exception):
pass

398
lib/vclib/ccvs/ccvs.py Normal file
View File

@@ -0,0 +1,398 @@
# -*-python-*-
#
# Copyright (C) 1999-2011 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
import os
import string
import re
import cStringIO
import tempfile
import vclib
import rcsparse
import blame
### The functionality shared with bincvs should probably be moved to a
### separate module
from bincvs import BaseCVSRepository, Revision, Tag, _file_log, _log_path, _logsort_date_cmp, _logsort_rev_cmp
class CCVSRepository(BaseCVSRepository):
def dirlogs(self, path_parts, rev, entries, options):
"""see vclib.Repository.dirlogs docstring
rev can be a tag name or None. if set only information from revisions
matching the tag will be retrieved
Option values recognized by this implementation:
cvs_subdirs
boolean. true to fetch logs of the most recently modified file in each
subdirectory
Option values returned by this implementation:
cvs_tags, cvs_branches
lists of tag and branch names encountered in the directory
"""
if self.itemtype(path_parts, rev) != vclib.DIR: # does auth-check
raise vclib.Error("Path '%s' is not a directory."
% (string.join(path_parts, "/")))
entries_to_fetch = []
for entry in entries:
if vclib.check_path_access(self, path_parts + [entry.name], None, rev):
entries_to_fetch.append(entry)
subdirs = options.get('cvs_subdirs', 0)
dirpath = self._getpath(path_parts)
alltags = { # all the tags seen in the files of this dir
'MAIN' : '',
'HEAD' : '1.1'
}
for entry in entries_to_fetch:
entry.rev = entry.date = entry.author = None
entry.dead = entry.absent = entry.log = entry.lockinfo = None
path = _log_path(entry, dirpath, subdirs)
if path:
entry.path = path
try:
rcsparse.parse(open(path, 'rb'), InfoSink(entry, rev, alltags))
except IOError, e:
entry.errors.append("rcsparse error: %s" % e)
except RuntimeError, e:
entry.errors.append("rcsparse error: %s" % e)
except rcsparse.RCSStopParser:
pass
branches = options['cvs_branches'] = []
tags = options['cvs_tags'] = []
for name, rev in alltags.items():
if Tag(None, rev).is_branch:
branches.append(name)
else:
tags.append(name)
def itemlog(self, path_parts, rev, sortby, first, limit, options):
"""see vclib.Repository.itemlog docstring
rev parameter can be a revision number, a branch number, a tag name,
or None. If None, will return information about all revisions, otherwise,
will only return information about the specified revision or branch.
Option values returned by this implementation:
cvs_tags
dictionary of Tag objects for all tags encountered
"""
if self.itemtype(path_parts, rev) != vclib.FILE: # does auth-check
raise vclib.Error("Path '%s' is not a file."
% (string.join(path_parts, "/")))
path = self.rcsfile(path_parts, 1)
sink = TreeSink()
rcsparse.parse(open(path, 'rb'), sink)
filtered_revs = _file_log(sink.revs.values(), sink.tags, sink.lockinfo,
sink.default_branch, rev)
for rev in filtered_revs:
if rev.prev and len(rev.number) == 2:
rev.changed = rev.prev.next_changed
options['cvs_tags'] = sink.tags
if sortby == vclib.SORTBY_DATE:
filtered_revs.sort(_logsort_date_cmp)
elif sortby == vclib.SORTBY_REV:
filtered_revs.sort(_logsort_rev_cmp)
if len(filtered_revs) < first:
return []
if limit:
return filtered_revs[first:first+limit]
return filtered_revs
def rawdiff(self, path_parts1, rev1, path_parts2, rev2, type, options={}):
if self.itemtype(path_parts1, rev1) != vclib.FILE: # does auth-check
raise vclib.Error("Path '%s' is not a file."
% (string.join(path_parts1, "/")))
if self.itemtype(path_parts2, rev2) != vclib.FILE: # does auth-check
raise vclib.Error("Path '%s' is not a file."
% (string.join(path_parts2, "/")))
temp1 = tempfile.mktemp()
open(temp1, 'wb').write(self.openfile(path_parts1, rev1, {})[0].getvalue())
temp2 = tempfile.mktemp()
open(temp2, 'wb').write(self.openfile(path_parts2, rev2, {})[0].getvalue())
r1 = self.itemlog(path_parts1, rev1, vclib.SORTBY_DEFAULT, 0, 0, {})[-1]
r2 = self.itemlog(path_parts2, rev2, vclib.SORTBY_DEFAULT, 0, 0, {})[-1]
info1 = (self.rcsfile(path_parts1, root=1, v=0), r1.date, r1.string)
info2 = (self.rcsfile(path_parts2, root=1, v=0), r2.date, r2.string)
diff_args = vclib._diff_args(type, options)
return vclib._diff_fp(temp1, temp2, info1, info2,
self.utilities.diff or 'diff', diff_args)
def annotate(self, path_parts, rev=None):
if self.itemtype(path_parts, rev) != vclib.FILE: # does auth-check
raise vclib.Error("Path '%s' is not a file."
% (string.join(path_parts, "/")))
source = blame.BlameSource(self.rcsfile(path_parts, 1), rev)
return source, source.revision
def revinfo(self, rev):
raise vclib.UnsupportedFeature
def openfile(self, path_parts, rev, options):
if self.itemtype(path_parts, rev) != vclib.FILE: # does auth-check
raise vclib.Error("Path '%s' is not a file."
% (string.join(path_parts, "/")))
path = self.rcsfile(path_parts, 1)
sink = COSink(rev)
rcsparse.parse(open(path, 'rb'), sink)
revision = sink.last and sink.last.string
return cStringIO.StringIO(string.join(sink.sstext.text, "\n")), revision
class MatchingSink(rcsparse.Sink):
"""Superclass for sinks that search for revisions based on tag or number"""
def __init__(self, find):
"""Initialize with tag name or revision number string to match against"""
if not find or find == 'MAIN' or find == 'HEAD':
self.find = None
else:
self.find = find
self.find_tag = None
def set_principal_branch(self, branch_number):
if self.find is None:
self.find_tag = Tag(None, branch_number)
def define_tag(self, name, revision):
if name == self.find:
self.find_tag = Tag(None, revision)
def admin_completed(self):
if self.find_tag is None:
if self.find is None:
self.find_tag = Tag(None, '')
else:
try:
self.find_tag = Tag(None, self.find)
except ValueError:
pass
class InfoSink(MatchingSink):
def __init__(self, entry, tag, alltags):
MatchingSink.__init__(self, tag)
self.entry = entry
self.alltags = alltags
self.matching_rev = None
self.perfect_match = 0
self.lockinfo = { }
def define_tag(self, name, revision):
MatchingSink.define_tag(self, name, revision)
self.alltags[name] = revision
def admin_completed(self):
MatchingSink.admin_completed(self)
if self.find_tag is None:
# tag we're looking for doesn't exist
if self.entry.kind == vclib.FILE:
self.entry.absent = 1
raise rcsparse.RCSStopParser
def set_locker(self, rev, locker):
self.lockinfo[rev] = locker
def define_revision(self, revision, date, author, state, branches, next):
if self.perfect_match:
return
tag = self.find_tag
rev = Revision(revision, date, author, state == "dead")
rev.lockinfo = self.lockinfo.get(revision)
# perfect match if revision number matches tag number or if revision is on
# trunk and tag points to trunk. imperfect match if tag refers to a branch
# and this revision is the highest revision so far found on that branch
perfect = ((rev.number == tag.number) or
(not tag.number and len(rev.number) == 2))
if perfect or (tag.is_branch and tag.number == rev.number[:-1] and
(not self.matching_rev or
rev.number > self.matching_rev.number)):
self.matching_rev = rev
self.perfect_match = perfect
def set_revision_info(self, revision, log, text):
if self.matching_rev:
if revision == self.matching_rev.string:
self.entry.rev = self.matching_rev.string
self.entry.date = self.matching_rev.date
self.entry.author = self.matching_rev.author
self.entry.dead = self.matching_rev.dead
self.entry.lockinfo = self.matching_rev.lockinfo
self.entry.absent = 0
self.entry.log = log
raise rcsparse.RCSStopParser
else:
raise rcsparse.RCSStopParser
class TreeSink(rcsparse.Sink):
d_command = re.compile('^d(\d+)\\s(\\d+)')
a_command = re.compile('^a(\d+)\\s(\\d+)')
def __init__(self):
self.revs = { }
self.tags = { }
self.head = None
self.default_branch = None
self.lockinfo = { }
def set_head_revision(self, revision):
self.head = revision
def set_principal_branch(self, branch_number):
self.default_branch = branch_number
def set_locker(self, rev, locker):
self.lockinfo[rev] = locker
def define_tag(self, name, revision):
# check !tags.has_key(tag_name)
self.tags[name] = revision
def define_revision(self, revision, date, author, state, branches, next):
# check !revs.has_key(revision)
self.revs[revision] = Revision(revision, date, author, state == "dead")
def set_revision_info(self, revision, log, text):
# check revs.has_key(revision)
rev = self.revs[revision]
rev.log = log
changed = None
added = 0
deled = 0
if self.head != revision:
changed = 1
lines = string.split(text, '\n')
idx = 0
while idx < len(lines):
command = lines[idx]
dmatch = self.d_command.match(command)
idx = idx + 1
if dmatch:
deled = deled + string.atoi(dmatch.group(2))
else:
amatch = self.a_command.match(command)
if amatch:
count = string.atoi(amatch.group(2))
added = added + count
idx = idx + count
elif command:
raise "error while parsing deltatext: %s" % command
if len(rev.number) == 2:
rev.next_changed = changed and "+%i -%i" % (deled, added)
else:
rev.changed = changed and "+%i -%i" % (added, deled)
class StreamText:
d_command = re.compile('^d(\d+)\\s(\\d+)')
a_command = re.compile('^a(\d+)\\s(\\d+)')
def __init__(self, text):
self.text = string.split(text, "\n")
def command(self, cmd):
adjust = 0
add_lines_remaining = 0
diffs = string.split(cmd, "\n")
if diffs[-1] == "":
del diffs[-1]
if len(diffs) == 0:
return
if diffs[0] == "":
del diffs[0]
for command in diffs:
if add_lines_remaining > 0:
# Insertion lines from a prior "a" command
self.text.insert(start_line + adjust, command)
add_lines_remaining = add_lines_remaining - 1
adjust = adjust + 1
continue
dmatch = self.d_command.match(command)
amatch = self.a_command.match(command)
if dmatch:
# "d" - Delete command
start_line = string.atoi(dmatch.group(1))
count = string.atoi(dmatch.group(2))
begin = start_line + adjust - 1
del self.text[begin:begin + count]
adjust = adjust - count
elif amatch:
# "a" - Add command
start_line = string.atoi(amatch.group(1))
count = string.atoi(amatch.group(2))
add_lines_remaining = count
else:
raise RuntimeError, 'Error parsing diff commands'
def secondnextdot(s, start):
# find the position the second dot after the start index.
return string.find(s, '.', string.find(s, '.', start) + 1)
class COSink(MatchingSink):
def __init__(self, rev):
MatchingSink.__init__(self, rev)
def set_head_revision(self, revision):
self.head = Revision(revision)
self.last = None
self.sstext = None
def admin_completed(self):
MatchingSink.admin_completed(self)
if self.find_tag is None:
raise vclib.InvalidRevision(self.find)
def set_revision_info(self, revision, log, text):
tag = self.find_tag
rev = Revision(revision)
if rev.number == tag.number:
self.log = log
depth = len(rev.number)
if rev.number == self.head.number:
assert self.sstext is None
self.sstext = StreamText(text)
elif (depth == 2 and tag.number and rev.number >= tag.number[:depth]):
assert len(self.last.number) == 2
assert rev.number < self.last.number
self.sstext.command(text)
elif (depth > 2 and rev.number[:depth-1] == tag.number[:depth-1] and
(rev.number <= tag.number or len(tag.number) == depth-1)):
assert len(rev.number) - len(self.last.number) in (0, 2)
assert rev.number > self.last.number
self.sstext.command(text)
else:
rev = None
if rev:
#print "tag =", tag.number, "rev =", rev.number, "<br>"
self.last = rev

View File

@@ -0,0 +1,26 @@
# -*-python-*-
#
# Copyright (C) 1999-2006 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
"""This package provides parsing tools for RCS files."""
from common import *
try:
from tparse import parse
except ImportError:
try:
from texttools import Parser
except ImportError:
from default import Parser
def parse(file, sink):
return Parser().parse(file, sink)

View File

@@ -0,0 +1,325 @@
# -*-python-*-
#
# Copyright (C) 1999-2011 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
"""common.py: common classes and functions for the RCS parsing tools."""
import calendar
import string
class Sink:
def set_head_revision(self, revision):
pass
def set_principal_branch(self, branch_name):
pass
def set_access(self, accessors):
pass
def define_tag(self, name, revision):
pass
def set_locker(self, revision, locker):
pass
def set_locking(self, mode):
"""Used to signal locking mode.
Called with mode argument 'strict' if strict locking
Not called when no locking used."""
pass
def set_comment(self, comment):
pass
def set_expansion(self, mode):
pass
def admin_completed(self):
pass
def define_revision(self, revision, timestamp, author, state,
branches, next):
pass
def tree_completed(self):
pass
def set_description(self, description):
pass
def set_revision_info(self, revision, log, text):
pass
def parse_completed(self):
pass
# --------------------------------------------------------------------------
#
# EXCEPTIONS USED BY RCSPARSE
#
class RCSParseError(Exception):
pass
class RCSIllegalCharacter(RCSParseError):
pass
class RCSExpected(RCSParseError):
def __init__(self, got, wanted):
RCSParseError.__init__(
self,
'Unexpected parsing error in RCS file.\n'
'Expected token: %s, but saw: %s'
% (wanted, got)
)
class RCSStopParser(Exception):
pass
# --------------------------------------------------------------------------
#
# STANDARD TOKEN STREAM-BASED PARSER
#
class _Parser:
stream_class = None # subclasses need to define this
def _read_until_semicolon(self):
"""Read all tokens up to and including the next semicolon token.
Return the tokens (not including the semicolon) as a list."""
tokens = []
while 1:
token = self.ts.get()
if token == ';':
break
tokens.append(token)
return tokens
def _parse_admin_head(self, token):
rev = self.ts.get()
if rev == ';':
# The head revision is not specified. Just drop the semicolon
# on the floor.
pass
else:
self.sink.set_head_revision(rev)
self.ts.match(';')
def _parse_admin_branch(self, token):
branch = self.ts.get()
if branch != ';':
self.sink.set_principal_branch(branch)
self.ts.match(';')
def _parse_admin_access(self, token):
accessors = self._read_until_semicolon()
if accessors:
self.sink.set_access(accessors)
def _parse_admin_symbols(self, token):
while 1:
tag_name = self.ts.get()
if tag_name == ';':
break
self.ts.match(':')
tag_rev = self.ts.get()
self.sink.define_tag(tag_name, tag_rev)
def _parse_admin_locks(self, token):
while 1:
locker = self.ts.get()
if locker == ';':
break
self.ts.match(':')
rev = self.ts.get()
self.sink.set_locker(rev, locker)
def _parse_admin_strict(self, token):
self.sink.set_locking("strict")
self.ts.match(';')
def _parse_admin_comment(self, token):
self.sink.set_comment(self.ts.get())
self.ts.match(';')
def _parse_admin_expand(self, token):
expand_mode = self.ts.get()
self.sink.set_expansion(expand_mode)
self.ts.match(';')
admin_token_map = {
'head' : _parse_admin_head,
'branch' : _parse_admin_branch,
'access' : _parse_admin_access,
'symbols' : _parse_admin_symbols,
'locks' : _parse_admin_locks,
'strict' : _parse_admin_strict,
'comment' : _parse_admin_comment,
'expand' : _parse_admin_expand,
'desc' : None,
}
def parse_rcs_admin(self):
while 1:
# Read initial token at beginning of line
token = self.ts.get()
try:
f = self.admin_token_map[token]
except KeyError:
# We're done once we reach the description of the RCS tree
if token[0] in string.digits:
self.ts.unget(token)
return
else:
# Chew up "newphrase"
# warn("Unexpected RCS token: $token\n")
while self.ts.get() != ';':
pass
else:
if f is None:
self.ts.unget(token)
return
else:
f(self, token)
def _parse_rcs_tree_entry(self, revision):
# Parse date
self.ts.match('date')
date = self.ts.get()
self.ts.match(';')
# Convert date into timestamp
date_fields = string.split(date, '.')
# According to rcsfile(5): the year "contains just the last two
# digits of the year for years from 1900 through 1999, and all the
# digits of years thereafter".
if len(date_fields[0]) == 2:
date_fields[0] = '19' + date_fields[0]
date_fields = map(string.atoi, date_fields)
EPOCH = 1970
if date_fields[0] < EPOCH:
raise ValueError, 'invalid year'
timestamp = calendar.timegm(tuple(date_fields) + (0, 0, 0,))
# Parse author
### NOTE: authors containing whitespace are violations of the
### RCS specification. We are making an allowance here because
### CVSNT is known to produce these sorts of authors.
self.ts.match('author')
author = ' '.join(self._read_until_semicolon())
# Parse state
self.ts.match('state')
state = ''
while 1:
token = self.ts.get()
if token == ';':
break
state = state + token + ' '
state = state[:-1] # toss the trailing space
# Parse branches
self.ts.match('branches')
branches = self._read_until_semicolon()
# Parse revision of next delta in chain
self.ts.match('next')
next = self.ts.get()
if next == ';':
next = None
else:
self.ts.match(';')
# there are some files with extra tags in them. for example:
# owner 640;
# group 15;
# permissions 644;
# hardlinks @configure.in@;
# this is "newphrase" in RCSFILE(5). we just want to skip over these.
while 1:
token = self.ts.get()
if token == 'desc' or token[0] in string.digits:
self.ts.unget(token)
break
# consume everything up to the semicolon
self._read_until_semicolon()
self.sink.define_revision(revision, timestamp, author, state, branches,
next)
def parse_rcs_tree(self):
while 1:
revision = self.ts.get()
# End of RCS tree description ?
if revision == 'desc':
self.ts.unget(revision)
return
self._parse_rcs_tree_entry(revision)
def parse_rcs_description(self):
self.ts.match('desc')
self.sink.set_description(self.ts.get())
def parse_rcs_deltatext(self):
while 1:
revision = self.ts.get()
if revision is None:
# EOF
break
text, sym2, log, sym1 = self.ts.mget(4)
if sym1 != 'log':
print `text[:100], sym2[:100], log[:100], sym1[:100]`
raise RCSExpected(sym1, 'log')
if sym2 != 'text':
raise RCSExpected(sym2, 'text')
### need to add code to chew up "newphrase"
self.sink.set_revision_info(revision, log, text)
def parse(self, file, sink):
self.ts = self.stream_class(file)
self.sink = sink
self.parse_rcs_admin()
# let sink know when the admin section has been completed
self.sink.admin_completed()
self.parse_rcs_tree()
# many sinks want to know when the tree has been completed so they can
# do some work to prep for the arrival of the deltatext
self.sink.tree_completed()
self.parse_rcs_description()
self.parse_rcs_deltatext()
# easiest for us to tell the sink it is done, rather than worry about
# higher level software doing it.
self.sink.parse_completed()
self.ts = self.sink = None
# --------------------------------------------------------------------------

View File

@@ -0,0 +1,122 @@
# -*-python-*-
#
# Copyright (C) 1999-2006 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
"""debug.py: various debugging tools for the rcsparse package."""
import time
from __init__ import parse
import common
class DebugSink(common.Sink):
def set_head_revision(self, revision):
print 'head:', revision
def set_principal_branch(self, branch_name):
print 'branch:', branch_name
def define_tag(self, name, revision):
print 'tag:', name, '=', revision
def set_comment(self, comment):
print 'comment:', comment
def set_description(self, description):
print 'description:', description
def define_revision(self, revision, timestamp, author, state,
branches, next):
print 'revision:', revision
print ' timestamp:', timestamp
print ' author:', author
print ' state:', state
print ' branches:', branches
print ' next:', next
def set_revision_info(self, revision, log, text):
print 'revision:', revision
print ' log:', log
print ' text:', text[:100], '...'
class DumpSink(common.Sink):
"""Dump all the parse information directly to stdout.
The output is relatively unformatted and untagged. It is intended as a
raw dump of the data in the RCS file. A copy can be saved, then changes
made to the parsing engine, then a comparison of the new output against
the old output.
"""
def __init__(self):
global sha
import sha
def set_head_revision(self, revision):
print revision
def set_principal_branch(self, branch_name):
print branch_name
def define_tag(self, name, revision):
print name, revision
def set_comment(self, comment):
print comment
def set_description(self, description):
print description
def define_revision(self, revision, timestamp, author, state,
branches, next):
print revision, timestamp, author, state, branches, next
def set_revision_info(self, revision, log, text):
print revision, sha.new(log).hexdigest(), sha.new(text).hexdigest()
def tree_completed(self):
print 'tree_completed'
def parse_completed(self):
print 'parse_completed'
def dump_file(fname):
parse(open(fname, 'rb'), DumpSink())
def time_file(fname):
f = open(fname, 'rb')
s = common.Sink()
t = time.time()
parse(f, s)
t = time.time() - t
print t
def _usage():
print 'This is normally a module for importing, but it has a couple'
print 'features for testing as an executable script.'
print 'USAGE: %s COMMAND filename,v' % sys.argv[0]
print ' where COMMAND is one of:'
print ' dump: filename is "dumped" to stdout'
print ' time: filename is parsed with the time written to stdout'
sys.exit(1)
if __name__ == '__main__':
import sys
if len(sys.argv) != 3:
_usage()
if sys.argv[1] == 'dump':
dump_file(sys.argv[2])
elif sys.argv[1] == 'time':
time_file(sys.argv[2])
else:
_usage()

View File

@@ -0,0 +1,176 @@
# -*-python-*-
#
# Copyright (C) 1999-2008 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# This file was originally based on portions of the blame.py script by
# Curt Hagenlocher.
#
# -----------------------------------------------------------------------
import string
import common
class _TokenStream:
token_term = string.whitespace + ";:"
try:
token_term = frozenset(token_term)
except NameError:
pass
# the algorithm is about the same speed for any CHUNK_SIZE chosen.
# grab a good-sized chunk, but not too large to overwhelm memory.
# note: we use a multiple of a standard block size
CHUNK_SIZE = 192 * 512 # about 100k
# CHUNK_SIZE = 5 # for debugging, make the function grind...
def __init__(self, file):
self.rcsfile = file
self.idx = 0
self.buf = self.rcsfile.read(self.CHUNK_SIZE)
if self.buf == '':
raise RuntimeError, 'EOF'
def get(self):
"Get the next token from the RCS file."
# Note: we can afford to loop within Python, examining individual
# characters. For the whitespace and tokens, the number of iterations
# is typically quite small. Thus, a simple iterative loop will beat
# out more complex solutions.
buf = self.buf
lbuf = len(buf)
idx = self.idx
while 1:
if idx == lbuf:
buf = self.rcsfile.read(self.CHUNK_SIZE)
if buf == '':
# signal EOF by returning None as the token
del self.buf # so we fail if get() is called again
return None
lbuf = len(buf)
idx = 0
if buf[idx] not in string.whitespace:
break
idx = idx + 1
if buf[idx] in ';:':
self.buf = buf
self.idx = idx + 1
return buf[idx]
if buf[idx] != '@':
end = idx + 1
token = ''
while 1:
# find token characters in the current buffer
while end < lbuf and buf[end] not in self.token_term:
end = end + 1
token = token + buf[idx:end]
if end < lbuf:
# we stopped before the end, so we have a full token
idx = end
break
# we stopped at the end of the buffer, so we may have a partial token
buf = self.rcsfile.read(self.CHUNK_SIZE)
lbuf = len(buf)
idx = end = 0
self.buf = buf
self.idx = idx
return token
# a "string" which starts with the "@" character. we'll skip it when we
# search for content.
idx = idx + 1
chunks = [ ]
while 1:
if idx == lbuf:
idx = 0
buf = self.rcsfile.read(self.CHUNK_SIZE)
if buf == '':
raise RuntimeError, 'EOF'
lbuf = len(buf)
i = string.find(buf, '@', idx)
if i == -1:
chunks.append(buf[idx:])
idx = lbuf
continue
if i == lbuf - 1:
chunks.append(buf[idx:i])
idx = 0
buf = '@' + self.rcsfile.read(self.CHUNK_SIZE)
if buf == '@':
raise RuntimeError, 'EOF'
lbuf = len(buf)
continue
if buf[i + 1] == '@':
chunks.append(buf[idx:i+1])
idx = i + 2
continue
chunks.append(buf[idx:i])
self.buf = buf
self.idx = i + 1
return string.join(chunks, '')
# _get = get
# def get(self):
token = self._get()
print 'T:', `token`
return token
def match(self, match):
"Try to match the next token from the input buffer."
token = self.get()
if token != match:
raise common.RCSExpected(token, match)
def unget(self, token):
"Put this token back, for the next get() to return."
# Override the class' .get method with a function which clears the
# overridden method then returns the pushed token. Since this function
# will not be looked up via the class mechanism, it should be a "normal"
# function, meaning it won't have "self" automatically inserted.
# Therefore, we need to pass both self and the token thru via defaults.
# note: we don't put this into the input buffer because it may have been
# @-unescaped already.
def give_it_back(self=self, token=token):
del self.get
return token
self.get = give_it_back
def mget(self, count):
"Return multiple tokens. 'next' is at the end."
result = [ ]
for i in range(count):
result.append(self.get())
result.reverse()
return result
class Parser(common._Parser):
stream_class = _TokenStream

View File

@@ -0,0 +1,73 @@
#! /usr/bin/python
# (Be in -*- python -*- mode.)
#
# ====================================================================
# Copyright (c) 2006-2007 CollabNet. All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://subversion.tigris.org/license-1.html.
# If newer versions of this license are posted there, you may use a
# newer version instead, at your option.
#
# This software consists of voluntary contributions made by many
# individuals. For exact contribution history, see the revision
# history and logs, available at http://cvs2svn.tigris.org/.
# ====================================================================
"""Parse an RCS file, showing the rcsparse callbacks that are called.
This program is useful to see whether an RCS file has a problem (in
the sense of not being parseable by rcsparse) and also to illuminate
the correspondence between RCS file contents and rcsparse callbacks.
The output of this program can also be considered to be a kind of
'canonical' format for RCS files, at least in so far as rcsparse
returns all relevant information in the file and provided that the
order of callbacks is always the same."""
import sys
import os
class Logger:
def __init__(self, f, name):
self.f = f
self.name = name
def __call__(self, *args):
self.f.write(
'%s(%s)\n' % (self.name, ', '.join(['%r' % arg for arg in args]),)
)
class LoggingSink:
def __init__(self, f):
self.f = f
def __getattr__(self, name):
return Logger(self.f, name)
if __name__ == '__main__':
# Since there is nontrivial logic in __init__.py, we have to import
# parse() via that file. First make sure that the directory
# containing this script is in the path:
sys.path.insert(0, os.path.dirname(sys.argv[0]))
from __init__ import parse
if sys.argv[1:]:
for path in sys.argv[1:]:
if os.path.isfile(path) and path.endswith(',v'):
parse(
open(path, 'rb'), LoggingSink(sys.stdout)
)
else:
sys.stderr.write('%r is being ignored.\n' % path)
else:
parse(sys.stdin, LoggingSink(sys.stdout))

View File

@@ -0,0 +1,73 @@
#! /usr/bin/python
# (Be in -*- python -*- mode.)
#
# ====================================================================
# Copyright (c) 2007 CollabNet. All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://subversion.tigris.org/license-1.html.
# If newer versions of this license are posted there, you may use a
# newer version instead, at your option.
#
# This software consists of voluntary contributions made by many
# individuals. For exact contribution history, see the revision
# history and logs, available at http://viewvc.tigris.org/.
# ====================================================================
"""Run tests of rcsparse code."""
import sys
import os
import glob
from cStringIO import StringIO
from difflib import Differ
# Since there is nontrivial logic in __init__.py, we have to import
# parse() via that file. First make sure that the directory
# containing this script is in the path:
script_dir = os.path.dirname(sys.argv[0])
sys.path.insert(0, script_dir)
from __init__ import parse
from parse_rcs_file import LoggingSink
test_dir = os.path.join(script_dir, 'test-data')
filelist = glob.glob(os.path.join(test_dir, '*,v'))
filelist.sort()
all_tests_ok = 1
for filename in filelist:
sys.stderr.write('%s: ' % (filename,))
f = StringIO()
try:
parse(open(filename, 'rb'), LoggingSink(f))
except Exception, e:
sys.stderr.write('Error parsing file: %s!\n' % (e,))
all_tests_ok = 0
else:
output = f.getvalue()
expected_output_filename = filename[:-2] + '.out'
expected_output = open(expected_output_filename, 'rb').read()
if output == expected_output:
sys.stderr.write('OK\n')
else:
sys.stderr.write('Output does not match expected output!\n')
differ = Differ()
for diffline in differ.compare(
expected_output.splitlines(1), output.splitlines(1)
):
sys.stderr.write(diffline)
all_tests_ok = 0
if all_tests_ok:
sys.exit(0)
else:
sys.exit(1)

View File

@@ -0,0 +1,102 @@
head 1.2;
access;
symbols
B_SPLIT:1.2.0.4
B_MIXED:1.2.0.2
T_MIXED:1.2
B_FROM_INITIALS_BUT_ONE:1.1.1.1.0.4
B_FROM_INITIALS:1.1.1.1.0.2
T_ALL_INITIAL_FILES_BUT_ONE:1.1.1.1
T_ALL_INITIAL_FILES:1.1.1.1
vendortag:1.1.1.1
vendorbranch:1.1.1;
locks; strict;
comment @# @;
1.2
date 2003.05.23.00.17.53; author jrandom; state Exp;
branches
1.2.2.1
1.2.4.1;
next 1.1;
1.1
date 98.05.22.23.20.19; author jrandom; state Exp;
branches
1.1.1.1;
next ;
1.1.1.1
date 98.05.22.23.20.19; author jrandom; state Exp;
branches;
next ;
1.2.2.1
date 2003.05.23.00.31.36; author jrandom; state Exp;
branches;
next ;
1.2.4.1
date 2003.06.03.03.20.31; author jrandom; state Exp;
branches;
next ;
desc
@@
1.2
log
@Second commit to proj, affecting all 7 files.
@
text
@This is the file `default' in the top level of the project.
Every directory in the `proj' project has a file named `default'.
This line was added in the second commit (affecting all 7 files).
@
1.2.4.1
log
@First change on branch B_SPLIT.
This change excludes sub3/default, because it was not part of this
commit, and sub1/subsubB/default, which is not even on the branch yet.
@
text
@a5 2
First change on branch B_SPLIT.
@
1.2.2.1
log
@Modify three files, on branch B_MIXED.
@
text
@a5 2
This line was added on branch B_MIXED only (affecting 3 files).
@
1.1
log
@Initial revision
@
text
@d4 2
@
1.1.1.1
log
@Initial import.
@
text
@@

View File

@@ -0,0 +1,26 @@
set_head_revision('1.2')
define_tag('B_SPLIT', '1.2.0.4')
define_tag('B_MIXED', '1.2.0.2')
define_tag('T_MIXED', '1.2')
define_tag('B_FROM_INITIALS_BUT_ONE', '1.1.1.1.0.4')
define_tag('B_FROM_INITIALS', '1.1.1.1.0.2')
define_tag('T_ALL_INITIAL_FILES_BUT_ONE', '1.1.1.1')
define_tag('T_ALL_INITIAL_FILES', '1.1.1.1')
define_tag('vendortag', '1.1.1.1')
define_tag('vendorbranch', '1.1.1')
set_locking('strict')
set_comment('# ')
admin_completed()
define_revision('1.2', 1053649073, 'jrandom', 'Exp', ['1.2.2.1', '1.2.4.1'], '1.1')
define_revision('1.1', 895879219, 'jrandom', 'Exp', ['1.1.1.1'], None)
define_revision('1.1.1.1', 895879219, 'jrandom', 'Exp', [], None)
define_revision('1.2.2.1', 1053649896, 'jrandom', 'Exp', [], None)
define_revision('1.2.4.1', 1054610431, 'jrandom', 'Exp', [], None)
tree_completed()
set_description('')
set_revision_info('1.2', 'Second commit to proj, affecting all 7 files.\n', "This is the file `default' in the top level of the project.\n\nEvery directory in the `proj' project has a file named `default'.\n\nThis line was added in the second commit (affecting all 7 files).\n")
set_revision_info('1.2.4.1', 'First change on branch B_SPLIT.\n\nThis change excludes sub3/default, because it was not part of this\ncommit, and sub1/subsubB/default, which is not even on the branch yet.\n', 'a5 2\n\nFirst change on branch B_SPLIT.\n')
set_revision_info('1.2.2.1', 'Modify three files, on branch B_MIXED.\n', 'a5 2\n\nThis line was added on branch B_MIXED only (affecting 3 files).\n')
set_revision_info('1.1', 'Initial revision\n', 'd4 2\n')
set_revision_info('1.1.1.1', 'Initial import.\n', '')
parse_completed()

View File

@@ -0,0 +1,10 @@
head ;
access;
symbols;
locks; strict;
comment @# @;
desc
@@

View File

@@ -0,0 +1,6 @@
set_locking('strict')
set_comment('# ')
admin_completed()
tree_completed()
set_description('')
parse_completed()

View File

@@ -0,0 +1,348 @@
# -*-python-*-
#
# Copyright (C) 1999-2008 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
import string
# note: this will raise an ImportError if it isn't available. the rcsparse
# package will recognize this and switch over to the default parser.
from mx import TextTools
import common
# for convenience
_tt = TextTools
_idchar_list = map(chr, range(33, 127)) + map(chr, range(160, 256))
_idchar_list.remove('$')
_idchar_list.remove(',')
#_idchar_list.remove('.') # leave as part of 'num' symbol
_idchar_list.remove(':')
_idchar_list.remove(';')
_idchar_list.remove('@')
_idchar = string.join(_idchar_list, '')
_idchar_set = _tt.set(_idchar)
_onechar_token_set = _tt.set(':;')
_not_at_set = _tt.invset('@')
_T_TOKEN = 30
_T_STRING_START = 40
_T_STRING_SPAN = 60
_T_STRING_END = 70
_E_COMPLETE = 100 # ended on a complete token
_E_TOKEN = 110 # ended mid-token
_E_STRING_SPAN = 130 # ended within a string
_E_STRING_END = 140 # ended with string-end ('@') (could be mid-@@)
_SUCCESS = +100
_EOF = 'EOF'
_CONTINUE = 'CONTINUE'
_UNUSED = 'UNUSED'
# continuation of a token over a chunk boundary
_c_token_table = (
(_T_TOKEN, _tt.AllInSet, _idchar_set),
)
class _mxTokenStream:
# the algorithm is about the same speed for any CHUNK_SIZE chosen.
# grab a good-sized chunk, but not too large to overwhelm memory.
# note: we use a multiple of a standard block size
CHUNK_SIZE = 192 * 512 # about 100k
# CHUNK_SIZE = 5 # for debugging, make the function grind...
def __init__(self, file):
self.rcsfile = file
self.tokens = [ ]
self.partial = None
self.string_end = None
def _parse_chunk(self, buf, start=0):
"Get the next token from the RCS file."
buflen = len(buf)
assert start < buflen
# construct a tag table which refers to the buffer we need to parse.
table = (
#1: ignore whitespace. with or without whitespace, move to the next rule.
(None, _tt.AllInSet, _tt.whitespace_set, +1),
#2
(_E_COMPLETE, _tt.EOF + _tt.AppendTagobj, _tt.Here, +1, _SUCCESS),
#3: accumulate token text and exit, or move to the next rule.
(_UNUSED, _tt.AllInSet + _tt.AppendMatch, _idchar_set, +2),
#4
(_E_TOKEN, _tt.EOF + _tt.AppendTagobj, _tt.Here, -3, _SUCCESS),
#5: single character tokens exit immediately, or move to the next rule
(_UNUSED, _tt.IsInSet + _tt.AppendMatch, _onechar_token_set, +2),
#6
(_E_COMPLETE, _tt.EOF + _tt.AppendTagobj, _tt.Here, -5, _SUCCESS),
#7: if this isn't an '@' symbol, then we have a syntax error (go to a
# negative index to indicate that condition). otherwise, suck it up
# and move to the next rule.
(_T_STRING_START, _tt.Is + _tt.AppendTagobj, '@'),
#8
(None, _tt.Is, '@', +4, +1),
#9
(buf, _tt.Is, '@', +1, -1),
#10
(_T_STRING_END, _tt.Skip + _tt.AppendTagobj, 0, 0, +1),
#11
(_E_STRING_END, _tt.EOF + _tt.AppendTagobj, _tt.Here, -10, _SUCCESS),
#12
(_E_STRING_SPAN, _tt.EOF + _tt.AppendTagobj, _tt.Here, +1, _SUCCESS),
#13: suck up everything that isn't an AT. go to next rule to look for EOF
(buf, _tt.AllInSet, _not_at_set, 0, +1),
#14: go back to look for double AT if we aren't at the end of the string
(_E_STRING_SPAN, _tt.EOF + _tt.AppendTagobj, _tt.Here, -6, _SUCCESS),
)
# Fast, texttools may be, but it's somewhat lacking in clarity.
# Here's an attempt to document the logic encoded in the table above:
#
# Flowchart:
# _____
# / /\
# 1 -> 2 -> 3 -> 5 -> 7 -> 8 -> 9 -> 10 -> 11
# | \/ \/ \/ /\ \/
# \ 4 6 12 14 /
# \_______/_____/ \ / /
# \ 13 /
# \__________________________________________/
#
# #1: Skip over any whitespace.
# #2: If now EOF, exit with code _E_COMPLETE.
# #3: If we have a series of characters in _idchar_set, then:
# #4: Output them as a token, and go back to #1.
# #5: If we have a character in _onechar_token_set, then:
# #6: Output it as a token, and go back to #1.
# #7: If we do not have an '@', then error.
# If we do, then log a _T_STRING_START and continue.
# #8: If we have another '@', continue on to #9. Otherwise:
# #12: If now EOF, exit with code _E_STRING_SPAN.
# #13: Record the slice up to the next '@' (or EOF).
# #14: If now EOF, exit with code _E_STRING_SPAN.
# Otherwise, go back to #8.
# #9: If we have another '@', then we've just seen an escaped
# (by doubling) '@' within an @-string. Record a slice including
# just one '@' character, and jump back to #8.
# Otherwise, we've *either* seen the terminating '@' of an @-string,
# *or* we've seen one half of an escaped @@ sequence that just
# happened to be split over a chunk boundary - in either case,
# we continue on to #10.
# #10: Log a _T_STRING_END.
# #11: If now EOF, exit with _E_STRING_END. Otherwise, go back to #1.
success, taglist, idx = _tt.tag(buf, table, start)
if not success:
### need a better way to report this error
raise common.RCSIllegalCharacter()
assert idx == buflen
# pop off the last item
last_which = taglist.pop()
i = 0
tlen = len(taglist)
while i < tlen:
if taglist[i] == _T_STRING_START:
j = i + 1
while j < tlen:
if taglist[j] == _T_STRING_END:
s = _tt.join(taglist, '', i+1, j)
del taglist[i:j]
tlen = len(taglist)
taglist[i] = s
break
j = j + 1
else:
assert last_which == _E_STRING_SPAN
s = _tt.join(taglist, '', i+1)
del taglist[i:]
self.partial = (_T_STRING_SPAN, [ s ])
break
i = i + 1
# figure out whether we have a partial last-token
if last_which == _E_TOKEN:
self.partial = (_T_TOKEN, [ taglist.pop() ])
elif last_which == _E_COMPLETE:
pass
elif last_which == _E_STRING_SPAN:
assert self.partial
else:
assert last_which == _E_STRING_END
self.partial = (_T_STRING_END, [ taglist.pop() ])
taglist.reverse()
taglist.extend(self.tokens)
self.tokens = taglist
def _set_end(self, taglist, text, l, r, subtags):
self.string_end = l
def _handle_partial(self, buf):
which, chunks = self.partial
if which == _T_TOKEN:
success, taglist, idx = _tt.tag(buf, _c_token_table)
if not success:
# The start of this buffer was not a token. So the end of the
# prior buffer was a complete token.
self.tokens.insert(0, string.join(chunks, ''))
else:
assert len(taglist) == 1 and taglist[0][0] == _T_TOKEN \
and taglist[0][1] == 0 and taglist[0][2] == idx
if idx == len(buf):
#
# The whole buffer was one huge token, so we may have a
# partial token again.
#
# Note: this modifies the list of chunks in self.partial
#
chunks.append(buf)
# consumed the whole buffer
return len(buf)
# got the rest of the token.
chunks.append(buf[:idx])
self.tokens.insert(0, string.join(chunks, ''))
# no more partial token
self.partial = None
return idx
if which == _T_STRING_END:
if buf[0] != '@':
self.tokens.insert(0, string.join(chunks, ''))
return 0
chunks.append('@')
start = 1
else:
start = 0
self.string_end = None
string_table = (
(None, _tt.Is, '@', +3, +1),
(_UNUSED, _tt.Is + _tt.AppendMatch, '@', +1, -1),
(self._set_end, _tt.Skip + _tt.CallTag, 0, 0, _SUCCESS),
(None, _tt.EOF, _tt.Here, +1, _SUCCESS),
# suck up everything that isn't an AT. move to next rule to look
# for EOF
(_UNUSED, _tt.AllInSet + _tt.AppendMatch, _not_at_set, 0, +1),
# go back to look for double AT if we aren't at the end of the string
(None, _tt.EOF, _tt.Here, -5, _SUCCESS),
)
success, unused, idx = _tt.tag(buf, string_table,
start, len(buf), chunks)
# must have matched at least one item
assert success
if self.string_end is None:
assert idx == len(buf)
self.partial = (_T_STRING_SPAN, chunks)
elif self.string_end < len(buf):
self.partial = None
self.tokens.insert(0, string.join(chunks, ''))
else:
self.partial = (_T_STRING_END, chunks)
return idx
def _parse_more(self):
buf = self.rcsfile.read(self.CHUNK_SIZE)
if not buf:
return _EOF
if self.partial:
idx = self._handle_partial(buf)
if idx is None:
return _CONTINUE
if idx < len(buf):
self._parse_chunk(buf, idx)
else:
self._parse_chunk(buf)
return _CONTINUE
def get(self):
try:
return self.tokens.pop()
except IndexError:
pass
while not self.tokens:
action = self._parse_more()
if action == _EOF:
return None
return self.tokens.pop()
# _get = get
# def get(self):
token = self._get()
print 'T:', `token`
return token
def match(self, match):
if self.tokens:
token = self.tokens.pop()
else:
token = self.get()
if token != match:
raise common.RCSExpected(token, match)
def unget(self, token):
self.tokens.append(token)
def mget(self, count):
"Return multiple tokens. 'next' is at the end."
while len(self.tokens) < count:
action = self._parse_more()
if action == _EOF:
### fix this
raise RuntimeError, 'EOF hit while expecting tokens'
result = self.tokens[-count:]
del self.tokens[-count:]
return result
class Parser(common._Parser):
stream_class = _mxTokenStream

68
lib/vclib/svn/__init__.py Normal file
View File

@@ -0,0 +1,68 @@
# -*-python-*-
#
# Copyright (C) 1999-2011 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
"Version Control lib driver for Subversion repositories"
import os
import os.path
import re
import urllib
_re_url = re.compile('^(http|https|file|svn|svn\+[^:]+)://')
def canonicalize_rootpath(rootpath):
try:
import svn.core
return svn.core.svn_path_canonicalize(rootpath)
except:
if os.name == 'posix':
rootpath_lower = rootpath.lower()
if rootpath_lower in ['file://localhost',
'file://localhost/',
'file://',
'file:///'
]:
return '/'
if rootpath_lower.startswith('file://localhost/'):
return os.path.normpath(urllib.unquote(rootpath[16:]))
elif rootpath_lower.startswith('file:///'):
return os.path.normpath(urllib.unquote(rootpath[7:]))
if re.search(_re_url, rootpath):
return rootpath.rstrip('/')
return os.path.normpath(rootpath)
def expand_root_parent(parent_path):
roots = {}
if re.search(_re_url, parent_path):
pass
else:
# Any subdirectories of PARENT_PATH which themselves have a child
# "format" are returned as roots.
subpaths = os.listdir(parent_path)
for rootname in subpaths:
rootpath = os.path.join(parent_path, rootname)
if os.path.exists(os.path.join(rootpath, "format")):
roots[rootname] = canonicalize_rootpath(rootpath)
return roots
def SubversionRepository(name, rootpath, authorizer, utilities, config_dir):
rootpath = canonicalize_rootpath(rootpath)
if re.search(_re_url, rootpath):
import svn_ra
return svn_ra.RemoteSubversionRepository(name, rootpath, authorizer,
utilities, config_dir)
else:
import svn_repos
return svn_repos.LocalSubversionRepository(name, rootpath, authorizer,
utilities, config_dir)

605
lib/vclib/svn/svn_ra.py Normal file
View File

@@ -0,0 +1,605 @@
# -*-python-*-
#
# Copyright (C) 1999-2011 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
"Version Control lib driver for remotely accessible Subversion repositories."
import vclib
import sys
import os
import string
import re
import tempfile
import time
import urllib
from svn_repos import Revision, SVNChangedPath, _datestr_to_date, _compare_paths, _path_parts, _cleanup_path, _rev2optrev, _fix_subversion_exception, _split_revprops
from svn import core, delta, client, wc, ra
### Require Subversion 1.3.1 or better. (for svn_ra_get_locations support)
if (core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_PATCH) < (1, 3, 1):
raise Exception, "Version requirement not met (needs 1.3.1 or better)"
### BEGIN COMPATABILITY CODE ###
try:
SVN_INVALID_REVNUM = core.SVN_INVALID_REVNUM
except AttributeError: # The 1.4.x bindings are missing core.SVN_INVALID_REVNUM
SVN_INVALID_REVNUM = -1
def list_directory(url, peg_rev, rev, flag, ctx):
try:
dirents, locks = client.svn_client_ls3(url, peg_rev, rev, flag, ctx)
except TypeError: # 1.4.x bindings are goofed
dirents = client.svn_client_ls3(None, url, peg_rev, rev, flag, ctx)
locks = {}
return dirents, locks
def get_directory_props(ra_session, path, rev):
try:
dirents, fetched_rev, props = ra.svn_ra_get_dir(ra_session, path, rev)
except ValueError: # older bindings are goofed
props = ra.svn_ra_get_dir(ra_session, path, rev)
return props
def client_log(url, start_rev, end_rev, log_limit, cross_copies,
cb_func, ctx):
try:
client.svn_client_log4([url], start_rev, start_rev, end_rev,
log_limit, 1, not cross_copies, 0, None,
cb_func, ctx)
except AttributeError:
# Wrap old svn_log_message_receiver_t interface with a
# svn_log_entry_t one.
def cb_convert(paths, revision, author, date, message, pool):
class svn_log_entry_t:
pass
log_entry = svn_log_entry_t()
log_entry.changed_paths = paths
log_entry.revision = revision
log_entry.revprops = { core.SVN_PROP_REVISION_LOG : message,
core.SVN_PROP_REVISION_AUTHOR : author,
core.SVN_PROP_REVISION_DATE : date,
}
cb_func(log_entry, pool)
client.svn_client_log2([url], start_rev, end_rev, log_limit,
1, not cross_copies, cb_convert, ctx)
### END COMPATABILITY CODE ###
class LogCollector:
### TODO: Make this thing authz-aware
def __init__(self, path, show_all_logs, lockinfo):
# This class uses leading slashes for paths internally
if not path:
self.path = '/'
else:
self.path = path[0] == '/' and path or '/' + path
self.logs = []
self.show_all_logs = show_all_logs
self.lockinfo = lockinfo
def add_log(self, log_entry, pool):
paths = log_entry.changed_paths
revision = log_entry.revision
msg, author, date, revprops = _split_revprops(log_entry.revprops)
# Changed paths have leading slashes
changed_paths = paths.keys()
changed_paths.sort(lambda a, b: _compare_paths(a, b))
this_path = None
if self.path in changed_paths:
this_path = self.path
change = paths[self.path]
if change.copyfrom_path:
this_path = change.copyfrom_path
for changed_path in changed_paths:
if changed_path != self.path:
# If a parent of our path was copied, our "next previous"
# (huh?) path will exist elsewhere (under the copy source).
if (string.rfind(self.path, changed_path) == 0) and \
self.path[len(changed_path)] == '/':
change = paths[changed_path]
if change.copyfrom_path:
this_path = change.copyfrom_path + self.path[len(changed_path):]
if self.show_all_logs or this_path:
entry = Revision(revision, date, author, msg, None, self.lockinfo,
self.path[1:], None, None)
self.logs.append(entry)
if this_path:
self.path = this_path
def temp_checkout(svnrepos, path, rev):
"""Check out file revision to temporary file"""
temp = tempfile.mktemp()
stream = core.svn_stream_from_aprfile(temp)
url = svnrepos._geturl(path)
client.svn_client_cat(core.Stream(stream), url, _rev2optrev(rev),
svnrepos.ctx)
core.svn_stream_close(stream)
return temp
class SelfCleanFP:
def __init__(self, path):
self._fp = open(path, 'r')
self._path = path
self._eof = 0
def read(self, len=None):
if len:
chunk = self._fp.read(len)
else:
chunk = self._fp.read()
if chunk == '':
self._eof = 1
return chunk
def readline(self):
chunk = self._fp.readline()
if chunk == '':
self._eof = 1
return chunk
def readlines(self):
lines = self._fp.readlines()
self._eof = 1
return lines
def close(self):
self._fp.close()
os.remove(self._path)
def __del__(self):
self.close()
def eof(self):
return self._eof
class RemoteSubversionRepository(vclib.Repository):
def __init__(self, name, rootpath, authorizer, utilities, config_dir):
self.name = name
self.rootpath = rootpath
self.auth = authorizer
self.diff_cmd = utilities.diff or 'diff'
self.config_dir = config_dir or None
# See if this repository is even viewable, authz-wise.
if not vclib.check_root_access(self):
raise vclib.ReposNotFound(name)
def open(self):
# Setup the client context baton, complete with non-prompting authstuffs.
# TODO: svn_cmdline_setup_auth_baton() is mo' better (when available)
core.svn_config_ensure(self.config_dir)
self.ctx = client.svn_client_create_context()
self.ctx.auth_baton = core.svn_auth_open([
client.svn_client_get_simple_provider(),
client.svn_client_get_username_provider(),
client.svn_client_get_ssl_server_trust_file_provider(),
client.svn_client_get_ssl_client_cert_file_provider(),
client.svn_client_get_ssl_client_cert_pw_file_provider(),
])
self.ctx.config = core.svn_config_get_config(self.config_dir)
if self.config_dir is not None:
core.svn_auth_set_parameter(self.ctx.auth_baton,
core.SVN_AUTH_PARAM_CONFIG_DIR,
self.config_dir)
ra_callbacks = ra.svn_ra_callbacks_t()
ra_callbacks.auth_baton = self.ctx.auth_baton
self.ra_session = ra.svn_ra_open(self.rootpath, ra_callbacks, None,
self.ctx.config)
self.youngest = ra.svn_ra_get_latest_revnum(self.ra_session)
self._dirent_cache = { }
self._revinfo_cache = { }
# See if a universal read access determination can be made.
if self.auth and self.auth.check_universal_access(self.name) == 1:
self.auth = None
def rootname(self):
return self.name
def rootpath(self):
return self.rootpath
def roottype(self):
return vclib.SVN
def authorizer(self):
return self.auth
def itemtype(self, path_parts, rev):
pathtype = None
if not len(path_parts):
pathtype = vclib.DIR
else:
path = self._getpath(path_parts)
rev = self._getrev(rev)
try:
kind = ra.svn_ra_check_path(self.ra_session, path, rev)
if kind == core.svn_node_file:
pathtype = vclib.FILE
elif kind == core.svn_node_dir:
pathtype = vclib.DIR
except:
pass
if pathtype is None:
raise vclib.ItemNotFound(path_parts)
if not vclib.check_path_access(self, path_parts, pathtype, rev):
raise vclib.ItemNotFound(path_parts)
return pathtype
def openfile(self, path_parts, rev, options):
path = self._getpath(path_parts)
if self.itemtype(path_parts, rev) != vclib.FILE: # does auth-check
raise vclib.Error("Path '%s' is not a file." % path)
rev = self._getrev(rev)
url = self._geturl(path)
tmp_file = tempfile.mktemp()
stream = core.svn_stream_from_aprfile(tmp_file)
### rev here should be the last history revision of the URL
client.svn_client_cat(core.Stream(stream), url, _rev2optrev(rev), self.ctx)
core.svn_stream_close(stream)
return SelfCleanFP(tmp_file), self._get_last_history_rev(path_parts, rev)
def listdir(self, path_parts, rev, options):
path = self._getpath(path_parts)
if self.itemtype(path_parts, rev) != vclib.DIR: # does auth-check
raise vclib.Error("Path '%s' is not a directory." % path)
rev = self._getrev(rev)
entries = [ ]
dirents, locks = self._get_dirents(path, rev)
for name in dirents.keys():
entry = dirents[name]
if entry.kind == core.svn_node_dir:
kind = vclib.DIR
elif entry.kind == core.svn_node_file:
kind = vclib.FILE
if vclib.check_path_access(self, path_parts + [name], kind, rev):
entries.append(vclib.DirEntry(name, kind))
return entries
def dirlogs(self, path_parts, rev, entries, options):
path = self._getpath(path_parts)
if self.itemtype(path_parts, rev) != vclib.DIR: # does auth-check
raise vclib.Error("Path '%s' is not a directory." % path)
rev = self._getrev(rev)
dirents, locks = self._get_dirents(path, rev)
for entry in entries:
entry_path_parts = path_parts + [entry.name]
if not vclib.check_path_access(self, entry_path_parts, entry.kind, rev):
continue
dirent = dirents[entry.name]
entry.date, entry.author, entry.log, revprops, changes = \
self.revinfo(dirent.created_rev)
entry.rev = str(dirent.created_rev)
entry.size = dirent.size
entry.lockinfo = None
if locks.has_key(entry.name):
entry.lockinfo = locks[entry.name].owner
def itemlog(self, path_parts, rev, sortby, first, limit, options):
assert sortby == vclib.SORTBY_DEFAULT or sortby == vclib.SORTBY_REV
path_type = self.itemtype(path_parts, rev) # does auth-check
path = self._getpath(path_parts)
rev = self._getrev(rev)
url = self._geturl(path)
# Use ls3 to fetch the lock status for this item.
lockinfo = None
basename = path_parts and path_parts[-1] or ""
dirents, locks = list_directory(url, _rev2optrev(rev),
_rev2optrev(rev), 0, self.ctx)
if locks.has_key(basename):
lockinfo = locks[basename].owner
# It's okay if we're told to not show all logs on a file -- all
# the revisions should match correctly anyway.
lc = LogCollector(path, options.get('svn_show_all_dir_logs', 0), lockinfo)
cross_copies = options.get('svn_cross_copies', 0)
log_limit = 0
if limit:
log_limit = first + limit
client_log(url, _rev2optrev(rev), _rev2optrev(1), log_limit,
cross_copies, lc.add_log, self.ctx)
revs = lc.logs
revs.sort()
prev = None
for rev in revs:
rev.prev = prev
prev = rev
revs.reverse()
if len(revs) < first:
return []
if limit:
return revs[first:first+limit]
return revs
def itemprops(self, path_parts, rev):
path = self._getpath(path_parts)
path_type = self.itemtype(path_parts, rev) # does auth-check
rev = self._getrev(rev)
url = self._geturl(path)
pairs = client.svn_client_proplist2(url, _rev2optrev(rev),
_rev2optrev(rev), 0, self.ctx)
return pairs and pairs[0][1] or {}
def annotate(self, path_parts, rev):
path = self._getpath(path_parts)
if self.itemtype(path_parts, rev) != vclib.FILE: # does auth-check
raise vclib.Error("Path '%s' is not a file." % path)
rev = self._getrev(rev)
url = self._geturl(path)
blame_data = []
def _blame_cb(line_no, revision, author, date,
line, pool, blame_data=blame_data):
prev_rev = None
if revision > 1:
prev_rev = revision - 1
blame_data.append(vclib.Annotation(line, line_no+1, revision, prev_rev,
author, None))
client.svn_client_blame(url, _rev2optrev(1), _rev2optrev(rev),
_blame_cb, self.ctx)
return blame_data, rev
def revinfo(self, rev):
rev = self._getrev(rev)
cached_info = self._revinfo_cache.get(rev)
if not cached_info:
cached_info = self._revinfo_raw(rev)
self._revinfo_cache[rev] = cached_info
return tuple(cached_info)
def rawdiff(self, path_parts1, rev1, path_parts2, rev2, type, options={}):
p1 = self._getpath(path_parts1)
p2 = self._getpath(path_parts2)
r1 = self._getrev(rev1)
r2 = self._getrev(rev2)
if not vclib.check_path_access(self, path_parts1, vclib.FILE, rev1):
raise vclib.ItemNotFound(path_parts1)
if not vclib.check_path_access(self, path_parts2, vclib.FILE, rev2):
raise vclib.ItemNotFound(path_parts2)
args = vclib._diff_args(type, options)
def _date_from_rev(rev):
date, author, msg, revprops, changes = self.revinfo(rev)
return date
try:
temp1 = temp_checkout(self, p1, r1)
temp2 = temp_checkout(self, p2, r2)
info1 = p1, _date_from_rev(r1), r1
info2 = p2, _date_from_rev(r2), r2
return vclib._diff_fp(temp1, temp2, info1, info2, self.diff_cmd, args)
except core.SubversionException, e:
_fix_subversion_exception(e)
if e.apr_err == vclib.svn.core.SVN_ERR_FS_NOT_FOUND:
raise vclib.InvalidRevision
raise
def isexecutable(self, path_parts, rev):
props = self.itemprops(path_parts, rev) # does authz-check
return props.has_key(core.SVN_PROP_EXECUTABLE)
def _getpath(self, path_parts):
return string.join(path_parts, '/')
def _getrev(self, rev):
if rev is None or rev == 'HEAD':
return self.youngest
try:
if type(rev) == type(''):
while rev[0] == 'r':
rev = rev[1:]
rev = int(rev)
except:
raise vclib.InvalidRevision(rev)
if (rev < 0) or (rev > self.youngest):
raise vclib.InvalidRevision(rev)
return rev
def _geturl(self, path=None):
if not path:
return self.rootpath
return self.rootpath + '/' + urllib.quote(path, "/*~")
def _get_dirents(self, path, rev):
"""Return a 2-type of dirents and locks, possibly reading/writing
from a local cache of that information."""
dir_url = self._geturl(path)
if path:
key = str(rev) + '/' + path
else:
key = str(rev)
dirents_locks = self._dirent_cache.get(key)
if not dirents_locks:
dirents, locks = list_directory(dir_url, _rev2optrev(rev),
_rev2optrev(rev), 0, self.ctx)
dirents_locks = [dirents, locks]
self._dirent_cache[key] = dirents_locks
return dirents_locks[0], dirents_locks[1]
def _get_last_history_rev(self, path_parts, rev):
url = self._geturl(self._getpath(path_parts))
optrev = _rev2optrev(rev)
revisions = []
def _info_cb(path, info, pool, retval=revisions):
revisions.append(info.last_changed_rev)
client.svn_client_info(url, optrev, optrev, _info_cb, 0, self.ctx)
return revisions[0]
def _revinfo_raw(self, rev):
# return 5-tuple (date, author, msg, revprops, changes)
optrev = _rev2optrev(rev)
revs = []
def _log_cb(log_entry, pool, retval=revs):
### Subversion 1.5 and earlier didn't offer the 'changed_paths2'
### hash, and in Subversion 1.6, it's offered but broken.
try:
changed_paths = log_entry.changed_paths2
paths = (changed_paths or {}).keys()
except:
changed_paths = log_entry.changed_paths
paths = (changed_paths or {}).keys()
paths.sort(lambda a, b: _compare_paths(a, b))
revision = log_entry.revision
msg, author, date, revprops = _split_revprops(log_entry.revprops)
action_map = { 'D' : vclib.DELETED,
'A' : vclib.ADDED,
'R' : vclib.REPLACED,
'M' : vclib.MODIFIED,
}
changes = []
found_readable = found_unreadable = 0
for path in paths:
change = changed_paths[path]
### svn_log_changed_path_t (which we might get instead of the
### svn_log_changed_path2_t we'd prefer) doesn't have the
### 'node_kind' member.
pathtype = None
if hasattr(change, 'node_kind'):
if change.node_kind == core.svn_node_dir:
pathtype = vclib.DIR
elif change.node_kind == core.svn_node_file:
pathtype = vclib.FILE
### svn_log_changed_path2_t only has the 'text_modified' and
### 'props_modified' bits in Subversion 1.7 and beyond. And
### svn_log_changed_path_t is without.
text_modified = props_modified = 0
if hasattr(change, 'text_modified'):
if change.text_modified == core.svn_tristate_true:
text_modified = 1
if hasattr(change, 'props_modified'):
if change.props_modified == core.svn_tristate_true:
props_modified = 1
### Wrong, diddily wrong wrong wrong. Can you say,
### "Manufacturing data left and right because it hurts to
### figure out the right stuff?"
action = action_map.get(change.action, vclib.MODIFIED)
if change.copyfrom_path and change.copyfrom_rev:
is_copy = 1
base_path = change.copyfrom_path
base_rev = change.copyfrom_rev
elif action == vclib.ADDED or action == vclib.REPLACED:
is_copy = 0
base_path = base_rev = None
else:
is_copy = 0
base_path = path
base_rev = revision - 1
### Check authz rules (we lie about the path type)
parts = _path_parts(path)
if vclib.check_path_access(self, parts, vclib.FILE, revision):
if is_copy and base_path and (base_path != path):
parts = _path_parts(base_path)
if vclib.check_path_access(self, parts, vclib.FILE, base_rev):
is_copy = 0
base_path = None
base_rev = None
changes.append(SVNChangedPath(path, revision, pathtype, base_path,
base_rev, action, is_copy,
text_modified, props_modified))
found_readable = 1
else:
found_unreadable = 1
if found_unreadable:
msg = None
if not found_readable:
author = None
date = None
revs.append([date, author, msg, revprops, changes])
client_log(self.rootpath, optrev, optrev, 1, 0, _log_cb, self.ctx)
return tuple(revs[0])
##--- custom --##
def get_youngest_revision(self):
return self.youngest
def get_location(self, path, rev, old_rev):
try:
results = ra.get_locations(self.ra_session, path, rev, [old_rev])
except core.SubversionException, e:
_fix_subversion_exception(e)
if e.apr_err == core.SVN_ERR_FS_NOT_FOUND:
raise vclib.ItemNotFound(path)
raise
try:
old_path = results[old_rev]
except KeyError:
raise vclib.ItemNotFound(path)
return _cleanup_path(old_path)
def created_rev(self, path, rev):
# NOTE: We can't use svn_client_propget here because the
# interfaces in that layer strip out the properties not meant for
# human consumption (such as svn:entry:committed-rev, which we are
# using here to get the created revision of PATH@REV).
kind = ra.svn_ra_check_path(self.ra_session, path, rev)
if kind == core.svn_node_none:
raise vclib.ItemNotFound(_path_parts(path))
elif kind == core.svn_node_dir:
props = get_directory_props(self.ra_session, path, rev)
elif kind == core.svn_node_file:
fetched_rev, props = ra.svn_ra_get_file(self.ra_session, path, rev, None)
return int(props.get(core.SVN_PROP_ENTRY_COMMITTED_REV,
SVN_INVALID_REVNUM))
def last_rev(self, path, peg_revision, limit_revision=None):
"""Given PATH, known to exist in PEG_REVISION, find the youngest
revision older than, or equal to, LIMIT_REVISION in which path
exists. Return that revision, and the path at which PATH exists in
that revision."""
# Here's the plan, man. In the trivial case (where PEG_REVISION is
# the same as LIMIT_REVISION), this is a no-brainer. If
# LIMIT_REVISION is older than PEG_REVISION, we can use Subversion's
# history tracing code to find the right location. If, however,
# LIMIT_REVISION is younger than PEG_REVISION, we suffer from
# Subversion's lack of forward history searching. Our workaround,
# ugly as it may be, involves a binary search through the revisions
# between PEG_REVISION and LIMIT_REVISION to find our last live
# revision.
peg_revision = self._getrev(peg_revision)
limit_revision = self._getrev(limit_revision)
if peg_revision == limit_revision:
return peg_revision, path
elif peg_revision > limit_revision:
path = self.get_location(path, peg_revision, limit_revision)
return limit_revision, path
else:
direction = 1
while peg_revision != limit_revision:
mid = (peg_revision + 1 + limit_revision) / 2
try:
path = self.get_location(path, peg_revision, mid)
except vclib.ItemNotFound:
limit_revision = mid - 1
else:
peg_revision = mid
return peg_revision, path

919
lib/vclib/svn/svn_repos.py Normal file
View File

@@ -0,0 +1,919 @@
# -*-python-*-
#
# Copyright (C) 1999-2011 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
"Version Control lib driver for locally accessible Subversion repositories"
import vclib
import os
import os.path
import string
import cStringIO
import signal
import time
import tempfile
import popen
import re
from svn import fs, repos, core, client, delta
### Require Subversion 1.3.1 or better.
if (core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_PATCH) < (1, 3, 1):
raise Exception, "Version requirement not met (needs 1.3.1 or better)"
### Pre-1.5 Subversion doesn't have SVN_ERR_CEASE_INVOCATION
try:
_SVN_ERR_CEASE_INVOCATION = core.SVN_ERR_CEASE_INVOCATION
except:
_SVN_ERR_CEASE_INVOCATION = core.SVN_ERR_CANCELLED
### Pre-1.5 SubversionException's might not have the .msg and .apr_err members
def _fix_subversion_exception(e):
if not hasattr(e, 'apr_err'):
e.apr_err = e[1]
if not hasattr(e, 'message'):
e.message = e[0]
def _allow_all(root, path, pool):
"""Generic authz_read_func that permits access to all paths"""
return 1
def _path_parts(path):
return filter(None, string.split(path, '/'))
def _cleanup_path(path):
"""Return a cleaned-up Subversion filesystem path"""
return string.join(_path_parts(path), '/')
def _fs_path_join(base, relative):
return _cleanup_path(base + '/' + relative)
def _compare_paths(path1, path2):
path1_len = len (path1);
path2_len = len (path2);
min_len = min(path1_len, path2_len)
i = 0
# Are the paths exactly the same?
if path1 == path2:
return 0
# Skip past common prefix
while (i < min_len) and (path1[i] == path2[i]):
i = i + 1
# Children of paths are greater than their parents, but less than
# greater siblings of their parents
char1 = '\0'
char2 = '\0'
if (i < path1_len):
char1 = path1[i]
if (i < path2_len):
char2 = path2[i]
if (char1 == '/') and (i == path2_len):
return 1
if (char2 == '/') and (i == path1_len):
return -1
if (i < path1_len) and (char1 == '/'):
return -1
if (i < path2_len) and (char2 == '/'):
return 1
# Common prefix was skipped above, next character is compared to
# determine order
return cmp(char1, char2)
def _rev2optrev(rev):
assert type(rev) is int
rt = core.svn_opt_revision_t()
rt.kind = core.svn_opt_revision_number
rt.value.number = rev
return rt
def _rootpath2url(rootpath, path):
rootpath = os.path.abspath(rootpath)
if rootpath and rootpath[0] != '/':
rootpath = '/' + rootpath
if os.sep != '/':
rootpath = string.replace(rootpath, os.sep, '/')
return 'file://' + string.join([rootpath, path], "/")
# Given a dictionary REVPROPS of revision properties, pull special
# ones out of them and return a 4-tuple containing the log message,
# the author, the date (converted from the date string property), and
# a dictionary of any/all other revprops.
def _split_revprops(revprops):
if not revprops:
return None, None, None, {}
special_props = []
for prop in core.SVN_PROP_REVISION_LOG, \
core.SVN_PROP_REVISION_AUTHOR, \
core.SVN_PROP_REVISION_DATE:
if revprops.has_key(prop):
special_props.append(revprops[prop])
del(revprops[prop])
else:
special_props.append(None)
msg, author, datestr = tuple(special_props)
date = _datestr_to_date(datestr)
return msg, author, date, revprops
def _datestr_to_date(datestr):
try:
return core.svn_time_from_cstring(datestr) / 1000000
except:
return None
class Revision(vclib.Revision):
"Hold state for each revision's log entry."
def __init__(self, rev, date, author, msg, size, lockinfo,
filename, copy_path, copy_rev):
vclib.Revision.__init__(self, rev, str(rev), date, author, None,
msg, size, lockinfo)
self.filename = filename
self.copy_path = copy_path
self.copy_rev = copy_rev
class NodeHistory:
"""An iterable object that returns 2-tuples of (revision, path)
locations along a node's change history, ordered from youngest to
oldest."""
def __init__(self, fs_ptr, show_all_logs, limit=0):
self.histories = []
self.fs_ptr = fs_ptr
self.show_all_logs = show_all_logs
self.oldest_rev = None
self.limit = limit
def add_history(self, path, revision, pool):
# If filtering, only add the path and revision to the histories
# list if they were actually changed in this revision (where
# change means the path itself was changed, or one of its parents
# was copied). This is useful for omitting bubble-up directory
# changes.
if not self.oldest_rev:
self.oldest_rev = revision
else:
assert(revision < self.oldest_rev)
if not self.show_all_logs:
rev_root = fs.revision_root(self.fs_ptr, revision)
changed_paths = fs.paths_changed(rev_root)
paths = changed_paths.keys()
if path not in paths:
# Look for a copied parent
test_path = path
found = 0
while 1:
off = string.rfind(test_path, '/')
if off < 0:
break
test_path = test_path[0:off]
if test_path in paths:
copyfrom_rev, copyfrom_path = fs.copied_from(rev_root, test_path)
if copyfrom_rev >= 0 and copyfrom_path:
found = 1
break
if not found:
return
self.histories.append([revision, _cleanup_path(path)])
if self.limit and len(self.histories) == self.limit:
raise core.SubversionException("", _SVN_ERR_CEASE_INVOCATION)
def __getitem__(self, idx):
return self.histories[idx]
def _get_last_history_rev(fsroot, path):
history = fs.node_history(fsroot, path)
history = fs.history_prev(history, 0)
history_path, history_rev = fs.history_location(history)
return history_rev
def temp_checkout(svnrepos, path, rev):
"""Check out file revision to temporary file"""
temp = tempfile.mktemp()
fp = open(temp, 'wb')
try:
root = svnrepos._getroot(rev)
stream = fs.file_contents(root, path)
try:
while 1:
chunk = core.svn_stream_read(stream, core.SVN_STREAM_CHUNK_SIZE)
if not chunk:
break
fp.write(chunk)
finally:
core.svn_stream_close(stream)
finally:
fp.close()
return temp
class FileContentsPipe:
def __init__(self, root, path):
self._stream = fs.file_contents(root, path)
self._eof = 0
def read(self, len=None):
chunk = None
if not self._eof:
if len is None:
buffer = cStringIO.StringIO()
try:
while 1:
hunk = core.svn_stream_read(self._stream, 8192)
if not hunk:
break
buffer.write(hunk)
chunk = buffer.getvalue()
finally:
buffer.close()
else:
chunk = core.svn_stream_read(self._stream, len)
if not chunk:
self._eof = 1
return chunk
def readline(self):
chunk = None
if not self._eof:
chunk, self._eof = core.svn_stream_readline(self._stream, '\n')
if not self._eof:
chunk = chunk + '\n'
if not chunk:
self._eof = 1
return chunk
def readlines(self):
lines = []
while True:
line = self.readline()
if not line:
break
lines.append(line)
return lines
def close(self):
return core.svn_stream_close(self._stream)
def eof(self):
return self._eof
class BlameSource:
def __init__(self, local_url, rev, first_rev, config_dir):
self.idx = -1
self.first_rev = first_rev
self.blame_data = []
ctx = client.svn_client_create_context()
core.svn_config_ensure(config_dir)
ctx.config = core.svn_config_get_config(config_dir)
ctx.auth_baton = core.svn_auth_open([])
try:
### TODO: Is this use of FIRST_REV always what we want? Should we
### pass 1 here instead and do filtering later?
client.blame2(local_url, _rev2optrev(rev), _rev2optrev(first_rev),
_rev2optrev(rev), self._blame_cb, ctx)
except core.SubversionException, e:
_fix_subversion_exception(e)
if e.apr_err == core.SVN_ERR_CLIENT_IS_BINARY_FILE:
raise vclib.NonTextualFileContents
raise
def _blame_cb(self, line_no, rev, author, date, text, pool):
prev_rev = None
if rev > self.first_rev:
prev_rev = rev - 1
self.blame_data.append(vclib.Annotation(text, line_no + 1, rev,
prev_rev, author, None))
def __getitem__(self, idx):
if idx != self.idx + 1:
raise BlameSequencingError()
self.idx = idx
return self.blame_data[idx]
class BlameSequencingError(Exception):
pass
class SVNChangedPath(vclib.ChangedPath):
"""Wrapper around vclib.ChangedPath which handles path splitting."""
def __init__(self, path, rev, pathtype, base_path, base_rev,
action, copied, text_changed, props_changed):
path_parts = _path_parts(path or '')
base_path_parts = _path_parts(base_path or '')
vclib.ChangedPath.__init__(self, path_parts, rev, pathtype,
base_path_parts, base_rev, action,
copied, text_changed, props_changed)
class LocalSubversionRepository(vclib.Repository):
def __init__(self, name, rootpath, authorizer, utilities, config_dir):
if not (os.path.isdir(rootpath) \
and os.path.isfile(os.path.join(rootpath, 'format'))):
raise vclib.ReposNotFound(name)
# Initialize some stuff.
self.rootpath = rootpath
self.name = name
self.auth = authorizer
self.svn_client_path = utilities.svn or 'svn'
self.diff_cmd = utilities.diff or 'diff'
self.config_dir = config_dir or None
# See if this repository is even viewable, authz-wise.
if not vclib.check_root_access(self):
raise vclib.ReposNotFound(name)
def open(self):
# Register a handler for SIGTERM so we can have a chance to
# cleanup. If ViewVC takes too long to start generating CGI
# output, Apache will grow impatient and SIGTERM it. While we
# don't mind getting told to bail, we want to gracefully close the
# repository before we bail.
def _sigterm_handler(signum, frame, self=self):
sys.exit(-1)
try:
signal.signal(signal.SIGTERM, _sigterm_handler)
except ValueError:
# This is probably "ValueError: signal only works in main
# thread", which will get thrown by the likes of mod_python
# when trying to install a signal handler from a thread that
# isn't the main one. We'll just not care.
pass
# Open the repository and init some other variables.
self.repos = repos.svn_repos_open(self.rootpath)
self.fs_ptr = repos.svn_repos_fs(self.repos)
self.youngest = fs.youngest_rev(self.fs_ptr)
self._fsroots = {}
self._revinfo_cache = {}
# See if a universal read access determination can be made.
if self.auth and self.auth.check_universal_access(self.name) == 1:
self.auth = None
def rootname(self):
return self.name
def rootpath(self):
return self.rootpath
def roottype(self):
return vclib.SVN
def authorizer(self):
return self.auth
def itemtype(self, path_parts, rev):
rev = self._getrev(rev)
basepath = self._getpath(path_parts)
pathtype = self._gettype(basepath, rev)
if pathtype is None:
raise vclib.ItemNotFound(path_parts)
if not vclib.check_path_access(self, path_parts, pathtype, rev):
raise vclib.ItemNotFound(path_parts)
return pathtype
def openfile(self, path_parts, rev, options):
path = self._getpath(path_parts)
if self.itemtype(path_parts, rev) != vclib.FILE: # does auth-check
raise vclib.Error("Path '%s' is not a file." % path)
rev = self._getrev(rev)
fsroot = self._getroot(rev)
revision = str(_get_last_history_rev(fsroot, path))
fp = FileContentsPipe(fsroot, path)
return fp, revision
def listdir(self, path_parts, rev, options):
path = self._getpath(path_parts)
if self.itemtype(path_parts, rev) != vclib.DIR: # does auth-check
raise vclib.Error("Path '%s' is not a directory." % path)
rev = self._getrev(rev)
fsroot = self._getroot(rev)
dirents = fs.dir_entries(fsroot, path)
entries = [ ]
for entry in dirents.values():
if entry.kind == core.svn_node_dir:
kind = vclib.DIR
elif entry.kind == core.svn_node_file:
kind = vclib.FILE
if vclib.check_path_access(self, path_parts + [entry.name], kind, rev):
entries.append(vclib.DirEntry(entry.name, kind))
return entries
def dirlogs(self, path_parts, rev, entries, options):
path = self._getpath(path_parts)
if self.itemtype(path_parts, rev) != vclib.DIR: # does auth-check
raise vclib.Error("Path '%s' is not a directory." % path)
fsroot = self._getroot(self._getrev(rev))
rev = self._getrev(rev)
for entry in entries:
entry_path_parts = path_parts + [entry.name]
if not vclib.check_path_access(self, entry_path_parts, entry.kind, rev):
continue
path = self._getpath(entry_path_parts)
entry_rev = _get_last_history_rev(fsroot, path)
date, author, msg, revprops, changes = self._revinfo(entry_rev)
entry.rev = str(entry_rev)
entry.date = date
entry.author = author
entry.log = msg
if entry.kind == vclib.FILE:
entry.size = fs.file_length(fsroot, path)
lock = fs.get_lock(self.fs_ptr, path)
entry.lockinfo = lock and lock.owner or None
def itemlog(self, path_parts, rev, sortby, first, limit, options):
"""see vclib.Repository.itemlog docstring
Option values recognized by this implementation
svn_show_all_dir_logs
boolean, default false. if set for a directory path, will include
revisions where files underneath the directory have changed
svn_cross_copies
boolean, default false. if set for a path created by a copy, will
include revisions from before the copy
svn_latest_log
boolean, default false. if set will return only newest single log
entry
"""
assert sortby == vclib.SORTBY_DEFAULT or sortby == vclib.SORTBY_REV
path = self._getpath(path_parts)
path_type = self.itemtype(path_parts, rev) # does auth-check
rev = self._getrev(rev)
revs = []
lockinfo = None
# See if this path is locked.
try:
lock = fs.get_lock(self.fs_ptr, path)
if lock:
lockinfo = lock.owner
except NameError:
pass
# If our caller only wants the latest log, we'll invoke
# _log_helper for just the one revision. Otherwise, we go off
# into history-fetching mode. ### TODO: we could stand to have a
# 'limit' parameter here as numeric cut-off for the depth of our
# history search.
if options.get('svn_latest_log', 0):
revision = self._log_helper(path, rev, lockinfo)
if revision:
revision.prev = None
revs.append(revision)
else:
history = self._get_history(path, rev, path_type, first + limit, options)
if len(history) < first:
history = []
if limit:
history = history[first:first+limit]
for hist_rev, hist_path in history:
revision = self._log_helper(hist_path, hist_rev, lockinfo)
if revision:
# If we have unreadable copyfrom data, obscure it.
if revision.copy_path is not None:
cp_parts = _path_parts(revision.copy_path)
if not vclib.check_path_access(self, cp_parts, path_type,
revision.copy_rev):
revision.copy_path = revision.copy_rev = None
revision.prev = None
if len(revs):
revs[-1].prev = revision
revs.append(revision)
return revs
def itemprops(self, path_parts, rev):
path = self._getpath(path_parts)
path_type = self.itemtype(path_parts, rev) # does auth-check
rev = self._getrev(rev)
fsroot = self._getroot(rev)
return fs.node_proplist(fsroot, path)
def annotate(self, path_parts, rev):
path = self._getpath(path_parts)
path_type = self.itemtype(path_parts, rev) # does auth-check
if path_type != vclib.FILE:
raise vclib.Error("Path '%s' is not a file." % path)
rev = self._getrev(rev)
fsroot = self._getroot(rev)
history = self._get_history(path, rev, path_type, 0,
{'svn_cross_copies': 1})
youngest_rev, youngest_path = history[0]
oldest_rev, oldest_path = history[-1]
source = BlameSource(_rootpath2url(self.rootpath, path),
youngest_rev, oldest_rev, self.config_dir)
return source, youngest_rev
def revinfo(self, rev):
return self._revinfo(rev, 1)
def rawdiff(self, path_parts1, rev1, path_parts2, rev2, type, options={}):
p1 = self._getpath(path_parts1)
p2 = self._getpath(path_parts2)
r1 = self._getrev(rev1)
r2 = self._getrev(rev2)
if not vclib.check_path_access(self, path_parts1, vclib.FILE, rev1):
raise vclib.ItemNotFound(path_parts1)
if not vclib.check_path_access(self, path_parts2, vclib.FILE, rev2):
raise vclib.ItemNotFound(path_parts2)
args = vclib._diff_args(type, options)
def _date_from_rev(rev):
date, author, msg, revprops, changes = self._revinfo(rev)
return date
try:
temp1 = temp_checkout(self, p1, r1)
temp2 = temp_checkout(self, p2, r2)
info1 = p1, _date_from_rev(r1), r1
info2 = p2, _date_from_rev(r2), r2
return vclib._diff_fp(temp1, temp2, info1, info2, self.diff_cmd, args)
except core.SubversionException, e:
_fix_subversion_exception(e)
if e.apr_err == core.SVN_ERR_FS_NOT_FOUND:
raise vclib.InvalidRevision
raise
def isexecutable(self, path_parts, rev):
props = self.itemprops(path_parts, rev) # does authz-check
return props.has_key(core.SVN_PROP_EXECUTABLE)
##--- helpers ---##
def _revinfo(self, rev, include_changed_paths=0):
"""Internal-use, cache-friendly revision information harvester."""
def _get_changed_paths(fsroot):
"""Return a 3-tuple: found_readable, found_unreadable, changed_paths."""
editor = repos.ChangeCollector(self.fs_ptr, fsroot)
e_ptr, e_baton = delta.make_editor(editor)
repos.svn_repos_replay(fsroot, e_ptr, e_baton)
changedpaths = {}
changes = editor.get_changes()
# Copy the Subversion changes into a new hash, checking
# authorization and converting them into ChangedPath objects.
found_readable = found_unreadable = 0
for path in changes.keys():
change = changes[path]
if change.path:
change.path = _cleanup_path(change.path)
if change.base_path:
change.base_path = _cleanup_path(change.base_path)
is_copy = 0
if not hasattr(change, 'action'): # new to subversion 1.4.0
action = vclib.MODIFIED
if not change.path:
action = vclib.DELETED
elif change.added:
action = vclib.ADDED
replace_check_path = path
if change.base_path and change.base_rev:
replace_check_path = change.base_path
if changedpaths.has_key(replace_check_path) \
and changedpaths[replace_check_path].action == vclib.DELETED:
action = vclib.REPLACED
else:
if change.action == repos.CHANGE_ACTION_ADD:
action = vclib.ADDED
elif change.action == repos.CHANGE_ACTION_DELETE:
action = vclib.DELETED
elif change.action == repos.CHANGE_ACTION_REPLACE:
action = vclib.REPLACED
else:
action = vclib.MODIFIED
if (action == vclib.ADDED or action == vclib.REPLACED) \
and change.base_path \
and change.base_rev:
is_copy = 1
if change.item_kind == core.svn_node_dir:
pathtype = vclib.DIR
elif change.item_kind == core.svn_node_file:
pathtype = vclib.FILE
else:
pathtype = None
parts = _path_parts(path)
if vclib.check_path_access(self, parts, pathtype, rev):
if is_copy and change.base_path and (change.base_path != path):
parts = _path_parts(change.base_path)
if not vclib.check_path_access(self, parts, pathtype,
change.base_rev):
is_copy = 0
change.base_path = None
change.base_rev = None
changedpaths[path] = SVNChangedPath(path, rev, pathtype,
change.base_path,
change.base_rev, action,
is_copy, change.text_changed,
change.prop_changes)
found_readable = 1
else:
found_unreadable = 1
return found_readable, found_unreadable, changedpaths.values()
def _get_change_copyinfo(fsroot, path, change):
if hasattr(change, 'copyfrom_known') and change.copyfrom_known:
copyfrom_path = change.copyfrom_path
copyfrom_rev = change.copyfrom_rev
else:
copyfrom_rev, copyfrom_path = fs.copied_from(fsroot, path)
return copyfrom_path, copyfrom_rev
def _simple_auth_check(fsroot):
"""Return a 2-tuple: found_readable, found_unreadable."""
found_unreadable = found_readable = 0
if hasattr(fs, 'paths_changed2'):
changes = fs.paths_changed2(fsroot)
else:
changes = fs.paths_changed(fsroot)
paths = changes.keys()
for path in paths:
change = changes[path]
pathtype = None
if hasattr(change, 'node_kind'):
if change.node_kind == core.svn_node_file:
pathtype = vclib.FILE
elif change.node_kind == core.svn_node_dir:
pathtype = vclib.DIR
parts = _path_parts(path)
if pathtype is None:
# Figure out the pathtype so we can query the authz subsystem.
if change.change_kind == fs.path_change_delete:
# Deletions are annoying, because they might be underneath
# copies (make their previous location non-trivial).
prev_parts = parts
prev_rev = rev - 1
parent_parts = parts[:-1]
while parent_parts:
parent_path = '/' + self._getpath(parent_parts)
parent_change = changes.get(parent_path)
if not (parent_change and \
(parent_change.change_kind == fs.path_change_add or
parent_change.change_kind == fs.path_change_replace)):
del(parent_parts[-1])
continue
copyfrom_path, copyfrom_rev = \
_get_change_copyinfo(fsroot, parent_path, parent_change)
if copyfrom_path:
prev_rev = copyfrom_rev
prev_parts = _path_parts(copyfrom_path) + \
parts[len(parent_parts):]
break
del(parent_parts[-1])
pathtype = self._gettype(self._getpath(prev_parts), prev_rev)
else:
pathtype = self._gettype(self._getpath(parts), rev)
if vclib.check_path_access(self, parts, pathtype, rev):
found_readable = 1
copyfrom_path, copyfrom_rev = \
_get_change_copyinfo(fsroot, path, change)
if copyfrom_path and copyfrom_path != path:
parts = _path_parts(copyfrom_path)
if not vclib.check_path_access(self, parts, pathtype,
copyfrom_rev):
found_unreadable = 1
else:
found_unreadable = 1
if found_readable and found_unreadable:
break
return found_readable, found_unreadable
def _revinfo_helper(rev, include_changed_paths):
# Get the revision property info. (Would use
# editor.get_root_props(), but something is broken there...)
revprops = fs.revision_proplist(self.fs_ptr, rev)
msg, author, date, revprops = _split_revprops(revprops)
# Optimization: If our caller doesn't care about the changed
# paths, and we don't need them to do authz determinations, let's
# get outta here.
if self.auth is None and not include_changed_paths:
return date, author, msg, revprops, None
# If we get here, then we either need the changed paths because we
# were asked for them, or we need them to do authorization checks.
#
# If we only need them for authorization checks, though, we
# won't bother generating fully populated ChangedPath items (the
# cost is too great).
fsroot = self._getroot(rev)
if include_changed_paths:
found_readable, found_unreadable, changedpaths = \
_get_changed_paths(fsroot)
else:
changedpaths = None
found_readable, found_unreadable = _simple_auth_check(fsroot)
# Filter our metadata where necessary, and return the requested data.
if found_unreadable:
msg = None
if not found_readable:
author = None
date = None
return date, author, msg, revprops, changedpaths
# Consult the revinfo cache first. If we don't have cached info,
# or our caller wants changed paths and we don't have those for
# this revision, go do the real work.
rev = self._getrev(rev)
cached_info = self._revinfo_cache.get(rev)
if not cached_info \
or (include_changed_paths and cached_info[4] is None):
cached_info = _revinfo_helper(rev, include_changed_paths)
self._revinfo_cache[rev] = cached_info
return tuple(cached_info)
def _log_helper(self, path, rev, lockinfo):
rev_root = fs.revision_root(self.fs_ptr, rev)
copyfrom_rev, copyfrom_path = fs.copied_from(rev_root, path)
date, author, msg, revprops, changes = self._revinfo(rev)
if fs.is_file(rev_root, path):
size = fs.file_length(rev_root, path)
else:
size = None
return Revision(rev, date, author, msg, size, lockinfo, path,
copyfrom_path and _cleanup_path(copyfrom_path),
copyfrom_rev)
def _get_history(self, path, rev, path_type, limit=0, options={}):
if self.youngest == 0:
return []
rev_paths = []
fsroot = self._getroot(rev)
show_all_logs = options.get('svn_show_all_dir_logs', 0)
if not show_all_logs:
# See if the path is a file or directory.
kind = fs.check_path(fsroot, path)
if kind is core.svn_node_file:
show_all_logs = 1
# Instantiate a NodeHistory collector object, and use it to collect
# history items for PATH@REV.
history = NodeHistory(self.fs_ptr, show_all_logs, limit)
try:
repos.svn_repos_history(self.fs_ptr, path, history.add_history,
1, rev, options.get('svn_cross_copies', 0))
except core.SubversionException, e:
_fix_subversion_exception(e)
if e.apr_err != _SVN_ERR_CEASE_INVOCATION:
raise
# Now, iterate over those history items, checking for changes of
# location, pruning as necessitated by authz rules.
for hist_rev, hist_path in history:
path_parts = _path_parts(hist_path)
if not vclib.check_path_access(self, path_parts, path_type, hist_rev):
break
rev_paths.append([hist_rev, hist_path])
return rev_paths
def _getpath(self, path_parts):
return string.join(path_parts, '/')
def _getrev(self, rev):
if rev is None or rev == 'HEAD':
return self.youngest
try:
if type(rev) == type(''):
while rev[0] == 'r':
rev = rev[1:]
rev = int(rev)
except:
raise vclib.InvalidRevision(rev)
if (rev < 0) or (rev > self.youngest):
raise vclib.InvalidRevision(rev)
return rev
def _getroot(self, rev):
try:
return self._fsroots[rev]
except KeyError:
r = self._fsroots[rev] = fs.revision_root(self.fs_ptr, rev)
return r
def _gettype(self, path, rev):
# Similar to itemtype(), but without the authz check. Returns
# None for missing paths.
try:
kind = fs.check_path(self._getroot(rev), path)
except:
return None
if kind == core.svn_node_dir:
return vclib.DIR
if kind == core.svn_node_file:
return vclib.FILE
return None
##--- custom ---##
def get_youngest_revision(self):
return self.youngest
def get_location(self, path, rev, old_rev):
try:
results = repos.svn_repos_trace_node_locations(self.fs_ptr, path,
rev, [old_rev], _allow_all)
except core.SubversionException, e:
_fix_subversion_exception(e)
if e.apr_err == core.SVN_ERR_FS_NOT_FOUND:
raise vclib.ItemNotFound(path)
raise
try:
old_path = results[old_rev]
except KeyError:
raise vclib.ItemNotFound(path)
return _cleanup_path(old_path)
def created_rev(self, full_name, rev):
return fs.node_created_rev(self._getroot(rev), full_name)
def last_rev(self, path, peg_revision, limit_revision=None):
"""Given PATH, known to exist in PEG_REVISION, find the youngest
revision older than, or equal to, LIMIT_REVISION in which path
exists. Return that revision, and the path at which PATH exists in
that revision."""
# Here's the plan, man. In the trivial case (where PEG_REVISION is
# the same as LIMIT_REVISION), this is a no-brainer. If
# LIMIT_REVISION is older than PEG_REVISION, we can use Subversion's
# history tracing code to find the right location. If, however,
# LIMIT_REVISION is younger than PEG_REVISION, we suffer from
# Subversion's lack of forward history searching. Our workaround,
# ugly as it may be, involves a binary search through the revisions
# between PEG_REVISION and LIMIT_REVISION to find our last live
# revision.
peg_revision = self._getrev(peg_revision)
limit_revision = self._getrev(limit_revision)
try:
if peg_revision == limit_revision:
return peg_revision, path
elif peg_revision > limit_revision:
fsroot = self._getroot(peg_revision)
history = fs.node_history(fsroot, path)
while history:
path, peg_revision = fs.history_location(history)
if peg_revision <= limit_revision:
return max(peg_revision, limit_revision), _cleanup_path(path)
history = fs.history_prev(history, 1)
return peg_revision, _cleanup_path(path)
else:
orig_id = fs.node_id(self._getroot(peg_revision), path)
while peg_revision != limit_revision:
mid = (peg_revision + 1 + limit_revision) / 2
try:
mid_id = fs.node_id(self._getroot(mid), path)
except core.SubversionException, e:
_fix_subversion_exception(e)
if e.apr_err == core.SVN_ERR_FS_NOT_FOUND:
cmp = -1
else:
raise
else:
### Not quite right. Need a comparison function that only returns
### true when the two nodes are the same copy, not just related.
cmp = fs.compare_ids(orig_id, mid_id)
if cmp in (0, 1):
peg_revision = mid
else:
limit_revision = mid - 1
return peg_revision, path
finally:
pass

4521
lib/viewvc.py Normal file

File diff suppressed because it is too large Load Diff

235
lib/win32popen.py Normal file
View File

@@ -0,0 +1,235 @@
# -*-python-*-
#
# Copyright (C) 1999-2007 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# Utilities for controlling processes and pipes on win32
#
# -----------------------------------------------------------------------
import os, sys, traceback, string, thread
try:
import win32api
except ImportError, e:
raise ImportError, str(e) + """
Did you install the Python for Windows Extensions?
http://sourceforge.net/projects/pywin32/
"""
import win32process, win32pipe, win32con
import win32event, win32file, winerror
import pywintypes, msvcrt
# Buffer size for spooling
SPOOL_BYTES = 4096
# File object to write error messages
SPOOL_ERROR = sys.stderr
#SPOOL_ERROR = open("m:/temp/error.txt", "wt")
def CommandLine(command, args):
"""Convert an executable path and a sequence of arguments into a command
line that can be passed to CreateProcess"""
cmd = "\"" + string.replace(command, "\"", "\"\"") + "\""
for arg in args:
cmd = cmd + " \"" + string.replace(arg, "\"", "\"\"") + "\""
return cmd
def CreateProcess(cmd, hStdInput, hStdOutput, hStdError):
"""Creates a new process which uses the specified handles for its standard
input, output, and error. The handles must be inheritable. 0 can be passed
as a special handle indicating that the process should inherit the current
process's input, output, or error streams, and None can be passed to discard
the child process's output or to prevent it from reading any input."""
# initialize new process's startup info
si = win32process.STARTUPINFO()
si.dwFlags = win32process.STARTF_USESTDHANDLES
if hStdInput == 0:
si.hStdInput = win32api.GetStdHandle(win32api.STD_INPUT_HANDLE)
else:
si.hStdInput = hStdInput
if hStdOutput == 0:
si.hStdOutput = win32api.GetStdHandle(win32api.STD_OUTPUT_HANDLE)
else:
si.hStdOutput = hStdOutput
if hStdError == 0:
si.hStdError = win32api.GetStdHandle(win32api.STD_ERROR_HANDLE)
else:
si.hStdError = hStdError
# create the process
phandle, pid, thandle, tid = win32process.CreateProcess \
( None, # appName
cmd, # commandLine
None, # processAttributes
None, # threadAttributes
1, # bInheritHandles
win32con.NORMAL_PRIORITY_CLASS, # dwCreationFlags
None, # newEnvironment
None, # currentDirectory
si # startupinfo
)
if hStdInput and hasattr(hStdInput, 'Close'):
hStdInput.Close()
if hStdOutput and hasattr(hStdOutput, 'Close'):
hStdOutput.Close()
if hStdError and hasattr(hStdError, 'Close'):
hStdError.Close()
return phandle, pid, thandle, tid
def CreatePipe(readInheritable, writeInheritable):
"""Create a new pipe specifying whether the read and write ends are
inheritable and whether they should be created for blocking or nonblocking
I/O."""
r, w = win32pipe.CreatePipe(None, SPOOL_BYTES)
if readInheritable:
r = MakeInheritedHandle(r)
if writeInheritable:
w = MakeInheritedHandle(w)
return r, w
def File2FileObject(pipe, mode):
"""Make a C stdio file object out of a win32 file handle"""
if string.find(mode, 'r') >= 0:
wmode = os.O_RDONLY
elif string.find(mode, 'w') >= 0:
wmode = os.O_WRONLY
if string.find(mode, 'b') >= 0:
wmode = wmode | os.O_BINARY
if string.find(mode, 't') >= 0:
wmode = wmode | os.O_TEXT
return os.fdopen(msvcrt.open_osfhandle(pipe.Detach(),wmode),mode)
def FileObject2File(fileObject):
"""Get the win32 file handle from a C stdio file object"""
return win32file._get_osfhandle(fileObject.fileno())
def DuplicateHandle(handle):
"""Duplicates a win32 handle."""
proc = win32api.GetCurrentProcess()
return win32api.DuplicateHandle(proc,handle,proc,0,0,win32con.DUPLICATE_SAME_ACCESS)
def MakePrivateHandle(handle, replace = 1):
"""Turn an inherited handle into a non inherited one. This avoids the
handle duplication that occurs on CreateProcess calls which can create
uncloseable pipes."""
### Could change implementation to use SetHandleInformation()...
flags = win32con.DUPLICATE_SAME_ACCESS
proc = win32api.GetCurrentProcess()
if replace: flags = flags | win32con.DUPLICATE_CLOSE_SOURCE
newhandle = win32api.DuplicateHandle(proc,handle,proc,0,0,flags)
if replace: handle.Detach() # handle was already deleted by the last call
return newhandle
def MakeInheritedHandle(handle, replace = 1):
"""Turn a private handle into an inherited one."""
### Could change implementation to use SetHandleInformation()...
flags = win32con.DUPLICATE_SAME_ACCESS
proc = win32api.GetCurrentProcess()
if replace: flags = flags | win32con.DUPLICATE_CLOSE_SOURCE
newhandle = win32api.DuplicateHandle(proc,handle,proc,0,1,flags)
if replace: handle.Detach() # handle was deleted by the last call
return newhandle
def MakeSpyPipe(readInheritable, writeInheritable, outFiles = None, doneEvent = None):
"""Return read and write handles to a pipe that asynchronously writes all of
its input to the files in the outFiles sequence. doneEvent can be None, or a
a win32 event handle that will be set when the write end of pipe is closed.
"""
if outFiles is None:
return CreatePipe(readInheritable, writeInheritable)
r, writeHandle = CreatePipe(0, writeInheritable)
if readInheritable is None:
readHandle, w = None, None
else:
readHandle, w = CreatePipe(readInheritable, 0)
thread.start_new_thread(SpoolWorker, (r, w, outFiles, doneEvent))
return readHandle, writeHandle
def SpoolWorker(srcHandle, destHandle, outFiles, doneEvent):
"""Thread entry point for implementation of MakeSpyPipe"""
try:
buffer = win32file.AllocateReadBuffer(SPOOL_BYTES)
while 1:
try:
#print >> SPOOL_ERROR, "Calling ReadFile..."; SPOOL_ERROR.flush()
hr, data = win32file.ReadFile(srcHandle, buffer)
#print >> SPOOL_ERROR, "ReadFile returned '%s', '%s'" % (str(hr), str(data)); SPOOL_ERROR.flush()
if hr != 0:
raise "win32file.ReadFile returned %i, '%s'" % (hr, data)
elif len(data) == 0:
break
except pywintypes.error, e:
#print >> SPOOL_ERROR, "ReadFile threw '%s'" % str(e); SPOOL_ERROR.flush()
if e.args[0] == winerror.ERROR_BROKEN_PIPE:
break
else:
raise e
#print >> SPOOL_ERROR, "Writing to %i file objects..." % len(outFiles); SPOOL_ERROR.flush()
for f in outFiles:
f.write(data)
#print >> SPOOL_ERROR, "Done writing to file objects."; SPOOL_ERROR.flush()
#print >> SPOOL_ERROR, "Writing to destination %s" % str(destHandle); SPOOL_ERROR.flush()
if destHandle:
#print >> SPOOL_ERROR, "Calling WriteFile..."; SPOOL_ERROR.flush()
hr, bytes = win32file.WriteFile(destHandle, data)
#print >> SPOOL_ERROR, "WriteFile() passed %i bytes and returned %i, %i" % (len(data), hr, bytes); SPOOL_ERROR.flush()
if hr != 0 or bytes != len(data):
raise "win32file.WriteFile() passed %i bytes and returned %i, %i" % (len(data), hr, bytes)
srcHandle.Close()
if doneEvent:
win32event.SetEvent(doneEvent)
if destHandle:
destHandle.Close()
except:
info = sys.exc_info()
SPOOL_ERROR.writelines(apply(traceback.format_exception, info), '')
SPOOL_ERROR.flush()
del info
def NullFile(inheritable):
"""Create a null file handle."""
if inheritable:
sa = pywintypes.SECURITY_ATTRIBUTES()
sa.bInheritHandle = 1
else:
sa = None
return win32file.CreateFile("nul",
win32file.GENERIC_READ | win32file.GENERIC_WRITE,
win32file.FILE_SHARE_READ | win32file.FILE_SHARE_WRITE,
sa, win32file.OPEN_EXISTING, 0, None)

53
notes/TODO Normal file
View File

@@ -0,0 +1,53 @@
PREFACE
-------
This file will go away soon after release 0.8. Please use the SourceForge
tracker to resubmit any of the items listed below, if you think, it is
still an issue:
http://sourceforge.net/tracker/?group_id=18760
Before reporting please check, whether someone else has already done this.
Working patches increase the chance to be included into the next release.
-- PeFu / October 2001
TODO ITEMS
----------
*) add Tamminen Eero's comments on how to make Linux directly execute
the Python script. From email on Feb 19.
[ add other examples, such as my /bin/sh hack or the teeny CGI stub
importing the bulk hack ]
*) insert rcs_path into PATH before calling "rcsdiff". rcsdiff might
use "co" and needs to find it on the path.
*) show the "locked" flag (attach it to the LogEntry objects).
Idea from Russell Gordon <russell@hoopscotch.dhs.org>
*) committing with a specific revision number:
http://mailman.lyra.org/pipermail/viewcvs/2000q1/000008.html
*) add capability similar to cvs2cl.pl:
http://mailman.lyra.org/pipermail/viewcvs/2000q2/000050.html
suggestion from Chris Meyer <cmeyer@gatan.com>.
*) add a tree view of the directory structure (and files?)
*) include a ConfigParser.py to help older Python installations
*) add a check for the rcs programs/paths to viewvc-install. clarify the
dependency on RCS in the docs.
*) have a "check" mode that verifies binaries are available on rcs_path
-> alternately (probably?): use rcsparse rather than external tools
KNOWN BUGS
----------
*) time.timezone seems to not be available on some 1.5.2 installs.
I was unable to verify this. On RedHat and SuSE Linux this bug
is non existant.
*) With old repositories containing many branches, tags or thousands
or revisions, the cvsgraph feature becomes unusable (see INSTALL).
ViewVC can't do much about this, but it might be possible to
investigate the number of branches, tags and revision in advance
and disable the cvsgraph links, if the numbers exceed a certain
treshold.

82
notes/authz-dev-TODO Normal file
View File

@@ -0,0 +1,82 @@
Here lie TODO items for the pluggable authz system:
* Subversion uses path privelege to determine visibility of revision
metadata. That logic is pretty Subversion-specific, so it feels like it
belongs outside the vcauth library as just a helper function in viewvc.py
or something. The algorithm is something like this (culled from the
CollabNet implementation, and not expected to work as edited):
# Subversion revision access levels
REVISION_ACCESS_NONE = 0
REVISION_ACCESS_PARTIAL = 1
REVISION_ACCESS_FULL = 2
def check_svn_revision_access(request, rev):
# Check our revision access cache first.
if request.rev_access_cache.has_key(rev):
return request.rev_access_cache[rev]
# Check our cached answer to the question "Does the user have
# an all-access or a not-at-all-access pass?"
if request.full_access is not None:
return request.full_access \
and REVISION_ACCESS_FULL or REVISION_ACCESS_NONE
# Get a list of paths changed in REV.
### FIXME: There outta be a vclib-complaint way to do this,
### as this won't work for vclib.svn_ra.
import svn.fs
rev_root = svn.fs.revision_root(self.repos.fs_ptr, rev)
changes = svn.fs.paths_changed(rev_root)
# Loop over the list of changed paths, asking the access question
# for each one. We'll track whether we've found any readable paths
# as well as any un-readable (non-authorized) paths, and quit
# checking as soon as we know our revision access level.
found_readable = 0
found_unreadable = 0
for path in changes.keys():
parts = _path_parts(path)
kind = request.repos.itemtype(parts, rev)
if kind == vclib.DIR:
access = request.auth.check_dir_access(parts, rev)
elif:
access = request.auth.check_file_access(parts, rev)
if access:
found_readable = 1
else:
found_unreadable = 1
# Optimization: if we've found at least one readable, and one
# unreadable, we needn't ask about any more paths.
if found_readable and found_unreadable:
break
# If there are paths but we can't read any of them, no access is
# granted.
if len(changes) and not found_readable:
request.rev_access_cache[rev] = REVISION_ACCESS_NONE
# If we found at least one unreadable path, partial access is
# granted.
elif found_unreadable:
request.rev_access_cache[rev] = REVISION_ACCESS_PARTIAL
# Finally, if there were no paths at all, or none of the existing
# ones were unreadable, grant full access.
else:
request.rev_access_cache[rev] = REVISION_ACCESS_FULL
return request.rev_access_cache[rev]
The problems are: where does one hang the revision access cache
so that it doesn't survive a given request? On the request, as
shown in the edited code above?
Can we actually get a good interface into the vcauth layer for
asking the all-access / no-access question? Obviously each vcauth
provider can cache that value for itself and use it as it deems
necessary, but ideally the revision access level question will
want to know if said auth provider was able to answer the question
and, if so, what the answer was.
Another off-the-wall idea -- let's just teach Subversion to do
this calculation as part of a libsvn_repos API.

BIN
notes/logo/viewvc-logo.odg Normal file

Binary file not shown.

BIN
notes/logo/viewvc-logo.pdf Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 10 KiB

115
notes/releases.txt Normal file
View File

@@ -0,0 +1,115 @@
RELEASE MANAGEMENT
ViewVC rolls releases from release branches associate with each minor
version of the software. For example, the 1.1.0 is rolled from the
1.1.x branch. The same is true for the 1.1.1, 1.1.2, ... releases.
There is a script, `tools/make-release', which creates a release
directory and the various archive files that we distribute. All other
steps required to get a ViewVC release out of the door require manual
execution (currently by C. Michael Pilato). Those steps are as
follows:
Checkout a working copy of the release branch for the release you
intend to roll, and in that working copy, perform the following steps
(X, Y, and Z below represent integral major, minor, and patch version
numbers, and not literal):
1. Review any open bug reports:
http://viewvc.tigris.org/servlets/ProjectIssues
2. Add a new subsection to the file 'docs/upgrading.html' describing
all user visible changes for users of previous releases of ViewVC.
Commit any modifications. NOTE: This step should not be necessary
for patch releases.
3. Verify that copyright years are correct in both the license-1.html
file and the source code.
4. Update and commit the 'CHANGES' file, using any available crystal
balls or other forward-looking devices to take a stab at the
release date.
5. Test, test, test! There is no automatic testsuite available. So
just run with permuting different `viewvc.conf' settings... and
pray. Fix what needs fixin', keeping the CHANGES file in sync
with the branch.
6. At this point, the source code committed to the release branch
should exactly reflect what you wish to distribute and dub "the
release".
7. Update your release branch working copy to HEAD.
svn up
8. Edit the file 'lib/viewvc.py' and remove the "-dev" suffix from
__version__. The remainder should be of the form "X.Y.Z", where X,
Y, and Z are positive integers.
*** Do NOT commit this change. ***
9. "Peg" the contributed templates externals definition to the
current HEAD revision:
svn pedit svn:externals .
(squeeze "-rBASE_REV", where BASE_REV is the current HEAD revision
number, between 'templates-contrib' and the target URL).
*** Do NOT commit this change. ***
10. Tag the release:
svn cp -m "Tag the X.Y.Z final release." . ^/tags/X.Y.Z
This will create a copy of the release branch, plus your local
modifications to the svn:externals property and lib/viewvc.py
file, to the tag location.
11. Revert the changes in your working copy.
svn revert -R .
12. Go into an empty directory and run the 'make-release' script:
tools/make-release viewvc-X.Y.Z tags/X.Y.Z
13. Verify the archive files:
- do they have a LICENSE.html file?
- do they have necessary include documentation?
- do they *not* have unnecessary stuff?
- do they install and work correctly?
14. Upload the created archive files (tar.gz and zip) into the Files
and Documents section of the Tigris.org project, and modify the
CHECKSUMS document there accordingly:
http://viewvc.tigris.org/servlets/ProjectDocumentList?folderID=6004
Also, drop a copy of the archive files into the root directory of
the viewvc.org website (unversioned).
15. On trunk, update the websites (both the viewvc.org/ and www/ ones)
to refer to the new release files, and copy the CHANGES for the
new release into trunk's CHANGES file.
16. Edit the file 'lib/viewvc.py' again, incrementing the patch number
assigned to the __version__ variable. Add a new empty block in
the branch's CHANGES file. Commit your changes:
svn ci -m "Begin a new release cycle."
17. Edit the Issue Tracker configuration options, adding a new Version
for the just-released one, and a new Milestone for the next patch
(and possibly, minor or major) release. (For the Milestone sort
key, use a packed integer XXYYZZ: 1.0.3 == 10003, 2.11.4 == 21104.)
http://viewvc.tigris.org/issues/editversions.cgi?component=viewvc&action=add
http://viewvc.tigris.org/issues/editmilestones.cgi?component=viewvc&action=add
18. Send to the announce@ list a message explaining all the cool new
features, and post similar announcements to other places interested
in this sort of stuff, such as Freshmeat (http://www.freshmeat.net).

View File

@@ -0,0 +1,78 @@
The following is an email from a developer who was integrating bzr
into ViewVC in which he shares some thoughts on how to further
abstract the version control system interactions into first-class APIs
in the vclib module.
Subject: Re: [ViewCVS-dev] difflib module
Date: Wed, 1 Jun 2005 16:59:10 -0800
From: "Johan Rydberg" <jrydberg@gnu.org>
To: "Michael Pilato" <cmpilato@collab.net>
Cc: <viewcvs-dev@lyra.org>
"C. Michael Pilato" <cmpilato@collab.net> writes:
>> I've tried to minimize the changes to the viewcvs.py, but of course
>> there are a few places where some things has to be altered.
>
> Well, if along the way, you have ideas about how to further abstract
> stuff into the vclib/ modules, please post.
I came up with a few as off now;
* Generalize revision counting; svn starts from 0, bzr starts from 1.
Can be done by a constant; request.repos.MIN_REVNO. For CVS I'm not
sure exactly what should be done. Right now this is only used in
view_revision_svn, so it is not a problem in the short term.
* Generalize view_diff;
* Have a repo-method diff(file1, rev1, file2, rev2, args) that returns
(date1, date2, fp). Means human_readbale_diff and raw_diff does not
have to parse dates. Good for VCS that does not have the date in
the diff. [### DONE ###]
* I'm not sure you should require GNU diff. Some VCS may use own
diff mechanisms (bzr uses difflib, _or_ GNU diff when needed.
Monotone uses its own, IIRC.)
* Generalize view_revision ;
* Have a method, revision_info(), which returns (date, author, msg,
changes) much like vclib.svn.get_revision_info. The CVS version
can raise a ViewCVSException. [### DONE ###]
* Establish a convention for renamed/copied files; current should
work good enough (change.base_path, change.base_rev) but action
string must be same for both svn and others.
* request.repos.rev (or .revision) should give the current revision
number of the repo. No need for this (from view_directory):
if request.roottype == 'svn':
revision = str(vclib.svn.created_rev(request.repos, request.where))
If svn needs the full name of the repo, why not give it when the
repo is created?
* request.repos.youngest vs vclib.svn.get_youngest_revision(REPO)
* More object oriented;
* The subversion backend is not really object oriented. viewcfg.py uses
a lot function from vclib.svn, which could instead be methods of the
Repository class. Example:
diffobj = vclib.svn.do_diff(request.repos, p1, int(rev1),
p2, int(rev2), args)
This should be a method of the repository;
diffobj = request.repos.do_diff(p1, rev1, ...)
I have identified the following functions;
- vclib.svn.created_rev
- vclib.svn.get_youngest_revision
- vclib.svn.date_from_rev
- vclib.svn.do_diff
- vclib.svn.get_revision_info

240
templates/diff.ezt Normal file
View File

@@ -0,0 +1,240 @@
[# setup page definitions]
[define page_title]Diff of /[where][end]
[define help_href][docroot]/help_rootview.html[end]
[# end]
[include "include/header.ezt" "diff"]
[include "include/file_header.ezt"]
<h3 style="text-align:center;"></h3>
[if-any raw_diff]
<pre class="vc_raw_diff">[raw_diff]</pre>
[end]
[define left_view_href][if-any left.prefer_markup][left.view_href][else][if-any left.download_href][left.download_href][end][end][end]
[define right_view_href][if-any right.prefer_markup][right.view_href][else][if-any right.download_href][right.download_href][end][end][end]
[if-any changes]
<table cellspacing="0" cellpadding="0">
<tr class="vc_diff_header">
<th style="width:6%;"></th>
<th style="width:47%; vertical-align:top;">
[is left.path right.path][else][left.path][end]
revision [if-any left_view_href]<a href="[left_view_href]">[end][left.rev][if-any left_view_href]</a>[end][if-any left.author] by <em>[left.author]</em>[end],
[left.date]
[if-any left.tag]<br />Tag: [left.tag][end]
</th>
<th style="width:47%; vertical-align:top;">
[is left.path right.path][else][right.path][end]
revision [if-any right_view_href]<a href="[right_view_href]">[end][right.rev][if-any right_view_href]</a>[end][if-any right.author] by <em>[right.author]</em>[end],
[right.date]
[if-any right.tag]<br />Tag: [right.tag][end]
</th>
</tr>
[for changes]
[is changes.type "header"]
<tr class="vc_diff_chunk_header" id="h[changes.line_info_right]">
<td style="width:6%;"><strong>#</strong></td>
<td style="width:47%;">
<strong>Line [changes.line_info_left]</strong>&nbsp;
<span class="vc_diff_chunk_extra">[changes.line_info_extra]</span>
</td>
<td style="width:47%;">
<strong>Line [changes.line_info_right]</strong>&nbsp;
<span class="vc_diff_chunk_extra">[changes.line_info_extra]</span>
</td>
</tr>
[else]
[is changes.type "add"]
<tr>
<td class="vc_diff_line_number" id="l[changes.line_number]">[if-any right.annotate_href]<a href="[right.annotate_href]#l[changes.line_number]">[changes.line_number]</a>[else][changes.line_number][end]</td>
<td class="vc_diff_empty">&nbsp;</td>
<td class="vc_diff_add">&nbsp;[changes.right]</td>
</tr>
[else]
[is changes.type "remove"]
<tr>
<td></td>
<td class="vc_diff_remove">&nbsp;[changes.left]</td>
<td class="vc_diff_empty">&nbsp;</td>
</tr>
[else]
[is changes.type "change"]
<tr>
[if-any changes.have_right]
<td class="vc_diff_line_number" id="l[changes.line_number]">[if-any right.annotate_href]<a href="[right.annotate_href]#l[changes.line_number]">[changes.line_number]</a>[else][changes.line_number][end]</td>
[else]
<td></td>
[end]
[if-any changes.have_left]
<td class="vc_diff_change">&nbsp;[changes.left]</td>
[else]
<td class="vc_diff_change_empty">&nbsp;</td>
[end]
[if-any changes.have_right]
<td class="vc_diff_change">&nbsp;[changes.right]</td>
[else]
<td class="vc_diff_change_empty">&nbsp;</td>
[end]
</tr>
[else]
[is changes.type "no-changes"]
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr class="vc_diff_empty">
<td colspan="3" style="text-align:center;"><br />
<strong>- No changes -</strong><br />&nbsp; </td>
</tr>
[else]
[is changes.type "binary-diff"]
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr class="vc_diff_empty">
<td colspan="3" style="text-align:center;"><br />
<strong>- Binary file revisions differ -</strong><br />&nbsp; </td>
</tr>
[else]
[is changes.type "error"]
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr class="vc_diff_empty">
<td colspan="3" style="text-align:center;"> <br />
<strong>- ViewVC depends on rcsdiff and GNU diff to create
this page. ViewVC cannot find GNU diff. Even if you
have GNU diff installed, the rcsdiff program must be
configured and compiled with the GNU diff location.
-</strong> <br />&nbsp; </td>
</tr>
[else]
<tr>
<td class="vc_diff_line_number" id="l[changes.line_number]">[if-any right.annotate_href]<a href="[right.annotate_href]#l[changes.line_number]">[changes.line_number]</a>[else][changes.line_number][end]</td>
<td class="vc_diff_nochange">&nbsp;[changes.left]</td>
<td class="vc_diff_nochange">&nbsp;[changes.right]</td>
</tr>
[end]
[end]
[end]
[end]
[end]
[end]
[end]
[end]
</table>
[end]
[if-any sidebyside]
<table class="vc_idiff">
<colgroup><col /><col class="content" /></colgroup>
<colgroup><col /><col class="content" /></colgroup>
<thead>
<tr>
<th colspan="2">
[is left.path right.path][else][left.path][end]
Revision [left.rev]
</th>
<th colspan="2">
[is left.path right.path][else][right.path][end]
Revision [right.rev]
</th>
</tr>
</thead>
<tbody>
[for sidebyside]
[if-any sidebyside.gap]
<tr>
<th>&hellip;</th><th></th>
<th>&hellip;</th><th></th>
</tr>
[end]
<tr>
[for sidebyside.columns]
<th>[sidebyside.columns.line_number]</th><td[if-any sidebyside.columns.line_number][else] class="vc_idiff_empty"[end]>[for sidebyside.columns.segments][if-any sidebyside.columns.segments.type]<span class="vc_idiff_[sidebyside.columns.segments.type]">[sidebyside.columns.segments.text]</span>[else][sidebyside.columns.segments.text][end][end]</td>
[end]
</tr>
[end]
</tbody>
</table>
[end]
[if-any unified]
<table class="vc_idiff">
<thead>
<tr>
<th>r[left.rev]</th>
<th>r[right.rev]</th>
<th></th>
</tr>
</thead>
<tbody>
[for unified]
[if-any unified.gap]
<tr>
<th>&hellip;</th>
<th>&hellip;</th>
<th></th>
</tr>
[end]
<tr>
<th>[unified.left_number]</th>
<th>[unified.right_number]</th>
<td[if-any unified.type] class="vc_idiff_[unified.type]"[end]>[for unified.segments][if-any unified.segments.type]<span class="vc_idiff_[unified.segments.type]">[unified.segments.text]</span>[else][unified.segments.text][end][end]</td>
</tr>
[end]
</tbody>
</table>
[end]
<hr style="margin-top:1em;" />
<table cellpadding="10" class="auto">
<tr>
<td>
<form method="get" action="[diff_format_action]">
<div>
[for diff_format_hidden_values]<input type="hidden" name="[diff_format_hidden_values.name]" value="[diff_format_hidden_values.value]"/>[end]
<select name="diff_format" onchange="submit()">
<option value="h" [is diff_format "h"]selected="selected"[end]>Colored Diff</option>
<option value="l" [is diff_format "l"]selected="selected"[end]>Long Colored Diff</option>
<option value="f" [is diff_format "f"]selected="selected"[end]>Full Colored Diff</option>
<option value="u" [is diff_format "u"]selected="selected"[end]>Unidiff</option>
<option value="c" [is diff_format "c"]selected="selected"[end]>Context Diff</option>
<option value="s" [is diff_format "s"]selected="selected"[end]>Side by Side</option>
</select>
<input type="submit" value="Show" />
</div>
</form>
</td>
<td>
[if-any raw_diff]
&nbsp;
[else]
<table style="border:solid gray 1px;" class="auto">
<tr>
<td>Legend:<br />
<table cellspacing="0" cellpadding="1">
<tr>
<td style="text-align:center;" class="vc_diff_remove">Removed from v.[left.rev]</td>
<td class="vc_diff_empty">&nbsp;</td>
</tr>
<tr>
<td style="text-align:center;" colspan="2" class="vc_diff_change">changed lines</td>
</tr>
<tr>
<td class="vc_diff_empty">&nbsp;</td>
<td style="text-align:center;" class="vc_diff_add">Added in v.[right.rev]</td>
</tr>
</table>
</td>
</tr>
</table>
[end]
</td>
</tr>
</table>
[include "include/footer.ezt"]

140
templates/dir_new.ezt Normal file
View File

@@ -0,0 +1,140 @@
[include "include/dir_header.ezt"]
<table cellspacing="1" cellpadding="2" class="fixed">
<thead>
<tr>
<th style="width: 200px" class="vc_header[is sortby "file"]_sort[end]">
[if-any sortby_file_href]<a href="[sortby_file_href]#dirlist">File</a>[else]File[end]
[is sortby "file"]
<img class="vc_sortarrow" alt="[is sortdir "down"](rev)[end]"
width="13" height="13"
src="[docroot]/images/[is sortdir "up"]up[else]down[end].png" />
[end]
</th>
<th style="width: 96px" class="vc_header"></th>
[if-any sortby_rev_href]
<th class="vc_header[is sortby "rev"]_sort[end]">
<a href="[sortby_rev_href]#dirlist">Last Change</a>
[is sortby "rev"]
<img class="vc_sortarrow" alt="[is sortdir "down"](rev)[end]"
width="13" height="13"
src="[docroot]/images/[is sortdir "up"]up[else]down[end].png" />
[end]
[else]
<th class="vc_header[is sortby "date"]_sort[end]">
[if-any sortby_date_href]<a href="[sortby_date_href]#dirlist">Last Change</a>[else]Last Change[end]
[is sortby "date"]
<img class="vc_sortarrow" alt="[is sortdir "down"](date)[end]"
width="13" height="13"
src="[docroot]/images/[is sortdir "up"]up[else]down[end].png" />
[end]
[end]
</th>
</tr>
</thead>
<tbody>
[if-any up_href]
<tr class="vc_row_odd">
<td style="width: 200px">
<a href="[up_href]">
<img src="[docroot]/images/back_small.png" alt="" class="vc_icon"
/>&nbsp;Parent&nbsp;Directory</a>
</td>
<td style="width: 96px; font-size: 0;"></td>
<td>&nbsp;</td>
</tr>
[end]
[for entries]
<tr class="vc_row_[if-index entries even]even[else]odd[end]">
<td style="width: 200px">
<a name="[entries.anchor]" href="[is entries.pathtype "dir"][entries.view_href][else][if-any entries.prefer_markup][entries.view_href][else][entries.download_href][end][end]" title="[is entries.pathtype "dir"]View Directory Contents[else][if-any entries.prefer_markup]View[else]Download[end] File Contents[end]">
<img src="[docroot]/images/[is entries.pathtype "dir"]dir[else][is entries.state "dead"]broken[else]text[end][end].png" alt="" class="vc_icon" />
[entries.name][is entries.pathtype "dir"]/[end]</a>
[if-any entries.lockinfo]<img src="[docroot]/images/lock.png" alt="locked" class="vc_icon" title="Locked by [entries.lockinfo]" />[end]
[is entries.state "dead"](dead)[end]
</td>
[if-any entries.errors]
<td colspan="2">[for entries.errors]<em>[entries.errors]</em>[end]</td>
[else]
[define view_icon_link][end]
[define graph_icon_link][end]
[define download_icon_link][end]
[define annotate_icon_link][end]
[define log_icon_link][if-any entries.log_href]<a
href="[entries.log_href]"
title="View Log"><img
src="[docroot]/images/log.png"
alt="View Log"
class="vc_icon" /></a>[end][end]
[is entries.pathtype "dir"]
[is roottype "cvs"]
[# no point in showing icon when there's only one to choose from]
[else]
[define view_icon_link]<a
href="[entries.view_href]"
title="View Directory Listing"><img
src="[docroot]/images/list.png"
alt="View Directory Listing"
class="vc_icon" /></a>[end]
[end]
[end]
[is entries.pathtype "file"]
[define view_icon_link][if-any entries.view_href]<a
href="[entries.view_href]"
title="View File"><img
src="[docroot]/images/view.png"
alt="View File"
class="vc_icon" /></a>[end][end]
[define graph_icon_link][if-any entries.graph_href]<a
href="[entries.graph_href]"
title="View Revision Graph"><img
src="[docroot]/images/cvsgraph_16x16.png"
alt="View Revision Graph"
class="vc_icon" /></a>[end][end]
[define download_icon_link][if-any entries.download_href]<a
href="[entries.download_href]"
title="Download File"><img
src="[docroot]/images/download.png"
alt="Download File"
class="vc_icon" /></a>[end][end]
[define annotate_icon_link][if-any entries.annotate_href]<a
href="[entries.annotate_href]"
title="Annotate File"><img
src="[docroot]/images/annotate.png"
alt="Annotate File"
class="vc_icon" /></a>[end][end]
[end]
<td style="width: 96px"
>[# Icon column. We might want to add more icons like a tarball
# icon for directories or a diff to previous icon for files.
# Make sure this sucker has no whitespace in it, or the fixed
# widthness of will suffer for large font sizes
][log_icon_link][view_icon_link][graph_icon_link][download_icon_link][annotate_icon_link]</td>
<td>
[if-any entries.rev]
<strong>[if-any entries.revision_href]<a href="[entries.revision_href]" title="Revision [entries.rev]">[entries.rev]</a>[else][entries.rev][end]</strong>
([entries.ago] ago)
by <em>[entries.author]</em>:
[entries.log]
[is entries.pathtype "dir"][is roottype "cvs"]
<em>(from [entries.log_file]/[entries.log_rev])</em>
[end][end]
[end]
</td>
[end]
</tr>
[end]
</tbody>
</table>
[include "include/dir_footer.ezt"]

116
templates/directory.ezt Normal file
View File

@@ -0,0 +1,116 @@
[include "include/dir_header.ezt"]
<table cellspacing="1" cellpadding="2">
<thead>
<tr>
<th class="vc_header[is sortby "file"]_sort[end]" colspan="2">
[if-any sortby_file_href]<a href="[sortby_file_href]#dirlist">File</a>[else]File[end]
[is sortby "file"]
<img class="vc_sortarrow" alt="[is sortdir "down"](rev)[end]"
width="13" height="13"
src="[docroot]/images/[is sortdir "up"]up[else]down[end].png" />
[end]
</th>
<th class="vc_header[is sortby "rev"]_sort[end]">
[if-any sortby_rev_href]<a href="[sortby_rev_href]#dirlist">Rev.</a>[else]Rev.[end]
[is sortby "rev"]
<img class="vc_sortarrow" alt="[is sortdir "down"](rev)[end]"
width="13" height="13"
src="[docroot]/images/[is sortdir "up"]up[else]down[end].png" />
[end]
</th>
<th class="vc_header[is sortby "date"]_sort[end]">
[if-any sortby_date_href]<a href="[sortby_date_href]#dirlist">Age</a>[else]Age[end]
[is sortby "date"]
<img class="vc_sortarrow" alt="[is sortdir "down"](rev)[end]"
width="13" height="13"
src="[docroot]/images/[is sortdir "up"]up[else]down[end].png" />
[end]
</th>
<th class="vc_header[is sortby "author"]_sort[end]">
[if-any sortby_author_href]<a href="[sortby_author_href]#dirlist">Author</a>[else]Author[end]
[is sortby "author"]
<img class="vc_sortarrow" alt="[is sortdir "down"](rev)[end]"
width="13" height="13"
src="[docroot]/images/[is sortdir "up"]up[else]down[end].png" />
[end]
</th>
[is cfg.options.show_logs "1"]
<th class="vc_header[is sortby "log"]_sort[end]">
[if-any sortby_log_href]<a href="[sortby_log_href]#dirlist">Last log entry</a>[else]Last log entry[end]
[is sortby "log"]
<img class="vc_sortarrow" alt="[is sortdir "down"](rev)[end]"
width="13" height="13"
src="[docroot]/images/[is sortdir "up"]up[else]down[end].png" />
[end]
</th>
[end]
</tr>
</thead>
<tbody>
[if-any up_href]
<tr class="vc_row_odd">
<td colspan="2">
<a href="[up_href]">
<img src="[docroot]/images/back_small.png" alt="" class="vc_icon"
/>&nbsp;Parent&nbsp;Directory</a>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
[is cfg.options.show_logs "1"]
<td>&nbsp;</td>
[end]
</tr>
[end]
[for entries]
<tr class="vc_row_[if-index entries even]even[else]odd[end]">
<td[if-any entries.graph_href][else] colspan="2"[end]>
[is entries.pathtype "dir"]
<a name="[entries.anchor]" href="[entries.view_href]" title="View directory contents">
[else]
<a name="[entries.anchor]" href="[entries.log_href]" title="View file revision log">
[end]
<img src="[docroot]/images/[is entries.pathtype "dir"]dir[else][is entries.state "dead"]broken[else]text[end][end].png" alt="" class="vc_icon" />
[entries.name][is entries.pathtype "dir"]/[end]</a>
[is entries.state "dead"](dead)[end]
</td>
[if-any entries.graph_href]
<td style="width:1%"><a href="[entries.graph_href]"
title="View Revision Graph"><img
src="[docroot]/images/cvsgraph_16x16.png"
alt="View Revision Graph" class="vc_icon" />
</a></td>
[end]
[if-any entries.errors]
<td colspan=[is cfg.options.show_logs "1"]4[else]3[end]>
[for entries.errors]<em>[entries.errors]</em>[end]
</td>
[else]
[is entries.pathtype "dir"]
<td>&nbsp;[if-any entries.rev]<a href="[entries.log_href]" title="View directory revision log"><strong>[entries.rev]</strong></a>[end]</td>
[else]
[define rev_href][if-any entries.prefer_markup][entries.view_href][else][if-any entries.download_href][entries.download_href][end][end][end]
<td style="white-space: nowrap;">&nbsp;[if-any entries.rev][if-any rev_href]<a href="[rev_href]" title="[if-any entries.prefer_markup]View[else]Download[end] file contents">[end]<strong>[entries.rev]</strong>[if-any rev_href]</a>[end][end]
[if-any entries.lockinfo]<img src="[docroot]/images/lock.png" alt="locked" class="vc_icon" title="Locked by [entries.lockinfo]" />[end]
</td>
[end]
<td>&nbsp;[entries.ago]</td>
<td>&nbsp;[entries.author]</td>
[is cfg.options.show_logs "1"]
[if-any entries.short_log]
<td>&nbsp;[entries.short_log][is entries.pathtype "dir"][is roottype "cvs"]
<em>(from [entries.log_file]/[entries.log_rev])</em>[end][end]</td>
[else]
<td>&nbsp;</td>
[end]
[end]
[end]
</tr>
[end]
</tbody>
</table>
[include "include/dir_footer.ezt"]

View File

@@ -0,0 +1,14 @@
/************************************/
/*** ViewVC Help CSS Stylesheet ***/
/************************************/
/*** Standard Tags ***/
body {
margin: 0.5em;
}
img { border: none; }
table { width: 100%; }
td { vertical-align: top; }
col.menu { width:12em; }

View File

@@ -0,0 +1,122 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>ViewVC Help: Directory View</title>
<link rel="stylesheet" href="help.css" type="text/css" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<div><a href="http://viewvc.org/index.html"><img src="images/viewvc-logo.png" alt="ViewVC logotype" /></a></div>
<table>
<col class="menu" />
<col />
<tr><td>
<h3>Help</h3>
<a href="help_rootview.html">General</a><br />
<strong>Directory&nbsp;View</strong><br />
<a href="help_log.html">Log&nbsp;View</a><br />
<a href="help_query.html">Query&nbsp;Database</a><br />
</td><td>
<h1>ViewVC Help: Directory View</h1>
<p>The directory listing view should be a familiar sight to any
computer user. It shows the path of the current directory being viewed
at the top of the page. Below that is a table summarizing the
directory contents, and then comes actual contents, a sortable list of
all files and subdirectories inside the current directory.</p>
<p><a name="summary"></a>The summary table is made up of some or all
of the following rows:</p>
<ul>
<li><a name="summary-files-shown"><strong>Files Shown</strong></a>
- Number of files shown in the directory listing. This might be less
than the actual number of files in the directory if a
<a href="#option-search">regular expression search</a> is in place,
hiding files which don't meet the search criteria. In CVS directory
listings, this row will also have a link to toggle display of
<a href="help_rootview.html#dead-files">dead files</a>, if any are
present.</li>
<li><a name="summary-revision"><strong>Directory
Revision</strong></a> - For Subversion directories only.
Shown as "# of #" where the first number is the most recent
repository revision where the directory (or a path underneath it)
was modified. The second number is just the latest repository
revision. Both numbers are links to
<a href="help_rootview.html#view-rev">revision views</a></li>
<li><a name="summary-sticky-revision-tag"><strong>Sticky
Revision/Tag</strong></a> - shows the current
<a href="help_rootview.html#sticky-revision-tag">sticky revision or
tag</a> and contains form fields to set or clear it.</li>
<li><a name="summary-search"><strong>Current Search</strong></a> -
If a <a href="#option-search">regular expression search</a> is in place,
shows the search string.</li>
<li><a name="summary-query"><strong>Query</strong></a> - Provides
a link to a <a href="help_rootview.html#view-query">query form</a>
for the directory</li>
</ul>
<p><a name="list"></a>The actual directory list is a table with
filenames and directory names in one column and information about the
most recent revisions where each file or directory was modified in the
other columns. Column headers can be clicked to sort the directory
entries in order by a column, and clicked again to reverse the sort
order.</p>
<p>
<!-- If using directory.ezt template -->
File names are links to <a href="help_log.html">log views</a>
showing a list of revisions where a file was modified. Revision
numbers are links to either
<a href="help_rootview.html#view-markup">view</a>
or <a href="help_rootview.html#view-checkout">download</a> a file
(depending on its file type). The links are reversed for directories.
Directory revision numbers are links to <a href="help_log.html">log
views</a>, while directory names are links showing the contents of those
directories.
<!-- If using dir_alt.ezt template -->
<!--
File and directory names are links to retrieve their contents.
File links may be either
<a href="help_rootview.html#view-markup">view</a>
or <a href="help_rootview.html#view-download">download</a> links
depending on the file type. Directory links go to directory
listings. Revision numbers are links to <a href="help_log.html">log
views</a> showing lists of revisions where a file or directory was
modified.
-->
Also, in CVS repositories with the
<a href="help_rootview.html#view-graph">graph view</a> enabled, there
will be small
<img src="images/cvsgraph_16x16.png" width="16" height="16" alt="graph">
icons next to file names which are links to revision graphs.</p>
<p>Depending on how ViewVC is configured, there may be more options
at the bottom of directory pages:</p>
<ul>
<li><a name="option-search"><strong>Regular expression
search</strong></a> - If enabled, will show a form field accepting
a search string (a
<a href="http://doc.python.org/lib/re-syntax.html">python regular
expression</a>). Once submitted, only files that have at least
one occurance of the expression will show up in directory listings.
</li>
<li><a name="option-tarball"><strong>Tarball download</strong></a> -
If enabled, will show a link to download a gzipped tar archive of
the directory contents.</li>
</ul>
</td></tr></table>
<hr />
<address><a href="mailto:users@viewvc.tigris.org">ViewVC Users Mailinglist</a></address>
</body>
</html>

View File

@@ -0,0 +1,66 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>ViewVC Help: Log View</title>
<link rel="stylesheet" href="help.css" type="text/css" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<div><a href="http://viewvc.org/index.html"><img src="images/viewvc-logo.png" alt="ViewVC logotype" /></a></div>
<table>
<col class="menu" />
<col />
<tr><td>
<h3>Help</h3>
<a href="help_rootview.html">General</a><br />
<a href="help_dirview.html">Directory&nbsp;View</a><br />
<strong>Log&nbsp;View</strong><br />
<a href="help_query.html">Query&nbsp;Database</a><br />
</td><td>
<h1>ViewVC Help: Log View</h1>
<p>
The log view displays the revision history of the selected source
file or directory. For each revision the following information is
displayed:
<ul>
<li>The revision number. In Subversion repositories, this is a
link to the <a href="help_rootview.html#view-rev">revision
view</a></li>
<li>For files, links to
<a href="help_rootview.html#view-markup">view</a>,
<a href="help_rootview.html#view-checkout">download</a>, and
<a href="help_rootview.html#view-annotate">annotate</a> the
revision. For directories, a link to
<a href="help_dirview.html">list directory contents</a></li>
<li>A link to select the revision for diffs (see below)</li>
<li>The date and age of the change</li>
<li>The author of the modification</li>
<li>The CVS branch (usually <em>MAIN</em>, if not on a branch)</li>
<li>Possibly a list of CVS tags bound to the revision (if any)</li>
<li>The size of the change measured in added and removed lines of
code. (CVS only)</li>
<li>The size of the file in bytes at the time of the revision
(Subversion only)</li>
<li>Links to view diffs to the previous revision or possibly to
an arbitrary selected revision (if any, see above)</li>
<li>If the revision is the result of a copy, the path and revision
copied from</li>
<li>If the revision precedes a copy or rename, the path at the
time of the revision</li>
<li>And last but not least, the commit log message which should tell
about the reason for the change.</li>
</ul>
<p>
At the bottom of the page you will find a form which allows
to request diffs between arbitrary revisions.
</p>
</td></tr></table>
<hr />
<address><a href="mailto:users@viewvc.tigris.org">ViewVC Users Mailinglist</a></address>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More