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