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