* 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>
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2555 8cb11bc2-c004-0410-86c3-e597b4017df7
Patch by: Craig Leres <leres@tigris.org>
Expanded by: me
The original version of this patch was submitted to cvs2svn issue #141:
http://cvs2svn.tigris.org/issues/show_bug.cgi?id=141
* lib/vclib/ccvs/rcsparse/common.py
(_Parser._parse_rcs_tree_entry): If there is an error when parsing a
CVS timestamp, include the revision number in the exception message.
The calendar.timegm() function is not very picky, but it does emit an
error if the month number is invalid.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2495 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
* 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
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
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
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
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
(_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
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
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
* __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