"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "bin/loginfo-handler" between
viewvc-1.1.28.tar.gz and viewvc-1.2.1.tar.gz

About: ViewVC is a browser interface for CVS and Subversion version control repositories.

loginfo-handler  (viewvc-1.1.28):loginfo-handler  (viewvc-1.2.1)
skipping to change at line 42 skipping to change at line 42
import os import os
if LIBRARY_DIR: if LIBRARY_DIR:
sys.path.insert(0, LIBRARY_DIR) sys.path.insert(0, LIBRARY_DIR)
else: else:
sys.path.insert(0, os.path.abspath(os.path.join(sys.argv[0], "../../lib"))) sys.path.insert(0, os.path.abspath(os.path.join(sys.argv[0], "../../lib")))
######################################################################### #########################################################################
import os import os
import string
import getopt import getopt
import re import re
import cvsdb import cvsdb
import viewvc import viewvc
import vclib.ccvs import vclib.ccvs
DEBUG_FLAG = 0 DEBUG_FLAG = 0
## output functions ## output functions
def debug(text): def debug(text):
skipping to change at line 155 skipping to change at line 154
if start == len(s): break if start == len(s): break
return directory, file_data_list return directory, file_data_list
def FindLongestDirectory(s, repository): def FindLongestDirectory(s, repository):
"""Splits the first part of the argument string into a directory name """Splits the first part of the argument string into a directory name
and a file name, either of which may contain spaces. Returns the longest and a file name, either of which may contain spaces. Returns the longest
possible directory name that actually exists""" possible directory name that actually exists"""
parts = string.split(s, " ") parts = s.split()
for i in range(len(parts)-1, 0, -1): for i in range(len(parts)-1, 0, -1):
directory = string.join(parts[:i]) directory = ' '.join(parts[:i])
filename = string.join(parts[i:]) filename = ' '.join(parts[i:])
if os.path.isdir(os.path.join(repository, directory)): if os.path.isdir(os.path.join(repository, directory)):
return directory, filename return directory, filename
return None, None return None, None
_re_cvsnt_revisions = re.compile( _re_cvsnt_revisions = re.compile(
r"(?P<filename>.*)" # comma and first revision r"(?P<filename>.*)" # comma and first revision
r",(?P<old>(?:\d+\.\d+)(?:\.\d+\.\d+)*|NONE)" # comma and first revision r",(?P<old>(?:\d+\.\d+)(?:\.\d+\.\d+)*|NONE)" # comma and first revision
r",(?P<new>(?:\d+\.\d+)(?:\.\d+\.\d+)*|NONE)" # comma and second revision r",(?P<new>(?:\d+\.\d+)(?:\.\d+\.\d+)*|NONE)" # comma and second revision
r"$" # end of string r"$" # end of string
skipping to change at line 230 skipping to change at line 229
return ret or None, i return ret or None, i
def ProcessLoginfo(rootpath, directory, files): def ProcessLoginfo(rootpath, directory, files):
cfg = viewvc.load_config(CONF_PATHNAME) cfg = viewvc.load_config(CONF_PATHNAME)
db = cvsdb.ConnectDatabase(cfg) db = cvsdb.ConnectDatabase(cfg)
repository = vclib.ccvs.CVSRepository(None, rootpath, None, repository = vclib.ccvs.CVSRepository(None, rootpath, None,
cfg.utilities, 0) cfg.utilities, 0)
# split up the directory components # split up the directory components
dirpath = filter(None, string.split(os.path.normpath(directory), os.sep)) dirpath = filter(None, os.path.normpath(directory).split(os.sep))
## build a list of Commit objects ## build a list of Commit objects
commit_list = [] commit_list = []
for filename, old_version, new_version in files: for filename, old_version, new_version in files:
filepath = dirpath + [filename] filepath = dirpath + [filename]
## XXX: this is nasty: in the case of a removed file, we are not ## XXX: this is nasty: in the case of a removed file, we are not
## given enough information to find it in the rlog output! ## given enough information to find it in the rlog output!
## So instead, we rlog everything in the removed file, and ## So instead, we rlog everything in the removed file, and
## add any commits not already in the database ## add any commits not already in the database
skipping to change at line 281 skipping to change at line 280
# ALL <path>/bin/loginfo-handler %p %{sVv} # ALL <path>/bin/loginfo-handler %p %{sVv}
if argc > 3: if argc > 3:
directory, files = Cvs1Dot12ArgParse(sys.argv[1:]) directory, files = Cvs1Dot12ArgParse(sys.argv[1:])
else: else:
if len(sys.argv) > 1: if len(sys.argv) > 1:
# the first argument should contain file version information # the first argument should contain file version information
arg = sys.argv[1] arg = sys.argv[1]
else: else:
# if there are no arguments, read version information from # if there are no arguments, read version information from
# first line of input like old versions of ViewCVS did # first line of input like old versions of ViewCVS did
arg = string.rstrip(sys.stdin.readline()) arg = sys.stdin.readline().rstrip()
if len(sys.argv) > 2: if len(sys.argv) > 2:
# if there is a second argument it indicates which parser # if there is a second argument it indicates which parser
# should be used to interpret the version information # should be used to interpret the version information
if sys.argv[2] == 'cvs': if sys.argv[2] == 'cvs':
fun = HeuristicArgParse fun = HeuristicArgParse
elif sys.argv[2] == 'cvsnt': elif sys.argv[2] == 'cvsnt':
fun = CvsNtArgParse fun = CvsNtArgParse
else: else:
error('Bad arguments') error('Bad arguments')
 End of changes. 5 change blocks. 
6 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)