Commit Graph

35 Commits (d25e5e309829eb7ab1d86971465b87c064ca8c68)

Author SHA1 Message Date
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
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
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
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
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 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 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 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 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 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
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
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
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
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
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