2002-04-13 13:43:22 +04:00
|
|
|
# -*-python-*-
|
|
|
|
#
|
2013-01-04 23:01:54 +04:00
|
|
|
# Copyright (C) 1999-2013 The ViewCVS Group. All Rights Reserved.
|
2002-04-13 13:43:22 +04:00
|
|
|
#
|
|
|
|
# By using this file, you agree to the terms and conditions set forth in
|
2005-12-17 20:19:28 +03:00
|
|
|
# the LICENSE.html file which can be found at the top level of the ViewVC
|
|
|
|
# distribution or at http://viewvc.org/license-1.html.
|
2002-04-13 13:43:22 +04:00
|
|
|
#
|
2006-03-18 05:07:36 +03:00
|
|
|
# For more information, visit http://viewvc.org/
|
2002-04-13 13:43:22 +04:00
|
|
|
#
|
|
|
|
# -----------------------------------------------------------------------
|
|
|
|
|
2002-06-03 22:35:06 +04:00
|
|
|
"Version Control lib driver for locally accessible cvs-repositories."
|
2002-04-13 13:43:22 +04:00
|
|
|
|
2002-05-22 02:47:16 +04:00
|
|
|
import vclib
|
2008-02-06 22:22:53 +03:00
|
|
|
import vcauth
|
2002-04-13 13:43:22 +04:00
|
|
|
import os
|
|
|
|
import os.path
|
2003-10-21 18:35:47 +04:00
|
|
|
import sys
|
|
|
|
import stat
|
2002-04-13 13:43:22 +04:00
|
|
|
import re
|
2002-05-22 02:47:16 +04:00
|
|
|
import time
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
import calendar
|
2002-05-22 02:47:16 +04:00
|
|
|
|
2006-03-18 03:33:54 +03:00
|
|
|
# ViewVC libs
|
2002-04-13 13:43:22 +04:00
|
|
|
import popen
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
import vclib.ccvs
|
2002-04-13 13:43:22 +04:00
|
|
|
|
2010-12-03 20:25:34 +03:00
|
|
|
def _path_join(path_parts):
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
return '/'.join(path_parts)
|
|
|
|
|
Merge changes (r1735:1738) from the (misnamed) options-overhaul
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
2007-12-03 18:25:51 +03:00
|
|
|
class BaseCVSRepository(vclib.Repository):
|
2008-02-06 22:22:53 +03:00
|
|
|
def __init__(self, name, rootpath, authorizer, utilities):
|
2004-01-22 06:46:30 +03:00
|
|
|
if not os.path.isdir(rootpath):
|
2008-02-06 22:22:53 +03:00
|
|
|
raise vclib.ReposNotFound(name)
|
|
|
|
|
2004-01-22 06:46:30 +03:00
|
|
|
self.name = name
|
|
|
|
self.rootpath = rootpath
|
2008-02-06 22:22:53 +03:00
|
|
|
self.auth = authorizer
|
2006-07-28 15:04:12 +04:00
|
|
|
self.utilities = utilities
|
2004-01-22 06:46:30 +03:00
|
|
|
|
2008-02-06 22:22:53 +03:00
|
|
|
# See if this repository is even viewable, authz-wise.
|
|
|
|
if not vclib.check_root_access(self):
|
|
|
|
raise vclib.ReposNotFound(name)
|
|
|
|
|
2010-12-09 19:10:04 +03:00
|
|
|
def open(self):
|
|
|
|
# See if a universal read access determination can be made.
|
|
|
|
if self.auth and self.auth.check_universal_access(self.name) == 1:
|
|
|
|
self.auth = None
|
|
|
|
|
Ensure that vclib.Repository objects are aware of their name, path,
and type by forcing them to implement functions which query those
pieces of information.
* lib/vclib/__init__.py
(Repository.rootname, Repository.rootpath, Repository.roottype): New.
* lib/vclib/bincvs/__init__.py
(CVSRepository.rootname, CVSRepository.rootpath,
CVSRepository.roottype): New.
* lib/vclib/svn/__init__.py
(SubversionRepository.rootname, SubversionRepository.rootpath,
SubversionRepository.roottype): New.
* lib/vclib/svn_ra/__init__.py
(SubversionRepository.rootname, SubversionRepository.rootpath,
SubversionRepository.roottype): New.
* lib/viewvc.py
(Request.run_viewvc): Ask the Repository object for its roottype(),
and translate the vclib value into a string. (It would be nice to
use the vclib value throughout the codebase, but not today.)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1654 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-11 00:47:27 +04:00
|
|
|
def rootname(self):
|
|
|
|
return self.name
|
|
|
|
|
|
|
|
def rootpath(self):
|
|
|
|
return self.rootpath
|
|
|
|
|
|
|
|
def roottype(self):
|
|
|
|
return vclib.CVS
|
2008-02-06 22:22:53 +03:00
|
|
|
|
|
|
|
def authorizer(self):
|
|
|
|
return self.auth
|
Ensure that vclib.Repository objects are aware of their name, path,
and type by forcing them to implement functions which query those
pieces of information.
* lib/vclib/__init__.py
(Repository.rootname, Repository.rootpath, Repository.roottype): New.
* lib/vclib/bincvs/__init__.py
(CVSRepository.rootname, CVSRepository.rootpath,
CVSRepository.roottype): New.
* lib/vclib/svn/__init__.py
(SubversionRepository.rootname, SubversionRepository.rootpath,
SubversionRepository.roottype): New.
* lib/vclib/svn_ra/__init__.py
(SubversionRepository.rootname, SubversionRepository.rootpath,
SubversionRepository.roottype): New.
* lib/viewvc.py
(Request.run_viewvc): Ask the Repository object for its roottype(),
and translate the vclib value into a string. (It would be nice to
use the vclib value throughout the codebase, but not today.)
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1654 8cb11bc2-c004-0410-86c3-e597b4017df7
2007-05-11 00:47:27 +04:00
|
|
|
|
Change vclib interface to accept 'rev' parameters wherever it accepts
path parameters so it is possible to use a single Repository object
to request information about any path at any revision.
Note: I wasn't able to test the svn_ra.get_location function because
I only have subversion 1.2.3.
* lib/vclib/__init__.py
(Repository.itemtype, Repository.openfile, Repository.listdir,
Repository.dirlogs, Repository.itemlog, Repository.annotate):
add rev arguments, update docstrings
* lib/vclib/bincvs/__init__.py
(CVSRepository.itemtype, CVSRepository.listdir, BinCVSRepository.openfile,
BinCVSRepository.dirlogs, BinCVSRepository.itemlog):
same
* lib/vclib/ccvs/__init__.py
(CCVSRepository.dirlogs, CCVSRepository.itemlog):
same
* lib/vclib/svn/__init__.py
(SubversionRepository.__init__):
remove rev argument
(get_location, created_rev, _get_history, get_revision_info, _fetch_log,
_get_last_history_rev, get_logs, do_diff,
SubversionRepository.itemtype, SubversionRepository.openfile,
SubversionRepository.listdir, SubversionRepository.dirlogs,
SubversionRepository.itemlog, SubversionRepository.annotate):
add rev arguments, use new _getrev and _getroot functions to handle
all revision string parsing and revision_root creation
(SubversionRepository._getrev, SubversionRepository._getroot):
new functions
* lib/vclib/svn_ra/__init__.py
(_rev2optrev):
accept integers instead of strings, and eliminate head/unspecified
revision handling which is already taken care of by _getrev
(SubversionRepository.__init__):
remove rev argument
(get_location, created_rev, get_revision_info, get_logs,
SubversionRepository.itemtype, SubversionRepository.openfile,
SubversionRepository.listdir, SubversionRepository.dirlogs,
SubversionRepository.itemlog, SubversionRepository.annotate,
SubversionRepository.rawdiff, SubversionRepository._get_dirents):
add rev arguments, use new _getrev function to handle all revision
string parsing
(SubversionRepository._getrev):
new function
* lib/blame.py
(link_includes):
update call to repos.itemtype
* tools/cvsdbadmin
(RecurseUpdate):
update call to repos.listdir
* lib/viewcvs.py
(Request.run_viewcvs):
update calls to SubversionRepository constructors and _strip_suffix
(_strip_suffix):
add rev parameter, remove redundant where parameter
(_repos_pathtype, view_markup, search_files, _get_diff_path_parts,
generate_tarball):
update calls to vclib methods
(nav_path, view_directory, view_log, setup_diff, download_tarball,
view_revision):
explicitly read 'rev' query param instead of relying on
SubversionRepository.rev, and update vclib calls
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1144 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-03 16:23:42 +03:00
|
|
|
def itemtype(self, path_parts, rev):
|
2004-01-22 06:46:30 +03:00
|
|
|
basepath = self._getpath(path_parts)
|
2008-03-04 20:28:30 +03:00
|
|
|
kind = None
|
2004-01-22 06:46:30 +03:00
|
|
|
if os.path.isdir(basepath):
|
2008-02-06 22:22:53 +03:00
|
|
|
kind = vclib.DIR
|
|
|
|
elif os.path.isfile(basepath + ',v'):
|
|
|
|
kind = vclib.FILE
|
|
|
|
else:
|
|
|
|
atticpath = self._getpath(self._atticpath(path_parts))
|
|
|
|
if os.path.isfile(atticpath + ',v'):
|
|
|
|
kind = vclib.FILE
|
|
|
|
if not kind:
|
|
|
|
raise vclib.ItemNotFound(path_parts)
|
|
|
|
if not vclib.check_path_access(self, path_parts, kind, rev):
|
|
|
|
raise vclib.ItemNotFound(path_parts)
|
|
|
|
return kind
|
2004-01-22 06:46:30 +03:00
|
|
|
|
2008-04-10 00:14:33 +04:00
|
|
|
def itemprops(self, path_parts, rev):
|
2008-06-02 22:48:16 +04:00
|
|
|
self.itemtype(path_parts, rev) # does auth-check
|
2008-04-10 00:14:33 +04:00
|
|
|
return {} # CVS doesn't support properties
|
|
|
|
|
Change vclib interface to accept 'rev' parameters wherever it accepts
path parameters so it is possible to use a single Repository object
to request information about any path at any revision.
Note: I wasn't able to test the svn_ra.get_location function because
I only have subversion 1.2.3.
* lib/vclib/__init__.py
(Repository.itemtype, Repository.openfile, Repository.listdir,
Repository.dirlogs, Repository.itemlog, Repository.annotate):
add rev arguments, update docstrings
* lib/vclib/bincvs/__init__.py
(CVSRepository.itemtype, CVSRepository.listdir, BinCVSRepository.openfile,
BinCVSRepository.dirlogs, BinCVSRepository.itemlog):
same
* lib/vclib/ccvs/__init__.py
(CCVSRepository.dirlogs, CCVSRepository.itemlog):
same
* lib/vclib/svn/__init__.py
(SubversionRepository.__init__):
remove rev argument
(get_location, created_rev, _get_history, get_revision_info, _fetch_log,
_get_last_history_rev, get_logs, do_diff,
SubversionRepository.itemtype, SubversionRepository.openfile,
SubversionRepository.listdir, SubversionRepository.dirlogs,
SubversionRepository.itemlog, SubversionRepository.annotate):
add rev arguments, use new _getrev and _getroot functions to handle
all revision string parsing and revision_root creation
(SubversionRepository._getrev, SubversionRepository._getroot):
new functions
* lib/vclib/svn_ra/__init__.py
(_rev2optrev):
accept integers instead of strings, and eliminate head/unspecified
revision handling which is already taken care of by _getrev
(SubversionRepository.__init__):
remove rev argument
(get_location, created_rev, get_revision_info, get_logs,
SubversionRepository.itemtype, SubversionRepository.openfile,
SubversionRepository.listdir, SubversionRepository.dirlogs,
SubversionRepository.itemlog, SubversionRepository.annotate,
SubversionRepository.rawdiff, SubversionRepository._get_dirents):
add rev arguments, use new _getrev function to handle all revision
string parsing
(SubversionRepository._getrev):
new function
* lib/blame.py
(link_includes):
update call to repos.itemtype
* tools/cvsdbadmin
(RecurseUpdate):
update call to repos.listdir
* lib/viewcvs.py
(Request.run_viewcvs):
update calls to SubversionRepository constructors and _strip_suffix
(_strip_suffix):
add rev parameter, remove redundant where parameter
(_repos_pathtype, view_markup, search_files, _get_diff_path_parts,
generate_tarball):
update calls to vclib methods
(nav_path, view_directory, view_log, setup_diff, download_tarball,
view_revision):
explicitly read 'rev' query param instead of relying on
SubversionRepository.rev, and update vclib calls
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1144 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-03 16:23:42 +03:00
|
|
|
def listdir(self, path_parts, rev, options):
|
2008-06-02 22:48:16 +04:00
|
|
|
if self.itemtype(path_parts, rev) != vclib.DIR: # does auth-check
|
|
|
|
raise vclib.Error("Path '%s' is not a directory."
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
% (_path_join(path_parts)))
|
2008-06-02 22:48:16 +04:00
|
|
|
|
2004-01-22 06:46:30 +03:00
|
|
|
# Only RCS files (*,v) and subdirs are returned.
|
|
|
|
data = [ ]
|
|
|
|
full_name = self._getpath(path_parts)
|
|
|
|
for file in os.listdir(full_name):
|
2008-02-06 22:22:53 +03:00
|
|
|
name = None
|
2004-12-03 23:44:56 +03:00
|
|
|
kind, errors = _check_path(os.path.join(full_name, file))
|
2004-01-22 06:46:30 +03:00
|
|
|
if kind == vclib.FILE:
|
|
|
|
if file[-2:] == ',v':
|
2008-02-06 22:22:53 +03:00
|
|
|
name = file[:-2]
|
2004-12-03 23:44:56 +03:00
|
|
|
elif kind == vclib.DIR:
|
|
|
|
if file != 'Attic' and file != 'CVS': # CVS directory is for fileattr
|
2008-02-06 22:22:53 +03:00
|
|
|
name = file
|
2004-12-03 23:44:56 +03:00
|
|
|
else:
|
2008-02-06 22:22:53 +03:00
|
|
|
name = file
|
|
|
|
if not name:
|
|
|
|
continue
|
|
|
|
if vclib.check_path_access(self, path_parts + [name], kind, rev):
|
|
|
|
data.append(CVSDirEntry(name, kind, errors, 0))
|
2004-01-22 06:46:30 +03:00
|
|
|
|
Handle CVS Attic paths transparently in the bincvs module
instead of exposing them to users.
* templates/include/dir_footer.ezt
add link to show dead files
* templates/directory.ezt
remove code for detecting Attic entries,
change (in the attic) caption to (dead)
* lib/viewcvs.py
(Request.run_viewcvs):
handle old Attic URL's by redirecting,
remove unused request.full_name member
(get_up_path, _re_up_attic_path, nav_header_data, generate_tarball,
download_tarball):
remove code for handling Attic directories
(view_markup):
remove unused "full_name" variable
(view_directory):
remove code for handling Attic directories,
replace "no_match" template variable with "num_dead"
(view_log):
update call to get_up_path
(view_annotate, view_cvsgraph_image, view_cvsgraph, view_diff):
use CVSRepository.rcsfile to get path to rcs file
* lib/vclib/bincvs/__init__.py
(CVSRepository.itemtype):
look in Attic for repository files
(CVSRepository.listdir):
remove "cvs_list_attic" option, now always list attic files.
leave "Attic" and "CVS" directories out of returned listing.
(CVSRepository.rcsfile, CVSRepository._atticpath):
new methods
(BinCVSRepository.openfile, BinCVSRepository.filelog):
use CVSRepository.rcsfile to get path to rcs file
(_get_logs):
don't mark directories as dead
* lib/vclib/ccvs/__init__.py
(CCVSRepository.filelog, CCVSRepository.openfile):
use CVSRepository.rcsfile to get path to rcs file
* website/upgrading.html
document "no_match" and "num_dead" template variables
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@908 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-08-01 02:34:51 +04:00
|
|
|
full_name = os.path.join(full_name, 'Attic')
|
|
|
|
if os.path.isdir(full_name):
|
|
|
|
for file in os.listdir(full_name):
|
2008-02-06 22:22:53 +03:00
|
|
|
name = None
|
2004-12-03 23:44:56 +03:00
|
|
|
kind, errors = _check_path(os.path.join(full_name, file))
|
|
|
|
if kind == vclib.FILE:
|
|
|
|
if file[-2:] == ',v':
|
2008-02-06 22:22:53 +03:00
|
|
|
name = file[:-2]
|
2004-12-03 23:44:56 +03:00
|
|
|
elif kind != vclib.DIR:
|
2008-02-06 22:22:53 +03:00
|
|
|
name = file
|
|
|
|
if not name:
|
|
|
|
continue
|
|
|
|
if vclib.check_path_access(self, path_parts + [name], kind, rev):
|
|
|
|
data.append(CVSDirEntry(name, kind, errors, 1))
|
2004-01-22 06:46:30 +03:00
|
|
|
|
|
|
|
return data
|
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 22:25:30 +03:00
|
|
|
|
|
|
|
def _getpath(self, path_parts):
|
|
|
|
return apply(os.path.join, (self.rootpath,) + tuple(path_parts))
|
|
|
|
|
Handle CVS Attic paths transparently in the bincvs module
instead of exposing them to users.
* templates/include/dir_footer.ezt
add link to show dead files
* templates/directory.ezt
remove code for detecting Attic entries,
change (in the attic) caption to (dead)
* lib/viewcvs.py
(Request.run_viewcvs):
handle old Attic URL's by redirecting,
remove unused request.full_name member
(get_up_path, _re_up_attic_path, nav_header_data, generate_tarball,
download_tarball):
remove code for handling Attic directories
(view_markup):
remove unused "full_name" variable
(view_directory):
remove code for handling Attic directories,
replace "no_match" template variable with "num_dead"
(view_log):
update call to get_up_path
(view_annotate, view_cvsgraph_image, view_cvsgraph, view_diff):
use CVSRepository.rcsfile to get path to rcs file
* lib/vclib/bincvs/__init__.py
(CVSRepository.itemtype):
look in Attic for repository files
(CVSRepository.listdir):
remove "cvs_list_attic" option, now always list attic files.
leave "Attic" and "CVS" directories out of returned listing.
(CVSRepository.rcsfile, CVSRepository._atticpath):
new methods
(BinCVSRepository.openfile, BinCVSRepository.filelog):
use CVSRepository.rcsfile to get path to rcs file
(_get_logs):
don't mark directories as dead
* lib/vclib/ccvs/__init__.py
(CCVSRepository.filelog, CCVSRepository.openfile):
use CVSRepository.rcsfile to get path to rcs file
* website/upgrading.html
document "no_match" and "num_dead" template variables
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@908 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-08-01 02:34:51 +04:00
|
|
|
def _atticpath(self, path_parts):
|
|
|
|
return path_parts[:-1] + ['Attic'] + path_parts[-1:]
|
|
|
|
|
|
|
|
def rcsfile(self, path_parts, root=0, v=1):
|
|
|
|
"Return path to RCS file"
|
|
|
|
|
|
|
|
ret_parts = path_parts
|
|
|
|
ret_file = self._getpath(ret_parts)
|
|
|
|
if not os.path.isfile(ret_file + ',v'):
|
|
|
|
ret_parts = self._atticpath(path_parts)
|
|
|
|
ret_file = self._getpath(ret_parts)
|
|
|
|
if not os.path.isfile(ret_file + ',v'):
|
|
|
|
raise vclib.ItemNotFound(path_parts)
|
|
|
|
if root:
|
|
|
|
ret = ret_file
|
|
|
|
else:
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
ret = _path_join(ret_parts)
|
Handle CVS Attic paths transparently in the bincvs module
instead of exposing them to users.
* templates/include/dir_footer.ezt
add link to show dead files
* templates/directory.ezt
remove code for detecting Attic entries,
change (in the attic) caption to (dead)
* lib/viewcvs.py
(Request.run_viewcvs):
handle old Attic URL's by redirecting,
remove unused request.full_name member
(get_up_path, _re_up_attic_path, nav_header_data, generate_tarball,
download_tarball):
remove code for handling Attic directories
(view_markup):
remove unused "full_name" variable
(view_directory):
remove code for handling Attic directories,
replace "no_match" template variable with "num_dead"
(view_log):
update call to get_up_path
(view_annotate, view_cvsgraph_image, view_cvsgraph, view_diff):
use CVSRepository.rcsfile to get path to rcs file
* lib/vclib/bincvs/__init__.py
(CVSRepository.itemtype):
look in Attic for repository files
(CVSRepository.listdir):
remove "cvs_list_attic" option, now always list attic files.
leave "Attic" and "CVS" directories out of returned listing.
(CVSRepository.rcsfile, CVSRepository._atticpath):
new methods
(BinCVSRepository.openfile, BinCVSRepository.filelog):
use CVSRepository.rcsfile to get path to rcs file
(_get_logs):
don't mark directories as dead
* lib/vclib/ccvs/__init__.py
(CCVSRepository.filelog, CCVSRepository.openfile):
use CVSRepository.rcsfile to get path to rcs file
* website/upgrading.html
document "no_match" and "num_dead" template variables
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@908 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-08-01 02:34:51 +04:00
|
|
|
if v:
|
|
|
|
ret = ret + ",v"
|
|
|
|
return ret
|
|
|
|
|
2008-06-03 21:02:55 +04:00
|
|
|
def isexecutable(self, path_parts, rev):
|
|
|
|
if self.itemtype(path_parts, rev) != vclib.FILE: # does auth-check
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
raise vclib.Error("Path '%s' is not a file." % (_path_join(path_parts)))
|
2008-06-03 21:02:55 +04:00
|
|
|
rcsfile = self.rcsfile(path_parts, 1)
|
|
|
|
return os.access(rcsfile, os.X_OK)
|
|
|
|
|
|
|
|
|
Merge changes (r1735:1738) from the (misnamed) options-overhaul
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
2007-12-03 18:25:51 +03:00
|
|
|
class BinCVSRepository(BaseCVSRepository):
|
2005-10-04 00:57:12 +04:00
|
|
|
def _get_tip_revision(self, rcs_file, rev=None):
|
|
|
|
"""Get the (basically) youngest revision (filtered by REV)."""
|
|
|
|
args = rcs_file,
|
|
|
|
fp = self.rcs_popen('rlog', args, 'rt', 0)
|
2008-02-12 22:41:19 +03:00
|
|
|
filename, default_branch, tags, lockinfo, msg, eof = _parse_log_header(fp)
|
2005-10-04 00:57:12 +04:00
|
|
|
revs = []
|
|
|
|
while not eof:
|
|
|
|
revision, eof = _parse_log_entry(fp)
|
|
|
|
if revision:
|
|
|
|
revs.append(revision)
|
2008-02-12 22:41:19 +03:00
|
|
|
revs = _file_log(revs, tags, lockinfo, default_branch, rev)
|
2005-10-04 00:57:12 +04:00
|
|
|
if revs:
|
|
|
|
return revs[-1]
|
|
|
|
return None
|
|
|
|
|
2011-04-01 20:59:11 +04:00
|
|
|
def openfile(self, path_parts, rev, options):
|
|
|
|
"""see vclib.Repository.openfile docstring
|
|
|
|
|
|
|
|
Option values recognized by this implementation:
|
|
|
|
|
|
|
|
cvs_oldkeywords
|
|
|
|
boolean. true to use the original keyword substitution values.
|
|
|
|
"""
|
2008-06-02 22:48:16 +04:00
|
|
|
if self.itemtype(path_parts, rev) != vclib.FILE: # does auth-check
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
raise vclib.Error("Path '%s' is not a file." % (_path_join(path_parts)))
|
2004-01-22 06:46:30 +03:00
|
|
|
if not rev or rev == 'HEAD' or rev == 'MAIN':
|
|
|
|
rev_flag = '-p'
|
|
|
|
else:
|
|
|
|
rev_flag = '-p' + rev
|
2011-04-01 20:59:11 +04:00
|
|
|
if options.get('cvs_oldkeywords', 0):
|
|
|
|
kv_flag = '-ko'
|
|
|
|
else:
|
|
|
|
kv_flag = '-kkv'
|
Handle CVS Attic paths transparently in the bincvs module
instead of exposing them to users.
* templates/include/dir_footer.ezt
add link to show dead files
* templates/directory.ezt
remove code for detecting Attic entries,
change (in the attic) caption to (dead)
* lib/viewcvs.py
(Request.run_viewcvs):
handle old Attic URL's by redirecting,
remove unused request.full_name member
(get_up_path, _re_up_attic_path, nav_header_data, generate_tarball,
download_tarball):
remove code for handling Attic directories
(view_markup):
remove unused "full_name" variable
(view_directory):
remove code for handling Attic directories,
replace "no_match" template variable with "num_dead"
(view_log):
update call to get_up_path
(view_annotate, view_cvsgraph_image, view_cvsgraph, view_diff):
use CVSRepository.rcsfile to get path to rcs file
* lib/vclib/bincvs/__init__.py
(CVSRepository.itemtype):
look in Attic for repository files
(CVSRepository.listdir):
remove "cvs_list_attic" option, now always list attic files.
leave "Attic" and "CVS" directories out of returned listing.
(CVSRepository.rcsfile, CVSRepository._atticpath):
new methods
(BinCVSRepository.openfile, BinCVSRepository.filelog):
use CVSRepository.rcsfile to get path to rcs file
(_get_logs):
don't mark directories as dead
* lib/vclib/ccvs/__init__.py
(CCVSRepository.filelog, CCVSRepository.openfile):
use CVSRepository.rcsfile to get path to rcs file
* website/upgrading.html
document "no_match" and "num_dead" template variables
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@908 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-08-01 02:34:51 +04:00
|
|
|
full_name = self.rcsfile(path_parts, root=1, v=0)
|
2005-10-04 00:57:12 +04:00
|
|
|
used_rlog = 0
|
|
|
|
tip_rev = None # used only if we have to fallback to using rlog
|
2011-04-01 20:59:11 +04:00
|
|
|
fp = self.rcs_popen('co', (kv_flag, rev_flag, full_name), 'rb')
|
2005-10-04 00:57:12 +04:00
|
|
|
try:
|
|
|
|
filename, revision = _parse_co_header(fp)
|
|
|
|
except COMissingRevision:
|
|
|
|
# We got a "revision X.Y.Z absent" error from co. This could be
|
|
|
|
# because we were asked to find a tip of a branch, which co
|
|
|
|
# doesn't seem to handle. So we do rlog-gy stuff to figure out
|
|
|
|
# which revision the tip of the branch currently maps to.
|
|
|
|
### TODO: Only do this when 'rev' is a branch symbol name?
|
|
|
|
if not used_rlog:
|
|
|
|
tip_rev = self._get_tip_revision(full_name + ',v', rev)
|
|
|
|
used_rlog = 1
|
|
|
|
if not tip_rev:
|
|
|
|
raise vclib.Error("Unable to find valid revision")
|
|
|
|
fp = self.rcs_popen('co', ('-p' + tip_rev.string, full_name), 'rb')
|
|
|
|
filename, revision = _parse_co_header(fp)
|
|
|
|
|
2004-01-22 06:46:30 +03:00
|
|
|
if filename is None:
|
|
|
|
# CVSNT's co exits without any output if a dead revision is requested.
|
|
|
|
# Bug at http://www.cvsnt.org/cgi-bin/bugzilla/show_bug.cgi?id=190
|
|
|
|
# As a workaround, we invoke rlog to find the first non-dead revision
|
2005-10-04 00:57:12 +04:00
|
|
|
# that precedes it and check out that revision instead. Of course,
|
|
|
|
# if we've already invoked rlog above, we just reuse its output.
|
|
|
|
if not used_rlog:
|
|
|
|
tip_rev = self._get_tip_revision(full_name + ',v', rev)
|
|
|
|
used_rlog = 1
|
|
|
|
if not (tip_rev and tip_rev.undead):
|
|
|
|
raise vclib.Error(
|
|
|
|
'Could not find non-dead revision preceding "%s"' % rev)
|
|
|
|
fp = self.rcs_popen('co', ('-p' + tip_rev.undead.string,
|
|
|
|
full_name), 'rb')
|
|
|
|
filename, revision = _parse_co_header(fp)
|
2004-01-22 06:46:30 +03:00
|
|
|
|
|
|
|
if filename is None:
|
2005-10-04 00:57:12 +04:00
|
|
|
raise vclib.Error('Missing output from co (filename = "%s")' % full_name)
|
2004-01-22 06:46:30 +03:00
|
|
|
|
2004-10-14 06:00:34 +04:00
|
|
|
if not _paths_eq(filename, full_name):
|
2004-01-22 06:46:30 +03:00
|
|
|
raise vclib.Error(
|
2005-10-04 00:57:12 +04:00
|
|
|
'The filename from co ("%s") did not match (expected "%s")'
|
2004-06-06 06:46:49 +04:00
|
|
|
% (filename, full_name))
|
2004-01-22 06:46:30 +03:00
|
|
|
|
|
|
|
return fp, revision
|
|
|
|
|
Change vclib interface to accept 'rev' parameters wherever it accepts
path parameters so it is possible to use a single Repository object
to request information about any path at any revision.
Note: I wasn't able to test the svn_ra.get_location function because
I only have subversion 1.2.3.
* lib/vclib/__init__.py
(Repository.itemtype, Repository.openfile, Repository.listdir,
Repository.dirlogs, Repository.itemlog, Repository.annotate):
add rev arguments, update docstrings
* lib/vclib/bincvs/__init__.py
(CVSRepository.itemtype, CVSRepository.listdir, BinCVSRepository.openfile,
BinCVSRepository.dirlogs, BinCVSRepository.itemlog):
same
* lib/vclib/ccvs/__init__.py
(CCVSRepository.dirlogs, CCVSRepository.itemlog):
same
* lib/vclib/svn/__init__.py
(SubversionRepository.__init__):
remove rev argument
(get_location, created_rev, _get_history, get_revision_info, _fetch_log,
_get_last_history_rev, get_logs, do_diff,
SubversionRepository.itemtype, SubversionRepository.openfile,
SubversionRepository.listdir, SubversionRepository.dirlogs,
SubversionRepository.itemlog, SubversionRepository.annotate):
add rev arguments, use new _getrev and _getroot functions to handle
all revision string parsing and revision_root creation
(SubversionRepository._getrev, SubversionRepository._getroot):
new functions
* lib/vclib/svn_ra/__init__.py
(_rev2optrev):
accept integers instead of strings, and eliminate head/unspecified
revision handling which is already taken care of by _getrev
(SubversionRepository.__init__):
remove rev argument
(get_location, created_rev, get_revision_info, get_logs,
SubversionRepository.itemtype, SubversionRepository.openfile,
SubversionRepository.listdir, SubversionRepository.dirlogs,
SubversionRepository.itemlog, SubversionRepository.annotate,
SubversionRepository.rawdiff, SubversionRepository._get_dirents):
add rev arguments, use new _getrev function to handle all revision
string parsing
(SubversionRepository._getrev):
new function
* lib/blame.py
(link_includes):
update call to repos.itemtype
* tools/cvsdbadmin
(RecurseUpdate):
update call to repos.listdir
* lib/viewcvs.py
(Request.run_viewcvs):
update calls to SubversionRepository constructors and _strip_suffix
(_strip_suffix):
add rev parameter, remove redundant where parameter
(_repos_pathtype, view_markup, search_files, _get_diff_path_parts,
generate_tarball):
update calls to vclib methods
(nav_path, view_directory, view_log, setup_diff, download_tarball,
view_revision):
explicitly read 'rev' query param instead of relying on
SubversionRepository.rev, and update vclib calls
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1144 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-03 16:23:42 +03:00
|
|
|
def dirlogs(self, path_parts, rev, entries, options):
|
2004-01-25 21:37:42 +03:00
|
|
|
"""see vclib.Repository.dirlogs docstring
|
|
|
|
|
Change vclib interface to accept 'rev' parameters wherever it accepts
path parameters so it is possible to use a single Repository object
to request information about any path at any revision.
Note: I wasn't able to test the svn_ra.get_location function because
I only have subversion 1.2.3.
* lib/vclib/__init__.py
(Repository.itemtype, Repository.openfile, Repository.listdir,
Repository.dirlogs, Repository.itemlog, Repository.annotate):
add rev arguments, update docstrings
* lib/vclib/bincvs/__init__.py
(CVSRepository.itemtype, CVSRepository.listdir, BinCVSRepository.openfile,
BinCVSRepository.dirlogs, BinCVSRepository.itemlog):
same
* lib/vclib/ccvs/__init__.py
(CCVSRepository.dirlogs, CCVSRepository.itemlog):
same
* lib/vclib/svn/__init__.py
(SubversionRepository.__init__):
remove rev argument
(get_location, created_rev, _get_history, get_revision_info, _fetch_log,
_get_last_history_rev, get_logs, do_diff,
SubversionRepository.itemtype, SubversionRepository.openfile,
SubversionRepository.listdir, SubversionRepository.dirlogs,
SubversionRepository.itemlog, SubversionRepository.annotate):
add rev arguments, use new _getrev and _getroot functions to handle
all revision string parsing and revision_root creation
(SubversionRepository._getrev, SubversionRepository._getroot):
new functions
* lib/vclib/svn_ra/__init__.py
(_rev2optrev):
accept integers instead of strings, and eliminate head/unspecified
revision handling which is already taken care of by _getrev
(SubversionRepository.__init__):
remove rev argument
(get_location, created_rev, get_revision_info, get_logs,
SubversionRepository.itemtype, SubversionRepository.openfile,
SubversionRepository.listdir, SubversionRepository.dirlogs,
SubversionRepository.itemlog, SubversionRepository.annotate,
SubversionRepository.rawdiff, SubversionRepository._get_dirents):
add rev arguments, use new _getrev function to handle all revision
string parsing
(SubversionRepository._getrev):
new function
* lib/blame.py
(link_includes):
update call to repos.itemtype
* tools/cvsdbadmin
(RecurseUpdate):
update call to repos.listdir
* lib/viewcvs.py
(Request.run_viewcvs):
update calls to SubversionRepository constructors and _strip_suffix
(_strip_suffix):
add rev parameter, remove redundant where parameter
(_repos_pathtype, view_markup, search_files, _get_diff_path_parts,
generate_tarball):
update calls to vclib methods
(nav_path, view_directory, view_log, setup_diff, download_tarball,
view_revision):
explicitly read 'rev' query param instead of relying on
SubversionRepository.rev, and update vclib calls
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1144 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-03 16:23:42 +03:00
|
|
|
rev can be a tag name or None. if set only information from revisions
|
|
|
|
matching the tag will be retrieved
|
|
|
|
|
2004-01-25 21:37:42 +03:00
|
|
|
Option values recognized by this implementation:
|
|
|
|
|
|
|
|
cvs_subdirs
|
|
|
|
boolean. true to fetch logs of the most recently modified file in each
|
|
|
|
subdirectory
|
|
|
|
|
|
|
|
Option values returned by this implementation:
|
|
|
|
|
|
|
|
cvs_tags, cvs_branches
|
|
|
|
lists of tag and branch names encountered in the directory
|
|
|
|
"""
|
2008-06-02 22:48:16 +04:00
|
|
|
if self.itemtype(path_parts, rev) != vclib.DIR: # does auth-check
|
|
|
|
raise vclib.Error("Path '%s' is not a directory."
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
% (_path_join(path_parts)))
|
2004-01-25 21:37:42 +03:00
|
|
|
|
2008-06-02 22:48:16 +04:00
|
|
|
subdirs = options.get('cvs_subdirs', 0)
|
2008-02-06 22:22:53 +03:00
|
|
|
entries_to_fetch = []
|
|
|
|
for entry in entries:
|
|
|
|
if vclib.check_path_access(self, path_parts + [entry.name], None, rev):
|
|
|
|
entries_to_fetch.append(entry)
|
|
|
|
alltags = _get_logs(self, path_parts, entries_to_fetch, rev, subdirs)
|
2004-01-25 21:37:42 +03:00
|
|
|
branches = options['cvs_branches'] = []
|
|
|
|
tags = options['cvs_tags'] = []
|
|
|
|
for name, rev in alltags.items():
|
|
|
|
if Tag(None, rev).is_branch:
|
|
|
|
branches.append(name)
|
|
|
|
else:
|
|
|
|
tags.append(name)
|
|
|
|
|
2008-04-15 22:17:02 +04:00
|
|
|
def itemlog(self, path_parts, rev, sortby, first, limit, options):
|
2005-04-09 02:57:02 +04:00
|
|
|
"""see vclib.Repository.itemlog docstring
|
2004-01-25 21:37:42 +03:00
|
|
|
|
Change vclib interface to accept 'rev' parameters wherever it accepts
path parameters so it is possible to use a single Repository object
to request information about any path at any revision.
Note: I wasn't able to test the svn_ra.get_location function because
I only have subversion 1.2.3.
* lib/vclib/__init__.py
(Repository.itemtype, Repository.openfile, Repository.listdir,
Repository.dirlogs, Repository.itemlog, Repository.annotate):
add rev arguments, update docstrings
* lib/vclib/bincvs/__init__.py
(CVSRepository.itemtype, CVSRepository.listdir, BinCVSRepository.openfile,
BinCVSRepository.dirlogs, BinCVSRepository.itemlog):
same
* lib/vclib/ccvs/__init__.py
(CCVSRepository.dirlogs, CCVSRepository.itemlog):
same
* lib/vclib/svn/__init__.py
(SubversionRepository.__init__):
remove rev argument
(get_location, created_rev, _get_history, get_revision_info, _fetch_log,
_get_last_history_rev, get_logs, do_diff,
SubversionRepository.itemtype, SubversionRepository.openfile,
SubversionRepository.listdir, SubversionRepository.dirlogs,
SubversionRepository.itemlog, SubversionRepository.annotate):
add rev arguments, use new _getrev and _getroot functions to handle
all revision string parsing and revision_root creation
(SubversionRepository._getrev, SubversionRepository._getroot):
new functions
* lib/vclib/svn_ra/__init__.py
(_rev2optrev):
accept integers instead of strings, and eliminate head/unspecified
revision handling which is already taken care of by _getrev
(SubversionRepository.__init__):
remove rev argument
(get_location, created_rev, get_revision_info, get_logs,
SubversionRepository.itemtype, SubversionRepository.openfile,
SubversionRepository.listdir, SubversionRepository.dirlogs,
SubversionRepository.itemlog, SubversionRepository.annotate,
SubversionRepository.rawdiff, SubversionRepository._get_dirents):
add rev arguments, use new _getrev function to handle all revision
string parsing
(SubversionRepository._getrev):
new function
* lib/blame.py
(link_includes):
update call to repos.itemtype
* tools/cvsdbadmin
(RecurseUpdate):
update call to repos.listdir
* lib/viewcvs.py
(Request.run_viewcvs):
update calls to SubversionRepository constructors and _strip_suffix
(_strip_suffix):
add rev parameter, remove redundant where parameter
(_repos_pathtype, view_markup, search_files, _get_diff_path_parts,
generate_tarball):
update calls to vclib methods
(nav_path, view_directory, view_log, setup_diff, download_tarball,
view_revision):
explicitly read 'rev' query param instead of relying on
SubversionRepository.rev, and update vclib calls
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1144 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-03 16:23:42 +03:00
|
|
|
rev parameter can be a revision number, a branch number, a tag name,
|
|
|
|
or None. If None, will return information about all revisions, otherwise,
|
|
|
|
will only return information about the specified revision or branch.
|
2004-01-25 21:37:42 +03:00
|
|
|
|
Get rid of rlog module, make CVSdb use bincvs instead.
* lib/rlog.py
deleted
* lib/cvsdb.py
(RLogDataToCommitList):
removed
(GetCommitListFromRCSFile):
change to use vclib instead of rlog module
(GetCommitListFromRCSFile, GetUnrecordedCommitList):
update to accept vclib-style path_parts arguments
* lib/vclib/bincvs/__init__.py
(BinCVSRepository.filelog):
accept "cvs_pass_rev" option for passing -r arguments to rlog
(_match_revs_tags):
make this function work with an incomplete list of revisions
instead of crashing. This is neccessary when an -r argument
is passed to rlog.
(_add_tag):
make this function work when we need to create a tag with no
revision object. We need this to create a HEAD tag when an -r
argument is passed to rlog and we don't know what the HEAD
revision is.
(fetch_log):
removed
* tools/cvsdbadmin
(RebuildFile):
removed, merged into UpdateFile
(UpdateFile)
accept new argument to reinsert all commits
(RecurseRebuild):
removed, merged into RecurseUpdate
(RecurseUpdate):
update to use vclib's listdir instead of os.listdir
(CommandRebuild, CommandUpdate):
removed, code moved into __main__ section
* tools/loginfo-handler
(FileData, CommitFromFileData, GetUnrecordedCommitList):
removed, these were just wrappers over the cvsdb interface
(HeuristicArgParse, CvsNtArgParse)
return tuples describing file data instead of file data objects
(ProcessLoginfo):
update to use cvsdb interface
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@953 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-16 06:23:23 +04:00
|
|
|
Option values recognized by this implementation:
|
|
|
|
|
|
|
|
cvs_pass_rev
|
|
|
|
boolean, default false. set to true to pass rev parameter as -r
|
|
|
|
argument to rlog, this is more efficient but causes less
|
|
|
|
information to be returned
|
|
|
|
|
2004-01-25 21:37:42 +03:00
|
|
|
Option values returned by this implementation:
|
|
|
|
|
|
|
|
cvs_tags
|
|
|
|
dictionary of Tag objects for all tags encountered
|
|
|
|
"""
|
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 22:25:30 +03:00
|
|
|
|
2008-06-02 22:48:16 +04:00
|
|
|
if self.itemtype(path_parts, rev) != vclib.FILE: # does auth-check
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
raise vclib.Error("Path '%s' is not a file." % (_path_join(path_parts)))
|
2008-02-06 22:22:53 +03:00
|
|
|
|
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 22:25:30 +03:00
|
|
|
# Invoke rlog
|
Get rid of rlog module, make CVSdb use bincvs instead.
* lib/rlog.py
deleted
* lib/cvsdb.py
(RLogDataToCommitList):
removed
(GetCommitListFromRCSFile):
change to use vclib instead of rlog module
(GetCommitListFromRCSFile, GetUnrecordedCommitList):
update to accept vclib-style path_parts arguments
* lib/vclib/bincvs/__init__.py
(BinCVSRepository.filelog):
accept "cvs_pass_rev" option for passing -r arguments to rlog
(_match_revs_tags):
make this function work with an incomplete list of revisions
instead of crashing. This is neccessary when an -r argument
is passed to rlog.
(_add_tag):
make this function work when we need to create a tag with no
revision object. We need this to create a HEAD tag when an -r
argument is passed to rlog and we don't know what the HEAD
revision is.
(fetch_log):
removed
* tools/cvsdbadmin
(RebuildFile):
removed, merged into UpdateFile
(UpdateFile)
accept new argument to reinsert all commits
(RecurseRebuild):
removed, merged into RecurseUpdate
(RecurseUpdate):
update to use vclib's listdir instead of os.listdir
(CommandRebuild, CommandUpdate):
removed, code moved into __main__ section
* tools/loginfo-handler
(FileData, CommitFromFileData, GetUnrecordedCommitList):
removed, these were just wrappers over the cvsdb interface
(HeuristicArgParse, CvsNtArgParse)
return tuples describing file data instead of file data objects
(ProcessLoginfo):
update to use cvsdb interface
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@953 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-16 06:23:23 +04:00
|
|
|
rcsfile = self.rcsfile(path_parts, 1)
|
|
|
|
if rev and options.get('cvs_pass_rev', 0):
|
|
|
|
args = '-r' + rev, rcsfile
|
|
|
|
else:
|
|
|
|
args = rcsfile,
|
|
|
|
|
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 22:25:30 +03:00
|
|
|
fp = self.rcs_popen('rlog', args, 'rt', 0)
|
2008-02-12 22:41:19 +03:00
|
|
|
filename, default_branch, tags, lockinfo, msg, eof = _parse_log_header(fp)
|
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 22:25:30 +03:00
|
|
|
|
|
|
|
# Retrieve revision objects
|
|
|
|
revs = []
|
|
|
|
while not eof:
|
|
|
|
revision, eof = _parse_log_entry(fp)
|
|
|
|
if revision:
|
|
|
|
revs.append(revision)
|
|
|
|
|
2008-02-12 22:41:19 +03:00
|
|
|
filtered_revs = _file_log(revs, tags, lockinfo, default_branch, rev)
|
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 22:25:30 +03:00
|
|
|
|
2004-01-25 21:37:42 +03:00
|
|
|
options['cvs_tags'] = tags
|
2008-04-15 22:17:02 +04:00
|
|
|
if sortby == vclib.SORTBY_DATE:
|
|
|
|
filtered_revs.sort(_logsort_date_cmp)
|
|
|
|
elif sortby == vclib.SORTBY_REV:
|
|
|
|
filtered_revs.sort(_logsort_rev_cmp)
|
|
|
|
|
|
|
|
if len(filtered_revs) < first:
|
|
|
|
return []
|
|
|
|
if limit:
|
|
|
|
return filtered_revs[first:first+limit]
|
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 22:25:30 +03:00
|
|
|
return filtered_revs
|
2004-01-25 21:37:42 +03:00
|
|
|
|
2004-01-22 06:46:30 +03:00
|
|
|
def rcs_popen(self, rcs_cmd, rcs_args, mode, capture_err=1):
|
2006-07-28 15:04:12 +04:00
|
|
|
if self.utilities.cvsnt:
|
|
|
|
cmd = self.utilities.cvsnt
|
2004-01-22 06:46:30 +03:00
|
|
|
args = ['rcsfile', rcs_cmd]
|
2005-08-22 22:41:59 +04:00
|
|
|
args.extend(list(rcs_args))
|
2004-01-22 06:46:30 +03:00
|
|
|
else:
|
2006-07-28 15:04:12 +04:00
|
|
|
cmd = os.path.join(self.utilities.rcs_dir, rcs_cmd)
|
2004-01-22 06:46:30 +03:00
|
|
|
args = rcs_args
|
|
|
|
return popen.popen(cmd, args, mode, capture_err)
|
|
|
|
|
2011-12-05 23:58:38 +04:00
|
|
|
def annotate(self, path_parts, rev=None, include_text=False):
|
2008-06-02 22:48:16 +04:00
|
|
|
if self.itemtype(path_parts, rev) != vclib.FILE: # does auth-check
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
raise vclib.Error("Path '%s' is not a file." % (_path_join(path_parts)))
|
2008-06-02 22:48:16 +04:00
|
|
|
|
2005-09-23 22:51:35 +04:00
|
|
|
from vclib.ccvs import blame
|
2011-12-05 23:58:38 +04:00
|
|
|
source = blame.BlameSource(self.rcsfile(path_parts, 1), rev, include_text)
|
2005-09-23 22:51:35 +04:00
|
|
|
return source, source.revision
|
|
|
|
|
2007-06-27 20:41:03 +04:00
|
|
|
def revinfo(self, rev):
|
|
|
|
raise vclib.UnsupportedFeature
|
|
|
|
|
2005-09-26 20:07:17 +04:00
|
|
|
def rawdiff(self, path_parts1, rev1, path_parts2, rev2, type, options={}):
|
2005-08-23 00:07:02 +04:00
|
|
|
"""see vclib.Repository.rawdiff docstring
|
|
|
|
|
|
|
|
Option values recognized by this implementation:
|
|
|
|
|
|
|
|
ignore_keyword_subst - boolean, ignore keyword substitution
|
|
|
|
"""
|
2008-06-02 22:48:16 +04:00
|
|
|
if self.itemtype(path_parts1, rev1) != vclib.FILE: # does auth-check
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
raise vclib.Error("Path '%s' is not a file." % (_path_join(path_parts1)))
|
2008-06-02 22:48:16 +04:00
|
|
|
if self.itemtype(path_parts2, rev2) != vclib.FILE: # does auth-check
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
raise vclib.Error("Path '%s' is not a file." % (_path_join(path_parts2)))
|
2008-02-06 22:22:53 +03:00
|
|
|
|
2005-08-23 00:07:02 +04:00
|
|
|
args = vclib._diff_args(type, options)
|
|
|
|
if options.get('ignore_keyword_subst', 0):
|
|
|
|
args.append('-kk')
|
|
|
|
|
2005-09-26 20:07:17 +04:00
|
|
|
rcsfile = self.rcsfile(path_parts1, 1)
|
|
|
|
if path_parts1 != path_parts2:
|
2005-08-23 00:07:02 +04:00
|
|
|
raise NotImplementedError, "cannot diff across paths in cvs"
|
|
|
|
args.extend(['-r' + rev1, '-r' + rev2, rcsfile])
|
2005-09-20 19:06:52 +04:00
|
|
|
|
|
|
|
fp = self.rcs_popen('rcsdiff', args, 'rt')
|
|
|
|
|
2005-11-22 19:32:59 +03:00
|
|
|
# Eat up the non-GNU-diff-y headers.
|
|
|
|
while 1:
|
2005-09-20 19:06:52 +04:00
|
|
|
line = fp.readline()
|
2005-11-22 19:32:59 +03:00
|
|
|
if not line or line[0:5] == 'diff ':
|
|
|
|
break
|
2005-09-20 19:06:52 +04:00
|
|
|
return fp
|
|
|
|
|
2005-08-23 00:07:02 +04:00
|
|
|
|
2004-01-22 06:46:30 +03:00
|
|
|
class CVSDirEntry(vclib.DirEntry):
|
2008-08-21 17:37:46 +04:00
|
|
|
def __init__(self, name, kind, errors, in_attic, absent=0):
|
2004-12-03 23:44:56 +03:00
|
|
|
vclib.DirEntry.__init__(self, name, kind, errors)
|
2004-01-22 06:46:30 +03:00
|
|
|
self.in_attic = in_attic
|
2008-08-21 17:37:46 +04:00
|
|
|
self.absent = absent # meaning, no revisions found on requested tag
|
2004-01-22 06:46:30 +03:00
|
|
|
|
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 22:05:08 +03:00
|
|
|
class Revision(vclib.Revision):
|
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 22:25:30 +03:00
|
|
|
def __init__(self, revstr, date=None, author=None, dead=None,
|
|
|
|
changed=None, log=None):
|
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 22:05:08 +03:00
|
|
|
vclib.Revision.__init__(self, _revision_tuple(revstr), revstr,
|
2008-02-13 00:06:40 +03:00
|
|
|
date, author, changed, log, None, None)
|
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 22:05:08 +03:00
|
|
|
self.dead = dead
|
2002-05-22 02:47:16 +04:00
|
|
|
|
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 03:50:17 +03:00
|
|
|
class Tag:
|
|
|
|
def __init__(self, name, revstr):
|
|
|
|
self.name = name
|
|
|
|
self.number = _tag_tuple(revstr)
|
|
|
|
self.is_branch = len(self.number) % 2 == 1 or not self.number
|
2002-06-03 22:35:06 +04:00
|
|
|
|
2004-01-22 06:46:30 +03:00
|
|
|
|
|
|
|
# ======================================================================
|
|
|
|
# Functions for dealing with Revision and Tag objects
|
|
|
|
|
2008-04-15 22:17:02 +04:00
|
|
|
def _logsort_date_cmp(rev1, rev2):
|
|
|
|
# sort on date; secondary on revision number
|
|
|
|
return -cmp(rev1.date, rev2.date) or -cmp(rev1.number, rev2.number)
|
|
|
|
|
|
|
|
def _logsort_rev_cmp(rev1, rev2):
|
|
|
|
# sort highest revision first
|
|
|
|
return -cmp(rev1.number, rev2.number)
|
|
|
|
|
2004-01-25 22:06:53 +03:00
|
|
|
def _match_revs_tags(revlist, taglist):
|
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 03:50:17 +03:00
|
|
|
"""Match up a list of Revision objects with a list of Tag objects
|
2002-05-22 02:47:16 +04:00
|
|
|
|
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 03:50:17 +03:00
|
|
|
Sets the following properties on each Revision in revlist:
|
|
|
|
"tags"
|
|
|
|
list of non-branch tags which refer to this revision
|
|
|
|
example: if revision is 1.2.3.4, tags is a list of all 1.2.3.4 tags
|
2002-04-13 13:43:22 +04:00
|
|
|
|
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 03:50:17 +03:00
|
|
|
"branches"
|
|
|
|
list of branch tags which refer to this revision's branch
|
|
|
|
example: if revision is 1.2.3.4, branches is a list of all 1.2.3 tags
|
2002-04-13 13:43:22 +04:00
|
|
|
|
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 03:50:17 +03:00
|
|
|
"branch_points"
|
|
|
|
list of branch tags which branch off of this revision
|
|
|
|
example: if revision is 1.2, it's a list of tags like 1.2.3 and 1.2.4
|
2002-04-13 13:43:22 +04:00
|
|
|
|
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 03:50:17 +03:00
|
|
|
"prev"
|
|
|
|
reference to the previous revision, possibly None
|
|
|
|
example: if revision is 1.2.3.4, prev is 1.2.3.3
|
2002-06-03 22:35:06 +04:00
|
|
|
|
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 03:50:17 +03:00
|
|
|
"next"
|
|
|
|
reference to next revision, possibly None
|
|
|
|
example: if revision is 1.2.3.4, next is 1.2.3.5
|
2002-06-03 22:35:06 +04:00
|
|
|
|
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 03:50:17 +03:00
|
|
|
"parent"
|
|
|
|
reference to revision this one branches off of, possibly None
|
|
|
|
example: if revision is 1.2.3.4, parent is 1.2
|
2002-06-03 22:35:06 +04:00
|
|
|
|
2004-01-22 05:20:24 +03:00
|
|
|
"undead"
|
|
|
|
If the revision is dead, then this is a reference to the first
|
|
|
|
previous revision which isn't dead, otherwise it's a reference
|
|
|
|
to itself. If all the previous revisions are dead it's None.
|
|
|
|
|
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 03:50:17 +03:00
|
|
|
"branch_number"
|
|
|
|
tuple representing branch number or empty tuple if on trunk
|
|
|
|
example: if revision is 1.2.3.4, branch_number is (1, 2, 3)
|
2003-10-23 22:59:06 +04:00
|
|
|
|
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 03:50:17 +03:00
|
|
|
Each tag in taglist gets these properties set:
|
|
|
|
"co_rev"
|
|
|
|
reference to revision that would be retrieved if tag were checked out
|
2003-10-23 22:59:06 +04:00
|
|
|
|
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 03:50:17 +03:00
|
|
|
"branch_rev"
|
|
|
|
reference to revision branched off of, only set for branch tags
|
|
|
|
example: if tag is 1.2.3, branch_rev points to 1.2 revision
|
2003-10-23 22:59:06 +04:00
|
|
|
|
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 03:50:17 +03:00
|
|
|
"aliases"
|
|
|
|
list of tags that have the same number
|
|
|
|
"""
|
2003-10-23 22:59:06 +04:00
|
|
|
|
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 03:50:17 +03:00
|
|
|
# map of branch numbers to lists of corresponding branch Tags
|
|
|
|
branch_dict = {}
|
2003-10-23 22:59:06 +04:00
|
|
|
|
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 03:50:17 +03:00
|
|
|
# map of revision numbers to lists of non-branch Tags
|
|
|
|
tag_dict = {}
|
2003-10-23 22:59:06 +04:00
|
|
|
|
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 03:50:17 +03:00
|
|
|
# map of revision numbers to lists of branch Tags
|
|
|
|
branch_point_dict = {}
|
2003-10-23 22:59:06 +04:00
|
|
|
|
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 03:50:17 +03:00
|
|
|
# toss tags into "branch_dict", "tag_dict", and "branch_point_dict"
|
|
|
|
# set "aliases" property and default "co_rev" and "branch_rev" values
|
|
|
|
for tag in taglist:
|
|
|
|
tag.co_rev = None
|
|
|
|
if tag.is_branch:
|
|
|
|
tag.branch_rev = None
|
|
|
|
_dict_list_add(branch_point_dict, tag.number[:-1], tag)
|
|
|
|
tag.aliases = _dict_list_add(branch_dict, tag.number, tag)
|
|
|
|
else:
|
|
|
|
tag.aliases = _dict_list_add(tag_dict, tag.number, tag)
|
|
|
|
|
|
|
|
# sort the revisions so the loop below can work properly
|
|
|
|
revlist.sort()
|
|
|
|
|
|
|
|
# array of the most recently encountered revision objects indexed by depth
|
|
|
|
history = []
|
|
|
|
|
|
|
|
# loop through revisions, setting properties and storing state in "history"
|
|
|
|
for rev in revlist:
|
|
|
|
depth = len(rev.number) / 2 - 1
|
|
|
|
|
|
|
|
# set "prev" and "next" properties
|
|
|
|
rev.prev = rev.next = None
|
|
|
|
if depth < len(history):
|
|
|
|
prev = history[depth]
|
2005-08-22 22:49:47 +04:00
|
|
|
if prev and (depth == 0 or rev.number[:-1] == prev.number[:-1]):
|
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 03:50:17 +03:00
|
|
|
rev.prev = prev
|
|
|
|
prev.next = rev
|
|
|
|
|
|
|
|
# set "parent"
|
Get rid of rlog module, make CVSdb use bincvs instead.
* lib/rlog.py
deleted
* lib/cvsdb.py
(RLogDataToCommitList):
removed
(GetCommitListFromRCSFile):
change to use vclib instead of rlog module
(GetCommitListFromRCSFile, GetUnrecordedCommitList):
update to accept vclib-style path_parts arguments
* lib/vclib/bincvs/__init__.py
(BinCVSRepository.filelog):
accept "cvs_pass_rev" option for passing -r arguments to rlog
(_match_revs_tags):
make this function work with an incomplete list of revisions
instead of crashing. This is neccessary when an -r argument
is passed to rlog.
(_add_tag):
make this function work when we need to create a tag with no
revision object. We need this to create a HEAD tag when an -r
argument is passed to rlog and we don't know what the HEAD
revision is.
(fetch_log):
removed
* tools/cvsdbadmin
(RebuildFile):
removed, merged into UpdateFile
(UpdateFile)
accept new argument to reinsert all commits
(RecurseRebuild):
removed, merged into RecurseUpdate
(RecurseUpdate):
update to use vclib's listdir instead of os.listdir
(CommandRebuild, CommandUpdate):
removed, code moved into __main__ section
* tools/loginfo-handler
(FileData, CommitFromFileData, GetUnrecordedCommitList):
removed, these were just wrappers over the cvsdb interface
(HeuristicArgParse, CvsNtArgParse)
return tuples describing file data instead of file data objects
(ProcessLoginfo):
update to use cvsdb interface
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@953 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-16 06:23:23 +04:00
|
|
|
rev.parent = None
|
|
|
|
if depth and depth <= len(history):
|
|
|
|
parent = history[depth-1]
|
|
|
|
if parent and parent.number == rev.number[:-2]:
|
|
|
|
rev.parent = history[depth-1]
|
2003-10-23 22:59:06 +04:00
|
|
|
|
2004-01-22 05:20:24 +03:00
|
|
|
# set "undead"
|
|
|
|
if rev.dead:
|
|
|
|
prev = rev.prev or rev.parent
|
|
|
|
rev.undead = prev and prev.undead
|
|
|
|
else:
|
|
|
|
rev.undead = rev
|
|
|
|
|
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 03:50:17 +03:00
|
|
|
# set "tags" and "branch_points"
|
|
|
|
rev.tags = tag_dict.get(rev.number, [])
|
|
|
|
rev.branch_points = branch_point_dict.get(rev.number, [])
|
|
|
|
|
|
|
|
# set "branches" and "branch_number"
|
|
|
|
if rev.prev:
|
|
|
|
rev.branches = rev.prev.branches
|
|
|
|
rev.branch_number = rev.prev.branch_number
|
|
|
|
else:
|
Get rid of rlog module, make CVSdb use bincvs instead.
* lib/rlog.py
deleted
* lib/cvsdb.py
(RLogDataToCommitList):
removed
(GetCommitListFromRCSFile):
change to use vclib instead of rlog module
(GetCommitListFromRCSFile, GetUnrecordedCommitList):
update to accept vclib-style path_parts arguments
* lib/vclib/bincvs/__init__.py
(BinCVSRepository.filelog):
accept "cvs_pass_rev" option for passing -r arguments to rlog
(_match_revs_tags):
make this function work with an incomplete list of revisions
instead of crashing. This is neccessary when an -r argument
is passed to rlog.
(_add_tag):
make this function work when we need to create a tag with no
revision object. We need this to create a HEAD tag when an -r
argument is passed to rlog and we don't know what the HEAD
revision is.
(fetch_log):
removed
* tools/cvsdbadmin
(RebuildFile):
removed, merged into UpdateFile
(UpdateFile)
accept new argument to reinsert all commits
(RecurseRebuild):
removed, merged into RecurseUpdate
(RecurseUpdate):
update to use vclib's listdir instead of os.listdir
(CommandRebuild, CommandUpdate):
removed, code moved into __main__ section
* tools/loginfo-handler
(FileData, CommitFromFileData, GetUnrecordedCommitList):
removed, these were just wrappers over the cvsdb interface
(HeuristicArgParse, CvsNtArgParse)
return tuples describing file data instead of file data objects
(ProcessLoginfo):
update to use cvsdb interface
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@953 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-16 06:23:23 +04:00
|
|
|
rev.branch_number = depth and rev.number[:-1] or ()
|
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 03:50:17 +03:00
|
|
|
try:
|
|
|
|
rev.branches = branch_dict[rev.branch_number]
|
|
|
|
except KeyError:
|
|
|
|
rev.branches = []
|
|
|
|
|
|
|
|
# set "co_rev" and "branch_rev"
|
|
|
|
for tag in rev.tags:
|
|
|
|
tag.co_rev = rev
|
|
|
|
|
|
|
|
for tag in rev.branch_points:
|
|
|
|
tag.co_rev = rev
|
|
|
|
tag.branch_rev = rev
|
|
|
|
|
|
|
|
# This loop only needs to be run for revisions at the heads of branches,
|
|
|
|
# but for the simplicity's sake, it actually runs for every revision on
|
|
|
|
# a branch. The later revisions overwrite values set by the earlier ones.
|
|
|
|
for branch in rev.branches:
|
|
|
|
branch.co_rev = rev
|
|
|
|
|
|
|
|
# end of outer loop, store most recent revision in "history" array
|
Get rid of rlog module, make CVSdb use bincvs instead.
* lib/rlog.py
deleted
* lib/cvsdb.py
(RLogDataToCommitList):
removed
(GetCommitListFromRCSFile):
change to use vclib instead of rlog module
(GetCommitListFromRCSFile, GetUnrecordedCommitList):
update to accept vclib-style path_parts arguments
* lib/vclib/bincvs/__init__.py
(BinCVSRepository.filelog):
accept "cvs_pass_rev" option for passing -r arguments to rlog
(_match_revs_tags):
make this function work with an incomplete list of revisions
instead of crashing. This is neccessary when an -r argument
is passed to rlog.
(_add_tag):
make this function work when we need to create a tag with no
revision object. We need this to create a HEAD tag when an -r
argument is passed to rlog and we don't know what the HEAD
revision is.
(fetch_log):
removed
* tools/cvsdbadmin
(RebuildFile):
removed, merged into UpdateFile
(UpdateFile)
accept new argument to reinsert all commits
(RecurseRebuild):
removed, merged into RecurseUpdate
(RecurseUpdate):
update to use vclib's listdir instead of os.listdir
(CommandRebuild, CommandUpdate):
removed, code moved into __main__ section
* tools/loginfo-handler
(FileData, CommitFromFileData, GetUnrecordedCommitList):
removed, these were just wrappers over the cvsdb interface
(HeuristicArgParse, CvsNtArgParse)
return tuples describing file data instead of file data objects
(ProcessLoginfo):
update to use cvsdb interface
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@953 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-16 06:23:23 +04:00
|
|
|
while len(history) <= depth:
|
|
|
|
history.append(None)
|
|
|
|
history[depth] = rev
|
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 03:50:17 +03:00
|
|
|
|
2004-01-25 22:06:53 +03:00
|
|
|
def _add_tag(tag_name, revision):
|
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 03:50:17 +03:00
|
|
|
"""Create a new tag object and associate it with a revision"""
|
Get rid of rlog module, make CVSdb use bincvs instead.
* lib/rlog.py
deleted
* lib/cvsdb.py
(RLogDataToCommitList):
removed
(GetCommitListFromRCSFile):
change to use vclib instead of rlog module
(GetCommitListFromRCSFile, GetUnrecordedCommitList):
update to accept vclib-style path_parts arguments
* lib/vclib/bincvs/__init__.py
(BinCVSRepository.filelog):
accept "cvs_pass_rev" option for passing -r arguments to rlog
(_match_revs_tags):
make this function work with an incomplete list of revisions
instead of crashing. This is neccessary when an -r argument
is passed to rlog.
(_add_tag):
make this function work when we need to create a tag with no
revision object. We need this to create a HEAD tag when an -r
argument is passed to rlog and we don't know what the HEAD
revision is.
(fetch_log):
removed
* tools/cvsdbadmin
(RebuildFile):
removed, merged into UpdateFile
(UpdateFile)
accept new argument to reinsert all commits
(RecurseRebuild):
removed, merged into RecurseUpdate
(RecurseUpdate):
update to use vclib's listdir instead of os.listdir
(CommandRebuild, CommandUpdate):
removed, code moved into __main__ section
* tools/loginfo-handler
(FileData, CommitFromFileData, GetUnrecordedCommitList):
removed, these were just wrappers over the cvsdb interface
(HeuristicArgParse, CvsNtArgParse)
return tuples describing file data instead of file data objects
(ProcessLoginfo):
update to use cvsdb interface
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@953 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-16 06:23:23 +04:00
|
|
|
if revision:
|
2005-08-22 22:49:47 +04:00
|
|
|
tag = Tag(tag_name, revision.string)
|
Get rid of rlog module, make CVSdb use bincvs instead.
* lib/rlog.py
deleted
* lib/cvsdb.py
(RLogDataToCommitList):
removed
(GetCommitListFromRCSFile):
change to use vclib instead of rlog module
(GetCommitListFromRCSFile, GetUnrecordedCommitList):
update to accept vclib-style path_parts arguments
* lib/vclib/bincvs/__init__.py
(BinCVSRepository.filelog):
accept "cvs_pass_rev" option for passing -r arguments to rlog
(_match_revs_tags):
make this function work with an incomplete list of revisions
instead of crashing. This is neccessary when an -r argument
is passed to rlog.
(_add_tag):
make this function work when we need to create a tag with no
revision object. We need this to create a HEAD tag when an -r
argument is passed to rlog and we don't know what the HEAD
revision is.
(fetch_log):
removed
* tools/cvsdbadmin
(RebuildFile):
removed, merged into UpdateFile
(UpdateFile)
accept new argument to reinsert all commits
(RecurseRebuild):
removed, merged into RecurseUpdate
(RecurseUpdate):
update to use vclib's listdir instead of os.listdir
(CommandRebuild, CommandUpdate):
removed, code moved into __main__ section
* tools/loginfo-handler
(FileData, CommitFromFileData, GetUnrecordedCommitList):
removed, these were just wrappers over the cvsdb interface
(HeuristicArgParse, CvsNtArgParse)
return tuples describing file data instead of file data objects
(ProcessLoginfo):
update to use cvsdb interface
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@953 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-16 06:23:23 +04:00
|
|
|
tag.aliases = revision.tags
|
|
|
|
revision.tags.append(tag)
|
|
|
|
else:
|
|
|
|
tag = Tag(tag_name, None)
|
|
|
|
tag.aliases = []
|
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 03:50:17 +03:00
|
|
|
tag.co_rev = revision
|
Get rid of rlog module, make CVSdb use bincvs instead.
* lib/rlog.py
deleted
* lib/cvsdb.py
(RLogDataToCommitList):
removed
(GetCommitListFromRCSFile):
change to use vclib instead of rlog module
(GetCommitListFromRCSFile, GetUnrecordedCommitList):
update to accept vclib-style path_parts arguments
* lib/vclib/bincvs/__init__.py
(BinCVSRepository.filelog):
accept "cvs_pass_rev" option for passing -r arguments to rlog
(_match_revs_tags):
make this function work with an incomplete list of revisions
instead of crashing. This is neccessary when an -r argument
is passed to rlog.
(_add_tag):
make this function work when we need to create a tag with no
revision object. We need this to create a HEAD tag when an -r
argument is passed to rlog and we don't know what the HEAD
revision is.
(fetch_log):
removed
* tools/cvsdbadmin
(RebuildFile):
removed, merged into UpdateFile
(UpdateFile)
accept new argument to reinsert all commits
(RecurseRebuild):
removed, merged into RecurseUpdate
(RecurseUpdate):
update to use vclib's listdir instead of os.listdir
(CommandRebuild, CommandUpdate):
removed, code moved into __main__ section
* tools/loginfo-handler
(FileData, CommitFromFileData, GetUnrecordedCommitList):
removed, these were just wrappers over the cvsdb interface
(HeuristicArgParse, CvsNtArgParse)
return tuples describing file data instead of file data objects
(ProcessLoginfo):
update to use cvsdb interface
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@953 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-16 06:23:23 +04:00
|
|
|
tag.is_branch = 0
|
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 03:50:17 +03:00
|
|
|
return tag
|
Get rid of rlog module, make CVSdb use bincvs instead.
* lib/rlog.py
deleted
* lib/cvsdb.py
(RLogDataToCommitList):
removed
(GetCommitListFromRCSFile):
change to use vclib instead of rlog module
(GetCommitListFromRCSFile, GetUnrecordedCommitList):
update to accept vclib-style path_parts arguments
* lib/vclib/bincvs/__init__.py
(BinCVSRepository.filelog):
accept "cvs_pass_rev" option for passing -r arguments to rlog
(_match_revs_tags):
make this function work with an incomplete list of revisions
instead of crashing. This is neccessary when an -r argument
is passed to rlog.
(_add_tag):
make this function work when we need to create a tag with no
revision object. We need this to create a HEAD tag when an -r
argument is passed to rlog and we don't know what the HEAD
revision is.
(fetch_log):
removed
* tools/cvsdbadmin
(RebuildFile):
removed, merged into UpdateFile
(UpdateFile)
accept new argument to reinsert all commits
(RecurseRebuild):
removed, merged into RecurseUpdate
(RecurseUpdate):
update to use vclib's listdir instead of os.listdir
(CommandRebuild, CommandUpdate):
removed, code moved into __main__ section
* tools/loginfo-handler
(FileData, CommitFromFileData, GetUnrecordedCommitList):
removed, these were just wrappers over the cvsdb interface
(HeuristicArgParse, CvsNtArgParse)
return tuples describing file data instead of file data objects
(ProcessLoginfo):
update to use cvsdb interface
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@953 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-10-16 06:23:23 +04:00
|
|
|
|
2004-01-25 22:06:53 +03:00
|
|
|
def _remove_tag(tag):
|
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 03:50:17 +03:00
|
|
|
"""Remove a tag's associations"""
|
|
|
|
tag.aliases.remove(tag)
|
|
|
|
if tag.is_branch and tag.branch_rev:
|
|
|
|
tag.branch_rev.branch_points.remove(tag)
|
|
|
|
|
|
|
|
def _revision_tuple(revision_string):
|
|
|
|
"""convert a revision number into a tuple of integers"""
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
t = tuple(map(int, revision_string.split('.')))
|
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 03:50:17 +03:00
|
|
|
if len(t) % 2 == 0:
|
|
|
|
return t
|
|
|
|
raise ValueError
|
|
|
|
|
|
|
|
def _tag_tuple(revision_string):
|
|
|
|
"""convert a revision number or branch number into a tuple of integers"""
|
|
|
|
if revision_string:
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
t = map(int, revision_string.split('.'))
|
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 03:50:17 +03:00
|
|
|
l = len(t)
|
|
|
|
if l == 1:
|
2006-07-14 19:29:25 +04:00
|
|
|
return ()
|
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 03:50:17 +03:00
|
|
|
if l > 2 and t[-2] == 0 and l % 2 == 0:
|
|
|
|
del t[-2]
|
|
|
|
return tuple(t)
|
|
|
|
return ()
|
|
|
|
|
|
|
|
def _dict_list_add(dict, idx, elem):
|
|
|
|
try:
|
|
|
|
list = dict[idx]
|
|
|
|
except KeyError:
|
|
|
|
list = dict[idx] = [elem]
|
|
|
|
else:
|
|
|
|
list.append(elem)
|
|
|
|
return list
|
2003-10-23 22:59:06 +04:00
|
|
|
|
|
|
|
|
2004-01-22 06:46:30 +03:00
|
|
|
# ======================================================================
|
|
|
|
# Functions for parsing output from RCS utilities
|
|
|
|
|
2005-10-04 00:57:12 +04:00
|
|
|
|
|
|
|
class COMalformedOutput(vclib.Error):
|
|
|
|
pass
|
|
|
|
class COMissingRevision(vclib.Error):
|
|
|
|
pass
|
|
|
|
|
2004-01-22 05:49:44 +03:00
|
|
|
### suck up other warnings in _re_co_warning?
|
2005-12-30 10:30:45 +03:00
|
|
|
_re_co_filename = re.compile(r'^(.*),v\s+-->\s+(?:(?:standard output)|(?:stdout))\s*\n?$')
|
2004-01-22 05:49:44 +03:00
|
|
|
_re_co_warning = re.compile(r'^.*co: .*,v: warning: Unknown phrases like .*\n$')
|
2005-10-04 00:57:12 +04:00
|
|
|
_re_co_missing_rev = re.compile(r'^.*co: .*,v: revision.*absent\n$')
|
2005-12-10 21:58:51 +03:00
|
|
|
_re_co_side_branches = re.compile(r'^.*co: .*,v: no side branches present for [\d\.]+\n$')
|
2004-01-22 05:49:44 +03:00
|
|
|
_re_co_revision = re.compile(r'^revision\s+([\d\.]+)\s*\n$')
|
|
|
|
|
2004-01-25 22:06:53 +03:00
|
|
|
def _parse_co_header(fp):
|
2004-01-22 05:49:44 +03:00
|
|
|
"""Parse RCS co header.
|
|
|
|
|
|
|
|
fp is a file (pipe) opened for reading the co standard error stream.
|
|
|
|
|
|
|
|
Returns: (filename, revision) or (None, None) if output is empty
|
|
|
|
"""
|
|
|
|
|
|
|
|
# header from co:
|
|
|
|
#
|
|
|
|
#/home/cvsroot/mod_dav/dav_shared_stub.c,v --> standard output
|
|
|
|
#revision 1.1
|
|
|
|
#
|
|
|
|
# Sometimes, the following line might occur at line 2:
|
|
|
|
#co: INSTALL,v: warning: Unknown phrases like `permissions ...;' are present.
|
|
|
|
|
|
|
|
# parse the output header
|
2005-10-04 00:57:12 +04:00
|
|
|
filename = None
|
2004-01-22 05:49:44 +03:00
|
|
|
|
2005-10-04 00:57:12 +04:00
|
|
|
# look for a filename in the first line (if there is a first line).
|
2004-01-22 05:49:44 +03:00
|
|
|
line = fp.readline()
|
|
|
|
if not line:
|
|
|
|
return None, None
|
|
|
|
match = _re_co_filename.match(line)
|
|
|
|
if not match:
|
2005-10-04 00:57:12 +04:00
|
|
|
raise COMalformedOutput, "Unable to find filename in co output stream"
|
2004-01-22 05:49:44 +03:00
|
|
|
filename = match.group(1)
|
|
|
|
|
2008-05-14 20:53:00 +04:00
|
|
|
# look through subsequent lines for a revision. we might encounter
|
|
|
|
# some ignorable or problematic lines along the way.
|
|
|
|
while 1:
|
|
|
|
line = fp.readline()
|
|
|
|
if not line:
|
|
|
|
break
|
|
|
|
# look for a revision.
|
|
|
|
match = _re_co_revision.match(line)
|
|
|
|
if match:
|
|
|
|
return filename, match.group(1)
|
|
|
|
elif _re_co_missing_rev.match(line) or _re_co_side_branches.match(line):
|
|
|
|
raise COMissingRevision, "Got missing revision error from co output stream"
|
|
|
|
elif _re_co_warning.match(line):
|
|
|
|
pass
|
|
|
|
else:
|
|
|
|
break
|
2005-10-04 00:57:12 +04:00
|
|
|
|
|
|
|
raise COMalformedOutput, "Unable to find revision in co output stream"
|
2004-01-22 05:49:44 +03:00
|
|
|
|
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 03:50:17 +03:00
|
|
|
# if your rlog doesn't use 77 '=' characters, then this must change
|
|
|
|
LOG_END_MARKER = '=' * 77 + '\n'
|
|
|
|
ENTRY_END_MARKER = '-' * 28 + '\n'
|
2003-10-23 22:59:06 +04:00
|
|
|
|
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 03:50:17 +03:00
|
|
|
_EOF_FILE = 'end of file entries' # no more entries for this RCS file
|
|
|
|
_EOF_LOG = 'end of log' # hit the true EOF on the pipe
|
|
|
|
_EOF_ERROR = 'error message found' # rlog issued an error
|
2003-10-23 22:59:06 +04:00
|
|
|
|
2004-07-31 18:38:03 +04:00
|
|
|
# rlog error messages look like
|
|
|
|
#
|
|
|
|
# rlog: filename/goes/here,v: error message
|
|
|
|
# rlog: filename/goes/here,v:123: error message
|
|
|
|
#
|
|
|
|
# so we should be able to match them with a regex like
|
|
|
|
#
|
|
|
|
# ^rlog\: (.*)(?:\:\d+)?\: (.*)$
|
|
|
|
#
|
|
|
|
# But for some reason the windows version of rlog omits the "rlog: " prefix
|
|
|
|
# for the first error message when the standard error stream has been
|
|
|
|
# redirected to a file or pipe. (the prefix is present in subsequent errors
|
|
|
|
# and when rlog is run from the console). So the expression below is more
|
|
|
|
# complicated
|
|
|
|
_re_log_error = re.compile(r'^(?:rlog\: )*(.*,v)(?:\:\d+)?\: (.*)$')
|
|
|
|
|
|
|
|
# CVSNT error messages look like:
|
|
|
|
# cvs rcsfile: `C:/path/to/file,v' does not appear to be a valid rcs file
|
|
|
|
# cvs [rcsfile aborted]: C:/path/to/file,v: No such file or directory
|
|
|
|
# cvs [rcsfile aborted]: cannot open C:/path/to/file,v: Permission denied
|
|
|
|
_re_cvsnt_error = re.compile(r'^(?:cvs rcsfile\: |cvs \[rcsfile aborted\]: )'
|
|
|
|
r'(?:\`(.*,v)\' |cannot open (.*,v)\: |(.*,v)\: |)'
|
|
|
|
r'(.*)$')
|
2003-10-23 22:59:06 +04:00
|
|
|
|
2004-01-25 22:06:53 +03:00
|
|
|
def _parse_log_header(fp):
|
2002-04-13 13:43:22 +04:00
|
|
|
"""Parse and RCS/CVS log header.
|
|
|
|
|
|
|
|
fp is a file (pipe) opened for reading the log information.
|
|
|
|
|
|
|
|
On entry, fp should point to the start of a log entry.
|
|
|
|
On exit, fp will have consumed the separator line between the header and
|
|
|
|
the first revision log.
|
|
|
|
|
|
|
|
If there is no revision information (e.g. the "-h" switch was passed to
|
|
|
|
rlog), then fp will consumed the file separator line on exit.
|
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 03:50:17 +03:00
|
|
|
|
2008-02-12 22:41:19 +03:00
|
|
|
Returns: filename, default branch, tag dictionary, lock dictionary,
|
|
|
|
rlog error message, and eof flag
|
2002-04-13 13:43:22 +04:00
|
|
|
"""
|
2008-02-12 22:41:19 +03:00
|
|
|
|
2004-07-31 18:38:03 +04:00
|
|
|
filename = head = branch = msg = ""
|
2008-02-12 22:41:19 +03:00
|
|
|
taginfo = { } # tag name => number
|
|
|
|
lockinfo = { } # revision => locker
|
|
|
|
state = 0 # 0 = base, 1 = parsing symbols, 2 = parsing locks
|
2002-04-13 13:43:22 +04:00
|
|
|
eof = None
|
|
|
|
|
|
|
|
while 1:
|
|
|
|
line = fp.readline()
|
|
|
|
if not line:
|
|
|
|
# the true end-of-file
|
|
|
|
eof = _EOF_LOG
|
|
|
|
break
|
|
|
|
|
2008-02-12 22:41:19 +03:00
|
|
|
if state == 1:
|
2002-04-13 13:43:22 +04:00
|
|
|
if line[0] == '\t':
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
[ tag, rev ] = map(lambda x: x.strip(), line.split(':'))
|
2002-04-13 13:43:22 +04:00
|
|
|
taginfo[tag] = rev
|
|
|
|
else:
|
|
|
|
# oops. this line isn't tag info. stop parsing tags.
|
2008-02-12 22:41:19 +03:00
|
|
|
state = 0
|
2002-04-13 13:43:22 +04:00
|
|
|
|
2008-02-12 22:41:19 +03:00
|
|
|
if state == 2:
|
|
|
|
if line[0] == '\t':
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
[ locker, rev ] = map(lambda x: x.strip(), line.split(':'))
|
2008-02-12 22:41:19 +03:00
|
|
|
lockinfo[rev] = locker
|
|
|
|
else:
|
|
|
|
# oops. this line isn't lock info. stop parsing tags.
|
|
|
|
state = 0
|
|
|
|
|
|
|
|
if state == 0:
|
2002-04-13 13:43:22 +04:00
|
|
|
if line[:9] == 'RCS file:':
|
2003-10-24 06:52:05 +04:00
|
|
|
filename = line[10:-1]
|
2002-04-13 13:43:22 +04:00
|
|
|
elif line[:5] == 'head:':
|
|
|
|
head = line[6:-1]
|
|
|
|
elif line[:7] == 'branch:':
|
|
|
|
branch = line[8:-1]
|
2008-02-12 22:41:19 +03:00
|
|
|
elif line[:6] == 'locks:':
|
|
|
|
# start parsing the lock information
|
|
|
|
state = 2
|
2002-04-13 13:43:22 +04:00
|
|
|
elif line[:14] == 'symbolic names':
|
|
|
|
# start parsing the tag information
|
2008-02-12 22:41:19 +03:00
|
|
|
state = 1
|
2002-04-13 13:43:22 +04:00
|
|
|
elif line == ENTRY_END_MARKER:
|
|
|
|
# end of the headers
|
|
|
|
break
|
|
|
|
elif line == LOG_END_MARKER:
|
|
|
|
# end of this file's log information
|
|
|
|
eof = _EOF_FILE
|
|
|
|
break
|
2004-07-31 18:38:03 +04:00
|
|
|
else:
|
|
|
|
error = _re_cvsnt_error.match(line)
|
|
|
|
if error:
|
|
|
|
p1, p2, p3, msg = error.groups()
|
|
|
|
filename = p1 or p2 or p3
|
|
|
|
if not filename:
|
|
|
|
raise vclib.Error("Could not get filename from CVSNT error:\n%s"
|
|
|
|
% line)
|
|
|
|
eof = _EOF_ERROR
|
|
|
|
break
|
|
|
|
|
|
|
|
error = _re_log_error.match(line)
|
|
|
|
if error:
|
|
|
|
filename, msg = error.groups()
|
|
|
|
if msg[:30] == 'warning: Unknown phrases like ':
|
2002-04-13 13:43:22 +04:00
|
|
|
# don't worry about this warning. it can happen with some RCS
|
|
|
|
# files that have unknown fields in them (e.g. "permissions 644;"
|
|
|
|
continue
|
2004-06-06 06:46:49 +04:00
|
|
|
eof = _EOF_ERROR
|
|
|
|
break
|
2002-05-22 02:47:16 +04:00
|
|
|
|
2008-02-12 22:41:19 +03:00
|
|
|
return filename, branch, taginfo, lockinfo, msg, eof
|
2002-04-13 13:43:22 +04:00
|
|
|
|
|
|
|
_re_log_info = re.compile(r'^date:\s+([^;]+);'
|
|
|
|
r'\s+author:\s+([^;]+);'
|
|
|
|
r'\s+state:\s+([^;]+);'
|
2006-04-14 07:45:31 +04:00
|
|
|
r'(\s+lines:\s+([0-9\s+-]+);?)?'
|
|
|
|
r'(\s+commitid:\s+([a-zA-Z0-9]+))?\n$')
|
2002-04-13 13:43:22 +04:00
|
|
|
### _re_rev should be updated to extract the "locked" flag
|
|
|
|
_re_rev = re.compile(r'^revision\s+([0-9.]+).*')
|
2004-01-25 22:06:53 +03:00
|
|
|
def _parse_log_entry(fp):
|
2002-04-13 13:43:22 +04:00
|
|
|
"""Parse a single log entry.
|
|
|
|
|
|
|
|
On entry, fp should point to the first line of the entry (the "revision"
|
|
|
|
line).
|
|
|
|
On exit, fp will have consumed the log separator line (dashes) or the
|
|
|
|
end-of-file marker (equals).
|
|
|
|
|
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 03:50:17 +03:00
|
|
|
Returns: Revision object and eof flag (see _EOF_*)
|
2002-04-13 13:43:22 +04:00
|
|
|
"""
|
|
|
|
rev = None
|
|
|
|
line = fp.readline()
|
|
|
|
if not line:
|
|
|
|
return None, _EOF_LOG
|
2003-07-25 01:53:20 +04:00
|
|
|
if line == LOG_END_MARKER:
|
2003-10-22 07:40:07 +04:00
|
|
|
# Needed because some versions of RCS precede LOG_END_MARKER
|
2003-07-25 01:53:20 +04:00
|
|
|
# with ENTRY_END_MARKER
|
2003-10-22 07:40:07 +04:00
|
|
|
return None, _EOF_FILE
|
2002-04-13 13:43:22 +04:00
|
|
|
if line[:8] == 'revision':
|
|
|
|
match = _re_rev.match(line)
|
|
|
|
if not match:
|
|
|
|
return None, _EOF_LOG
|
|
|
|
rev = match.group(1)
|
|
|
|
|
|
|
|
line = fp.readline()
|
|
|
|
if not line:
|
|
|
|
return None, _EOF_LOG
|
|
|
|
match = _re_log_info.match(line)
|
|
|
|
|
|
|
|
eof = None
|
|
|
|
log = ''
|
|
|
|
while 1:
|
|
|
|
line = fp.readline()
|
|
|
|
if not line:
|
|
|
|
# true end-of-file
|
|
|
|
eof = _EOF_LOG
|
|
|
|
break
|
|
|
|
if line[:9] == 'branches:':
|
|
|
|
continue
|
|
|
|
if line == ENTRY_END_MARKER:
|
|
|
|
break
|
|
|
|
if line == LOG_END_MARKER:
|
|
|
|
# end of this file's log information
|
|
|
|
eof = _EOF_FILE
|
|
|
|
break
|
|
|
|
|
|
|
|
log = log + line
|
|
|
|
|
|
|
|
if not rev or not match:
|
|
|
|
# there was a parsing error
|
|
|
|
return None, eof
|
|
|
|
|
|
|
|
# parse out a time tuple for the local time
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
tm = vclib.ccvs.cvs_strptime(match.group(1))
|
2005-09-30 19:10:49 +04:00
|
|
|
|
|
|
|
# rlog seems to assume that two-digit years are 1900-based (so, "04"
|
|
|
|
# comes out as "1904", not "2004").
|
|
|
|
EPOCH = 1970
|
|
|
|
if tm[0] < EPOCH:
|
|
|
|
tm = list(tm)
|
|
|
|
if (tm[0] - 1900) < 70:
|
|
|
|
tm[0] = tm[0] + 100
|
|
|
|
if tm[0] < EPOCH:
|
|
|
|
raise ValueError, 'invalid year'
|
Wow. Drop a "general code cleanup" kind of bomb on the codebase. All
of this is aimed at not paying the maintenance price of supporting
Python versions prior to 2.4 any longer, plus a little bit of just
getting dead code out of the way.
* lib/compat.py
Remove as unused.
* bin/cvsdbadmin,
* bin/loginfo-handler,
* bin/make-database,
* bin/svndbadmin,
* lib/accept.py,
* lib/blame.py,
* lib/cvsdb.py,
* lib/popen.py,
* lib/query.py,
* lib/sapi.py,
* lib/vcauth/forbidden/__init__.py
* lib/vcauth/forbiddenre/__init__.py,
* lib/vcauth/svnauthz/__init__.py,
* lib/vclib/__init__.py,
* lib/vclib/ccvs/blame.py,
* lib/win32popen.py,
* tests/timelog.py
Replace explicit import and use of the 'string' module with newer constructs.
* bin/standalone.py,
* lib/viewvc.py
No longer use 'compat' module. Replace explicit import and use of
the 'string' module with newer constructs.
* lib/dbi.py
Use calender.timegm() instead of compat.timegm().
* lib/vcauth/__init__.py
Lose unused module imports.
* lib/config.py,
Replace explicit import and use of the 'string' module with newer
constructs where possible. Lose old ConfigParser patch-up code for
Python 1.5.1.
* lib/vclib/ccvs/ccvs.py
Replace explicit import and use of the 'string' module with newer
constructs where possible. Import _path_join() from bincvs, and use
it instead of a bunch of copy-and-pasted string join() statements
throughout.
* lib/vclib/ccvs/__init__.py
(cvs_strptime): Moved here from the 'compat' module.
* lib/vclib/ccvs/bincvs.py
(): No longer use 'compat' module. Replace explicit import and use
of the 'string' module with newer constructs.
(_path_join): New, used now instead of a bunch of copy-and-pasted
string join() statements throughout.
* viewvc-install
Don't use the 'compat' module any more.
Also, so some rearranging of non-critical bits.
* misc/: New directory.
* misc/py2html.py: Moved from 'lib/py2html.py'.
* misc/PyFontify.py: Moved from 'lib/PyFontify.py'.
* misc/elemx/: Moved from 'elemx/'.
* misc/tparse/: Moved from 'tparse/'.
* tools/make-release
Omit 'misc' directory from releases, too.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2437 8cb11bc2-c004-0410-86c3-e597b4017df7
2010-09-03 20:49:52 +04:00
|
|
|
date = calendar.timegm(tm)
|
2002-04-13 13:43:22 +04:00
|
|
|
|
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 03:50:17 +03:00
|
|
|
return Revision(rev, date,
|
2002-04-13 13:43:22 +04:00
|
|
|
# author, state, lines changed
|
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 22:05:08 +03:00
|
|
|
match.group(2), match.group(3) == "dead", match.group(5),
|
2002-04-13 13:43:22 +04:00
|
|
|
log), eof
|
|
|
|
|
2004-01-25 22:06:53 +03:00
|
|
|
def _skip_file(fp):
|
2002-04-13 13:43:22 +04:00
|
|
|
"Skip the rest of a file's log information."
|
|
|
|
while 1:
|
|
|
|
line = fp.readline()
|
|
|
|
if not line:
|
|
|
|
break
|
|
|
|
if line == LOG_END_MARKER:
|
|
|
|
break
|
|
|
|
|
2004-10-14 06:00:34 +04:00
|
|
|
def _paths_eq(path1, path2):
|
|
|
|
"See if two path strings are the same"
|
|
|
|
# This function is neccessary because CVSNT (since version 2.0.29)
|
|
|
|
# converts paths passed as arguments to use upper case drive
|
|
|
|
# letter and forward slashes
|
|
|
|
return os.path.normcase(path1) == os.path.normcase(path2)
|
|
|
|
|
2004-01-22 06:46:30 +03:00
|
|
|
|
|
|
|
# ======================================================================
|
|
|
|
# Functions for interpreting and manipulating log information
|
2003-07-02 08:49:16 +04:00
|
|
|
|
2008-02-12 22:41:19 +03:00
|
|
|
def _file_log(revs, taginfo, lockinfo, cur_branch, filter):
|
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 22:25:30 +03:00
|
|
|
"""Augment list of Revisions and a dictionary of Tags"""
|
2004-01-22 04:48:59 +03:00
|
|
|
|
2006-03-18 03:33:54 +03:00
|
|
|
# Add artificial ViewVC tag MAIN. If the file has a default branch, then
|
2004-01-22 04:48:59 +03:00
|
|
|
# MAIN acts like a branch tag pointing to that branch. Otherwise MAIN acts
|
|
|
|
# like a branch tag that points to the trunk. (Note: A default branch is
|
|
|
|
# just a branch number specified in an RCS file that tells CVS and RCS
|
|
|
|
# what branch to use for checkout and update operations by default, when
|
|
|
|
# there's no revision argument or sticky branch to override it. Default
|
|
|
|
# branches get set by "cvs import" to point to newly created vendor
|
|
|
|
# branches. Sometimes they are also set manually with "cvs admin -b")
|
|
|
|
taginfo['MAIN'] = cur_branch
|
|
|
|
|
|
|
|
# Create tag objects
|
|
|
|
for name, num in taginfo.items():
|
|
|
|
taginfo[name] = Tag(name, num)
|
|
|
|
tags = taginfo.values()
|
|
|
|
|
|
|
|
# Set view_tag to a Tag object in order to filter results. We can filter by
|
|
|
|
# revision number or branch number
|
|
|
|
if filter:
|
|
|
|
try:
|
|
|
|
view_tag = Tag(None, filter)
|
|
|
|
except ValueError:
|
|
|
|
view_tag = None
|
|
|
|
else:
|
|
|
|
tags.append(view_tag)
|
|
|
|
|
|
|
|
# Match up tags and revisions
|
2004-01-25 22:06:53 +03:00
|
|
|
_match_revs_tags(revs, tags)
|
2004-01-22 04:48:59 +03:00
|
|
|
|
2008-02-12 22:41:19 +03:00
|
|
|
# Match up lockinfo and revision
|
|
|
|
for rev in revs:
|
|
|
|
rev.lockinfo = lockinfo.get(rev.string)
|
|
|
|
|
2006-03-18 03:33:54 +03:00
|
|
|
# Add artificial ViewVC tag HEAD, which acts like a non-branch tag pointing
|
2004-01-22 04:48:59 +03:00
|
|
|
# at the latest revision on the MAIN branch. The HEAD revision doesn't have
|
|
|
|
# anything to do with the "head" revision number specified in the RCS file
|
|
|
|
# and in rlog output. HEAD refers to the revision that the CVS and RCS co
|
|
|
|
# commands will check out by default, whereas the "head" field just refers
|
|
|
|
# to the highest revision on the trunk.
|
2004-01-25 22:06:53 +03:00
|
|
|
taginfo['HEAD'] = _add_tag('HEAD', taginfo['MAIN'].co_rev)
|
2004-01-22 04:48:59 +03:00
|
|
|
|
|
|
|
# Determine what revisions to return
|
|
|
|
if filter:
|
|
|
|
# If view_tag isn't set, it means filter is not a valid revision or
|
|
|
|
# branch number. Check taginfo to see if filter is set to a valid tag
|
|
|
|
# name. If so, filter by that tag, otherwise raise an error.
|
|
|
|
if not view_tag:
|
|
|
|
try:
|
|
|
|
view_tag = taginfo[filter]
|
|
|
|
except KeyError:
|
2004-01-22 05:20:24 +03:00
|
|
|
raise vclib.Error('Invalid tag or revision number "%s"' % filter)
|
2004-01-22 04:48:59 +03:00
|
|
|
filtered_revs = [ ]
|
New URL scheme for Subversion. The problem with the old scheme is it
doesn't have a concept of a "sticky" revision. So if you are looking
at version 10 of a directory, and click to view a file inside which
was last modified in version 6, the fact you were looking at version 10
of the parent directory is not recorded anywhere, and the "Parent Directory"
links on the markup page will take you to a version 6 directory listing
instead of the listing you came from. This problem exists all over
ViewCVS, not just in directory listings, and the result of it is that when
you browse a repository by following the provided links you get sent further
and further back into the history, all the while seeing incomplete log pages
and outdated directory listings which you never asked for.
The new URL scheme works by introducing a new 'pathrev' sticky variable and
is described in detail in a comment in the _orig_path function in
lib/viewcvs.py. The scheme is not backwards compatabile with all (or
maybe even most) old subversion URLs. Specifically, any old URL referring
to a path that no longer exists in the HEAD will not work. Other subversion
URLs will still work.
It is still possible to add backwards compatibility. We'd have to rename
the rev parameter to something else, so we could know that all URLs with
'rev' in them are old style URLs which need to be redirected. I don't know
if it's worth doing this though.
This is not an isolated change. I've tried to unite the Subversion "sticky
revision" with the present "only_with_tag" logic for CVS. And since I had
to go over viewcvs.py with a fine-toothed comb implementing these things,
there are also some miscellaneous cleanups there.
* lib/vclib/bincvs/__init__.py
(_file_log):
change filtering so when matching revisions to tag, includes all
preceding revisions, not just tag revision itself
* lib/viewcvs.py
(_sticky_vars):
'only_with_tag' is gone, so change this back into a list with no
span-roots values
(request.run_viewcvs):
read new 'pathrev' parameter and use it when calling repos.itemtype
(request.get_link):
add 'pathrev' parameter to urls, restore update _sticky_vars loop
(_legal_params, prep_tags, build_commit):
replace 'only_with_tag' with 'pathrev'
(_orig_path):
new function
(nav_path, common_template_data):
stop adding 'rev' parameters to links
removed unused 'roots_href' template variable
(nav_header_data):
add new 'revision_href', 'orig_path', 'orig_href' template variables
for use in markup and annotate views
(view_markup, view_checkout, view_annotate, setup_diff, generate_tarball,
download_tarball):
use 'pathrev' when looking up file revision
(view_directory):
use 'pathrev' when looking up directory revisions instead of 'rev'.
stop adding 'rev' to links.
add template variables: pathrev, pathrev_action, pathrev_hidden_values.
remove unused template variables: num_files, rev, view_tag, has_tags,
main_href, jump_rev_action, jump_rev_hidden_values, row.show_log.
(view_log):
use 'pathrev' to retrieve log information instead of 'rev'.
stop linking to original paths of copied files.
add template variables: entry.orig_path, entry.orig_href, default_branch,
pathrev, pathrev_action, pathrev_hidden_values, branch_tags, plain_tags.
remove template variables: entry.filename, entry.prev_path,
branch, path_selected, view_tag, branch_names, branch_select_action,
branch_select_hidden_values.
(view_cvsgraph):
use common_template_data instead of nav_header_data, 'pathrev' instead
of 'only_with tag'
(view_diff):
use common_template_data instead of nav_header_data
add template variables: path_left, path_right
(view_revision):
use 'pathrev' instead of 'rev' in links
* templates/include/dir_header.ezt
rearrange header and add sticky tag/revision row
* templates/include/dir_footer.ezt
remove tag selector
* templates/include/pathrev_form.ezt
new, sticky tag/revision selector form based on code from
dir_footer.ezt
* templates/include/branch.ezt
* templates/include/branch_form.ezt
* templates/include/view_tag.ezt
removed
* templates/include/log_header.ezt
new, based on branch.ezt and view_tag.ezt
* templates/include/log_footer.ezt
new
* templates/include/log.ezt
* templates/include/log_table.ezt
include log_header.ezt and log_footer.ezt
* templates/include/annotate.ezt
* templates/include/diff.ezt
* templates/include/markup.ezt
show original paths and add view_revision links
* cvsgraph.conf.dist
replace only_with_tag parameter with pathrev
* website/template-authoring-guide.html
update template variable information
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1145 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-03 16:31:02 +03:00
|
|
|
|
|
|
|
# only include revisions on the tag branch or it's parent branches
|
2004-01-22 04:48:59 +03:00
|
|
|
if view_tag.is_branch:
|
New URL scheme for Subversion. The problem with the old scheme is it
doesn't have a concept of a "sticky" revision. So if you are looking
at version 10 of a directory, and click to view a file inside which
was last modified in version 6, the fact you were looking at version 10
of the parent directory is not recorded anywhere, and the "Parent Directory"
links on the markup page will take you to a version 6 directory listing
instead of the listing you came from. This problem exists all over
ViewCVS, not just in directory listings, and the result of it is that when
you browse a repository by following the provided links you get sent further
and further back into the history, all the while seeing incomplete log pages
and outdated directory listings which you never asked for.
The new URL scheme works by introducing a new 'pathrev' sticky variable and
is described in detail in a comment in the _orig_path function in
lib/viewcvs.py. The scheme is not backwards compatabile with all (or
maybe even most) old subversion URLs. Specifically, any old URL referring
to a path that no longer exists in the HEAD will not work. Other subversion
URLs will still work.
It is still possible to add backwards compatibility. We'd have to rename
the rev parameter to something else, so we could know that all URLs with
'rev' in them are old style URLs which need to be redirected. I don't know
if it's worth doing this though.
This is not an isolated change. I've tried to unite the Subversion "sticky
revision" with the present "only_with_tag" logic for CVS. And since I had
to go over viewcvs.py with a fine-toothed comb implementing these things,
there are also some miscellaneous cleanups there.
* lib/vclib/bincvs/__init__.py
(_file_log):
change filtering so when matching revisions to tag, includes all
preceding revisions, not just tag revision itself
* lib/viewcvs.py
(_sticky_vars):
'only_with_tag' is gone, so change this back into a list with no
span-roots values
(request.run_viewcvs):
read new 'pathrev' parameter and use it when calling repos.itemtype
(request.get_link):
add 'pathrev' parameter to urls, restore update _sticky_vars loop
(_legal_params, prep_tags, build_commit):
replace 'only_with_tag' with 'pathrev'
(_orig_path):
new function
(nav_path, common_template_data):
stop adding 'rev' parameters to links
removed unused 'roots_href' template variable
(nav_header_data):
add new 'revision_href', 'orig_path', 'orig_href' template variables
for use in markup and annotate views
(view_markup, view_checkout, view_annotate, setup_diff, generate_tarball,
download_tarball):
use 'pathrev' when looking up file revision
(view_directory):
use 'pathrev' when looking up directory revisions instead of 'rev'.
stop adding 'rev' to links.
add template variables: pathrev, pathrev_action, pathrev_hidden_values.
remove unused template variables: num_files, rev, view_tag, has_tags,
main_href, jump_rev_action, jump_rev_hidden_values, row.show_log.
(view_log):
use 'pathrev' to retrieve log information instead of 'rev'.
stop linking to original paths of copied files.
add template variables: entry.orig_path, entry.orig_href, default_branch,
pathrev, pathrev_action, pathrev_hidden_values, branch_tags, plain_tags.
remove template variables: entry.filename, entry.prev_path,
branch, path_selected, view_tag, branch_names, branch_select_action,
branch_select_hidden_values.
(view_cvsgraph):
use common_template_data instead of nav_header_data, 'pathrev' instead
of 'only_with tag'
(view_diff):
use common_template_data instead of nav_header_data
add template variables: path_left, path_right
(view_revision):
use 'pathrev' instead of 'rev' in links
* templates/include/dir_header.ezt
rearrange header and add sticky tag/revision row
* templates/include/dir_footer.ezt
remove tag selector
* templates/include/pathrev_form.ezt
new, sticky tag/revision selector form based on code from
dir_footer.ezt
* templates/include/branch.ezt
* templates/include/branch_form.ezt
* templates/include/view_tag.ezt
removed
* templates/include/log_header.ezt
new, based on branch.ezt and view_tag.ezt
* templates/include/log_footer.ezt
new
* templates/include/log.ezt
* templates/include/log_table.ezt
include log_header.ezt and log_footer.ezt
* templates/include/annotate.ezt
* templates/include/diff.ezt
* templates/include/markup.ezt
show original paths and add view_revision links
* cvsgraph.conf.dist
replace only_with_tag parameter with pathrev
* website/template-authoring-guide.html
update template variable information
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1145 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-11-03 16:31:02 +03:00
|
|
|
branch = view_tag.number
|
|
|
|
elif len(view_tag.number) > 2:
|
|
|
|
branch = view_tag.number[:-1]
|
|
|
|
else:
|
|
|
|
branch = ()
|
|
|
|
|
|
|
|
# for a normal tag, include all tag revision and all preceding revisions.
|
|
|
|
# for a branch tag, include revisions on branch, branch point revision,
|
|
|
|
# and all preceding revisions
|
|
|
|
for rev in revs:
|
|
|
|
if (rev.number == view_tag.number
|
|
|
|
or rev.branch_number == view_tag.number
|
|
|
|
or (rev.number < view_tag.number
|
|
|
|
and rev.branch_number == branch[:len(rev.branch_number)])):
|
|
|
|
filtered_revs.append(rev)
|
2004-01-22 04:48:59 +03:00
|
|
|
|
|
|
|
# get rid of the view_tag if it was only created for filtering
|
|
|
|
if view_tag.name is None:
|
2004-01-25 22:06:53 +03:00
|
|
|
_remove_tag(view_tag)
|
2004-01-22 04:48:59 +03:00
|
|
|
else:
|
|
|
|
filtered_revs = revs
|
|
|
|
|
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 22:25:30 +03:00
|
|
|
return filtered_revs
|
2004-01-22 04:48:59 +03:00
|
|
|
|
2008-02-06 22:22:53 +03:00
|
|
|
def _get_logs(repos, dir_path_parts, entries, view_tag, get_dirs):
|
2002-04-13 13:43:22 +04:00
|
|
|
alltags = { # all the tags seen in the files of this dir
|
2003-10-23 22:59:06 +04:00
|
|
|
'MAIN' : '',
|
|
|
|
'HEAD' : '1.1'
|
2002-04-13 13:43:22 +04:00
|
|
|
}
|
|
|
|
|
2003-10-24 06:52:05 +04:00
|
|
|
entries_idx = 0
|
|
|
|
entries_len = len(entries)
|
|
|
|
max_args = 100
|
|
|
|
|
|
|
|
while 1:
|
|
|
|
chunk = []
|
|
|
|
|
|
|
|
while len(chunk) < max_args and entries_idx < entries_len:
|
|
|
|
entry = entries[entries_idx]
|
2008-02-06 22:22:53 +03:00
|
|
|
path = _log_path(entry, repos._getpath(dir_path_parts), get_dirs)
|
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 22:25:30 +03:00
|
|
|
if path:
|
|
|
|
entry.path = path
|
2003-11-04 07:52:08 +03:00
|
|
|
entry.idx = entries_idx
|
2003-10-24 06:52:05 +04:00
|
|
|
chunk.append(entry)
|
2002-04-13 13:43:22 +04:00
|
|
|
|
2004-07-31 18:38:03 +04:00
|
|
|
# set properties even if we don't retrieve logs
|
2008-02-22 00:59:45 +03:00
|
|
|
entry.rev = entry.date = entry.author = None
|
|
|
|
entry.dead = entry.log = entry.lockinfo = None
|
2003-10-24 06:52:05 +04:00
|
|
|
|
2003-11-04 07:52:08 +03:00
|
|
|
entries_idx = entries_idx + 1
|
|
|
|
|
2003-10-24 06:52:05 +04:00
|
|
|
if not chunk:
|
2004-01-25 21:37:42 +03:00
|
|
|
return alltags
|
2003-10-24 06:52:05 +04:00
|
|
|
|
|
|
|
args = []
|
2002-04-13 13:43:22 +04:00
|
|
|
if not view_tag:
|
|
|
|
# NOTE: can't pass tag on command line since a tag may contain "-"
|
|
|
|
# we'll search the output for the appropriate revision
|
|
|
|
# fetch the latest revision on the default branch
|
2003-10-24 06:52:05 +04:00
|
|
|
args.append('-r')
|
|
|
|
args.extend(map(lambda x: x.path, chunk))
|
2004-01-22 06:46:30 +03:00
|
|
|
rlog = repos.rcs_popen('rlog', args, 'rt')
|
2002-04-13 13:43:22 +04:00
|
|
|
|
2003-10-22 07:40:07 +04:00
|
|
|
# consume each file found in the resulting log
|
2004-07-31 18:38:03 +04:00
|
|
|
chunk_idx = 0
|
|
|
|
while chunk_idx < len(chunk):
|
|
|
|
file = chunk[chunk_idx]
|
2008-02-12 22:41:19 +03:00
|
|
|
filename, default_branch, taginfo, lockinfo, msg, eof \
|
|
|
|
= _parse_log_header(rlog)
|
2003-10-22 07:40:07 +04:00
|
|
|
|
|
|
|
if eof == _EOF_LOG:
|
2004-07-31 18:38:03 +04:00
|
|
|
# the rlog output ended early. this can happen on errors that rlog
|
|
|
|
# thinks are so serious that it stops parsing the current file and
|
|
|
|
# refuses to parse any of the files that come after it. one of the
|
|
|
|
# errors that triggers this obnoxious behavior looks like:
|
2003-11-04 07:52:08 +03:00
|
|
|
#
|
|
|
|
# rlog: c:\cvsroot\dir\file,v:8: unknown expand mode u
|
|
|
|
# rlog aborted
|
|
|
|
|
2004-07-31 18:38:03 +04:00
|
|
|
# if current file has errors, restart on the next one
|
2004-12-03 23:44:56 +03:00
|
|
|
if file.errors:
|
2004-07-31 18:38:03 +04:00
|
|
|
chunk_idx = chunk_idx + 1
|
|
|
|
if chunk_idx < len(chunk):
|
|
|
|
entries_idx = chunk[chunk_idx].idx
|
2003-11-04 07:52:08 +03:00
|
|
|
break
|
|
|
|
|
2004-07-31 18:38:03 +04:00
|
|
|
# otherwise just error out
|
2003-10-24 06:52:05 +04:00
|
|
|
raise vclib.Error('Rlog output ended early. Expected RCS file "%s"'
|
|
|
|
% file.path)
|
2003-10-22 07:40:07 +04:00
|
|
|
|
2004-07-31 18:38:03 +04:00
|
|
|
# if rlog filename doesn't match current file and we already have an
|
|
|
|
# error message about this file, move on to the next file
|
2004-10-14 06:00:34 +04:00
|
|
|
while not (file and _paths_eq(file.path, filename)):
|
2004-12-03 23:44:56 +03:00
|
|
|
if file and file.errors:
|
2004-07-31 18:38:03 +04:00
|
|
|
chunk_idx = chunk_idx + 1
|
|
|
|
file = chunk_idx < len(chunk) and chunk[chunk_idx] or None
|
|
|
|
continue
|
2003-10-22 07:40:07 +04:00
|
|
|
|
2004-07-31 18:38:03 +04:00
|
|
|
raise vclib.Error('Error parsing rlog output. Expected RCS file %s'
|
|
|
|
', found %s' % (file and file.path, filename))
|
2003-10-22 07:40:07 +04:00
|
|
|
|
2004-07-31 18:38:03 +04:00
|
|
|
# if we get an rlog error message, restart loop without advancing
|
|
|
|
# chunk_idx cause there might be more output about the same file
|
|
|
|
if eof == _EOF_ERROR:
|
2004-12-03 23:44:56 +03:00
|
|
|
file.errors.append("rlog error: %s" % msg)
|
2003-10-22 07:40:07 +04:00
|
|
|
continue
|
|
|
|
|
2011-05-05 18:36:27 +04:00
|
|
|
tag = None
|
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 03:50:17 +03:00
|
|
|
if view_tag == 'MAIN' or view_tag == 'HEAD':
|
|
|
|
tag = Tag(None, default_branch)
|
|
|
|
elif taginfo.has_key(view_tag):
|
|
|
|
tag = Tag(None, taginfo[view_tag])
|
2011-05-05 18:36:27 +04:00
|
|
|
elif view_tag and (eof != _EOF_FILE):
|
|
|
|
# the tag wasn't found, so skip this file (unless we already
|
|
|
|
# know there's nothing left of it to read)
|
2004-01-25 22:06:53 +03:00
|
|
|
_skip_file(rlog)
|
2011-05-05 18:36:27 +04:00
|
|
|
eof = _EOF_FILE
|
2003-10-22 07:40:07 +04:00
|
|
|
|
2003-10-23 22:59:06 +04:00
|
|
|
# we don't care about the specific values -- just the keys and whether
|
|
|
|
# the values point to branches or revisions. this the fastest way to
|
|
|
|
# merge the set of keys and keep values that allow us to make the
|
|
|
|
# distinction between branch tags and normal tags
|
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 03:50:17 +03:00
|
|
|
alltags.update(taginfo)
|
2003-10-22 07:40:07 +04:00
|
|
|
|
|
|
|
# read all of the log entries until we find the revision we want
|
2003-12-10 14:50:44 +03:00
|
|
|
wanted_entry = None
|
2004-07-31 18:38:03 +04:00
|
|
|
while not eof:
|
2003-10-22 07:40:07 +04:00
|
|
|
|
|
|
|
# fetch one of the log entries
|
2004-01-25 22:06:53 +03:00
|
|
|
entry, eof = _parse_log_entry(rlog)
|
2003-10-22 07:40:07 +04:00
|
|
|
|
|
|
|
if not entry:
|
|
|
|
# parsing error
|
|
|
|
break
|
|
|
|
|
2003-12-10 14:50:44 +03:00
|
|
|
# A perfect match is a revision on the branch being viewed or
|
|
|
|
# a revision having the tag being viewed or any revision
|
|
|
|
# when nothing is being viewed. When there's a perfect match
|
|
|
|
# we set the wanted_entry value and break out of the loop.
|
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 03:50:17 +03:00
|
|
|
# An imperfect match is a revision at the branch point of a
|
2003-12-10 14:50:44 +03:00
|
|
|
# branch being viewed. When there's an imperfect match we
|
|
|
|
# also set the wanted_entry value but keep looping in case
|
|
|
|
# something better comes along.
|
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 03:50:17 +03:00
|
|
|
perfect = not tag or entry.number == tag.number or \
|
|
|
|
(len(entry.number) == 2 and not tag.number) or \
|
|
|
|
entry.number[:-1] == tag.number
|
2004-10-30 08:45:36 +04:00
|
|
|
if perfect or entry.number == tag.number[:-1]:
|
2003-12-10 14:50:44 +03:00
|
|
|
wanted_entry = entry
|
|
|
|
if perfect:
|
|
|
|
break
|
2003-10-22 07:40:07 +04:00
|
|
|
|
2003-12-10 14:50:44 +03:00
|
|
|
if wanted_entry:
|
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 03:50:17 +03:00
|
|
|
file.rev = wanted_entry.string
|
2003-12-10 14:50:44 +03:00
|
|
|
file.date = wanted_entry.date
|
|
|
|
file.author = wanted_entry.author
|
Handle CVS Attic paths transparently in the bincvs module
instead of exposing them to users.
* templates/include/dir_footer.ezt
add link to show dead files
* templates/directory.ezt
remove code for detecting Attic entries,
change (in the attic) caption to (dead)
* lib/viewcvs.py
(Request.run_viewcvs):
handle old Attic URL's by redirecting,
remove unused request.full_name member
(get_up_path, _re_up_attic_path, nav_header_data, generate_tarball,
download_tarball):
remove code for handling Attic directories
(view_markup):
remove unused "full_name" variable
(view_directory):
remove code for handling Attic directories,
replace "no_match" template variable with "num_dead"
(view_log):
update call to get_up_path
(view_annotate, view_cvsgraph_image, view_cvsgraph, view_diff):
use CVSRepository.rcsfile to get path to rcs file
* lib/vclib/bincvs/__init__.py
(CVSRepository.itemtype):
look in Attic for repository files
(CVSRepository.listdir):
remove "cvs_list_attic" option, now always list attic files.
leave "Attic" and "CVS" directories out of returned listing.
(CVSRepository.rcsfile, CVSRepository._atticpath):
new methods
(BinCVSRepository.openfile, BinCVSRepository.filelog):
use CVSRepository.rcsfile to get path to rcs file
(_get_logs):
don't mark directories as dead
* lib/vclib/ccvs/__init__.py
(CCVSRepository.filelog, CCVSRepository.openfile):
use CVSRepository.rcsfile to get path to rcs file
* website/upgrading.html
document "no_match" and "num_dead" template variables
git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@908 8cb11bc2-c004-0410-86c3-e597b4017df7
2004-08-01 02:34:51 +04:00
|
|
|
file.dead = file.kind == vclib.FILE and wanted_entry.dead
|
2008-08-21 17:37:46 +04:00
|
|
|
file.absent = 0
|
2003-12-10 14:50:44 +03:00
|
|
|
file.log = wanted_entry.log
|
2008-02-13 00:06:40 +03:00
|
|
|
file.lockinfo = lockinfo.get(file.rev)
|
2004-07-31 18:38:03 +04:00
|
|
|
# suppress rlog errors if we find a usable revision in the end
|
2004-12-03 23:44:56 +03:00
|
|
|
del file.errors[:]
|
2004-07-31 18:38:03 +04:00
|
|
|
elif file.kind == vclib.FILE:
|
2008-08-21 17:37:46 +04:00
|
|
|
file.dead = 0
|
|
|
|
#file.errors.append("No revisions exist on %s" % (view_tag or "MAIN"))
|
|
|
|
file.absent = 1
|
|
|
|
|
2003-12-10 14:50:44 +03:00
|
|
|
# done with this file now, skip the rest of this file's revisions
|
|
|
|
if not eof:
|
2004-01-25 22:06:53 +03:00
|
|
|
_skip_file(rlog)
|
2003-12-10 14:50:44 +03:00
|
|
|
|
2004-07-31 18:38:03 +04:00
|
|
|
# end of while loop, advance index
|
|
|
|
chunk_idx = chunk_idx + 1
|
|
|
|
|
2003-11-04 07:52:08 +03:00
|
|
|
rlog.close()
|
2002-04-13 13:43:22 +04:00
|
|
|
|
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 22:25:30 +03:00
|
|
|
def _log_path(entry, dirpath, getdirs):
|
|
|
|
path = name = None
|
2004-12-03 23:44:56 +03:00
|
|
|
if not entry.errors:
|
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 22:25:30 +03:00
|
|
|
if entry.kind == vclib.FILE:
|
|
|
|
path = entry.in_attic and 'Attic' or ''
|
|
|
|
name = entry.name
|
2004-10-16 06:32:32 +04:00
|
|
|
elif entry.kind == vclib.DIR and getdirs:
|
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 22:25:30 +03:00
|
|
|
entry.newest_file = _newest_file(os.path.join(dirpath, entry.name))
|
|
|
|
if entry.newest_file:
|
|
|
|
path = entry.name
|
|
|
|
name = entry.newest_file
|
|
|
|
|
|
|
|
if name:
|
2004-12-03 23:44:56 +03:00
|
|
|
return os.path.join(dirpath, path, name + ',v')
|
|
|
|
return None
|
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 22:25:30 +03:00
|
|
|
|
2002-04-13 13:43:22 +04:00
|
|
|
|
2004-01-22 06:46:30 +03:00
|
|
|
# ======================================================================
|
|
|
|
# Functions for dealing with the filesystem
|
|
|
|
|
2003-10-24 04:03:48 +04:00
|
|
|
if sys.platform == "win32":
|
|
|
|
def _check_path(path):
|
|
|
|
kind = None
|
2004-12-03 23:44:56 +03:00
|
|
|
errors = []
|
|
|
|
|
2003-10-24 04:03:48 +04:00
|
|
|
if os.path.isfile(path):
|
|
|
|
kind = vclib.FILE
|
|
|
|
elif os.path.isdir(path):
|
|
|
|
kind = vclib.DIR
|
2004-12-03 23:44:56 +03:00
|
|
|
else:
|
|
|
|
errors.append("error: path is not a file or directory")
|
|
|
|
|
|
|
|
if not os.access(path, os.R_OK):
|
|
|
|
errors.append("error: path is not accessible")
|
|
|
|
|
|
|
|
return kind, errors
|
2003-10-24 04:03:48 +04:00
|
|
|
|
|
|
|
else:
|
|
|
|
_uid = os.getuid()
|
|
|
|
_gid = os.getgid()
|
|
|
|
|
|
|
|
def _check_path(pathname):
|
|
|
|
try:
|
|
|
|
info = os.stat(pathname)
|
2004-12-03 23:44:56 +03:00
|
|
|
except os.error, e:
|
2004-12-04 04:57:13 +03:00
|
|
|
return None, ["stat error: %s" % e]
|
2004-12-03 23:44:56 +03:00
|
|
|
|
|
|
|
kind = None
|
|
|
|
errors = []
|
2003-10-24 04:03:48 +04:00
|
|
|
|
|
|
|
mode = info[stat.ST_MODE]
|
|
|
|
isdir = stat.S_ISDIR(mode)
|
|
|
|
isreg = stat.S_ISREG(mode)
|
|
|
|
if isreg or isdir:
|
|
|
|
#
|
|
|
|
# Quick version of access() where we use existing stat() data.
|
|
|
|
#
|
|
|
|
# This might not be perfect -- the OS may return slightly different
|
|
|
|
# results for some bizarre reason. However, we make a good show of
|
|
|
|
# "can I read this file/dir?" by checking the various perm bits.
|
|
|
|
#
|
|
|
|
# NOTE: if the UID matches, then we must match the user bits -- we
|
|
|
|
# cannot defer to group or other bits. Similarly, if the GID matches,
|
|
|
|
# then we must have read access in the group bits.
|
|
|
|
#
|
|
|
|
# If the UID or GID don't match, we need to check the
|
|
|
|
# results of an os.access() call, in case the web server process
|
|
|
|
# is in the group that owns the directory.
|
|
|
|
#
|
|
|
|
if isdir:
|
|
|
|
mask = stat.S_IROTH | stat.S_IXOTH
|
|
|
|
else:
|
|
|
|
mask = stat.S_IROTH
|
|
|
|
|
|
|
|
if info[stat.ST_UID] == _uid:
|
|
|
|
if ((mode >> 6) & mask) != mask:
|
2004-12-03 23:44:56 +03:00
|
|
|
errors.append("error: path is not accessible to user %i" % _uid)
|
2003-10-24 04:03:48 +04:00
|
|
|
elif info[stat.ST_GID] == _gid:
|
|
|
|
if ((mode >> 3) & mask) != mask:
|
2004-12-03 23:44:56 +03:00
|
|
|
errors.append("error: path is not accessible to group %i" % _gid)
|
2003-10-24 04:03:48 +04:00
|
|
|
# If the process running the web server is a member of
|
|
|
|
# the group stat.ST_GID access may be granted.
|
|
|
|
# so the fall back to os.access is needed to figure this out.
|
2003-10-27 22:46:31 +03:00
|
|
|
elif (mode & mask) != mask:
|
|
|
|
if not os.access(pathname, isdir and (os.R_OK | os.X_OK) or os.R_OK):
|
2004-12-03 23:44:56 +03:00
|
|
|
errors.append("error: path is not accessible")
|
2003-10-24 04:03:48 +04:00
|
|
|
|
|
|
|
if isdir:
|
|
|
|
kind = vclib.DIR
|
|
|
|
else:
|
|
|
|
kind = vclib.FILE
|
|
|
|
|
2004-12-03 23:44:56 +03:00
|
|
|
else:
|
|
|
|
errors.append("error: path is not a file or directory")
|
2003-10-24 04:03:48 +04:00
|
|
|
|
2004-12-03 23:44:56 +03:00
|
|
|
return kind, errors
|
2003-10-24 04:03:48 +04:00
|
|
|
|
2004-01-22 06:46:30 +03:00
|
|
|
def _newest_file(dirpath):
|
|
|
|
"""Find the last modified RCS file in a directory"""
|
|
|
|
newest_file = None
|
|
|
|
newest_time = 0
|
2003-10-22 07:40:07 +04:00
|
|
|
|
2008-02-06 22:22:53 +03:00
|
|
|
### FIXME: This sucker is leaking unauthorized paths! ###
|
|
|
|
|
2004-01-22 06:46:30 +03:00
|
|
|
for subfile in os.listdir(dirpath):
|
|
|
|
### filter CVS locks? stale NFS handles?
|
|
|
|
if subfile[-2:] != ',v':
|
|
|
|
continue
|
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 22:05:08 +03:00
|
|
|
path = os.path.join(dirpath, subfile)
|
|
|
|
info = os.stat(path)
|
2004-01-22 06:46:30 +03:00
|
|
|
if not stat.S_ISREG(info[stat.ST_MODE]):
|
|
|
|
continue
|
|
|
|
if info[stat.ST_MTIME] > newest_time:
|
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 22:05:08 +03:00
|
|
|
kind, verboten = _check_path(path)
|
|
|
|
if kind == vclib.FILE and not verboten:
|
|
|
|
newest_file = subfile[:-2]
|
|
|
|
newest_time = info[stat.ST_MTIME]
|
2003-10-24 09:13:38 +04:00
|
|
|
|
2004-01-22 06:46:30 +03:00
|
|
|
return newest_file
|