Commit Graph

918 Commits (50e1e87f71e9436de17050f61058a657842bcb2f)

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