1
0
mirror of https://github.com/vitalif/viewvc-4intranet synced 2019-04-16 04:14:59 +03:00

Compare commits

..

2 Commits
0.9.0 ... 0.8.0

Author SHA1 Message Date
cmpilato
16f7a07427 Tag rename: V0_8 -> 0.8.0
git-svn-id: http://viewvc.tigris.org/svn/viewvc/tags/0.8.0@1320 8cb11bc2-c004-0410-86c3-e597b4017df7
2006-04-06 19:20:53 +00:00
(no author)
dd4b0785a4 This commit was manufactured by cvs2svn to create tag 'V0_8'.
git-svn-id: http://viewvc.tigris.org/svn/viewvc/tags/V0_8@376 8cb11bc2-c004-0410-86c3-e597b4017df7
2001-12-10 13:45:35 +00:00
29 changed files with 754 additions and 2420 deletions

24
CHANGES
View File

@@ -1,27 +1,3 @@
Version 0.9 (released 23-Dec-2001)
* create templates for the rest of the pages: markup pages, graphs,
annotation, and diff.
* add multiple language support and dynamic selection based on the
Accept-Language request header
* add support for key/value files to provide a way for user-defined
variables within templates
* add optional regex searching for file contents
* add new templates for the navigation header and the footer
* EZT changes:
- add formatting into print directives
- add parameters to [include] directives
- relax what can go in double quotes
- [include] directives are now relative to the current template
- throw an exception for unclosed blocks
* changes to standalone.py: add flag for regex search
* add more help pages
* change installer to optionally show diffs
* fix to log.ezt and log_table.ezt to select "Side by Side" properly
* create dir_alternate.ezt for the flipped rev/name links
* various UI tweaks for the directory pages
Version 0.8 (released 10-Dec-2001)
* add EZT templating mechanism for generating output pages

View File

@@ -136,75 +136,6 @@ forbidden =
# forbidden = !xml, x*, !*
#
#
# This option provides a mechanism for custom key/value pairs to be
# available to templates. These are stored in key/value files (KV files).
#
# Pathnames to the KV files are listed here, specified as absolute paths
# or relative to this configuration file. The kV files follow the same
# format as this configuration file. It may have multiple, user-defined
# sections, and user-defined options in those sections. These are all
# placed into a structure available to the templates as:
#
# kv.SECTION.OPTION
#
# Note that an option name can be dotted. For example:
#
# [my_images]
# logos.small = /images/small-logo.png
# logos.big = /images/big-logo.png
#
# Templates can use these with a directive like: [kv.my_images.logos.small]
#
# Note that sections across multiple files will be merged. If two files
# have a [my_images] section, then the options will be merged together.
# If two files have the same option name in a section, then one will
# overwrite the other (it is unspecified regarding which "wins").
#
# To further categorize the KV files, and how the values are provided to
# the templates, a KV file name may be annotated with an additional level
# of dotted naming. For example:
#
# kv_files = [asf]kv/images.conf
#
# Assuming the same section as above, the template would refer to an image
# using [kv.asf.my_images.logos.small]
#
# Lastly, it is possible to use %lang% in the filenames to specify a
# substitution of the selected language-tag.
#
kv_files =
# example:
# kv_files = kv/file1.conf, kv/file2.conf, [i18n]kv/%lang%_data.conf
#
#
# The languages available to ViewCVS. There are several i18n mechanisms
# available:
#
# 1) using key/value extension system and reading KV files based on
# the selected language
# 2) GNU gettext to substitute text in the templates
# 3) using different templates, based on the selected language
#
# ### NOTE: at the moment, the GNU gettext style is not implemented
#
# This option is a comma-separated list of language-tag values. The first
# language-tag listed is the default language, and will be used if an
# Accept-Language header is not present in the request, or none of the
# user's requested languages are available. If there are ties on the
# selection of a language, then the first to appear in the list is chosen.
#
languages = en-us
# other examples:
#
# languages = en-us, de
# languages = en-us, en-gb, de
# languages = de, fr, en-us
#
#---------------------------------------------------------------------------
[templates]
@@ -212,31 +143,13 @@ languages = en-us
# The templates are specified relative to the configuration file. Absolute
# paths may be used, if you want to keep these elsewhere.
#
# If %lang% occurs in the pathname, then the selected language will be
# substituted.
#
# Note: the selected language is defined by the "languages" item in the
# [general] section, and based on the request's Accept-Language
# header.
#
query = templates/query.ezt
footer = templates/footer.ezt
diff = templates/diff.ezt
graph = templates/graph.ezt
annotate = templates/annotate.ezt
markup = templates/markup.ezt
directory = templates/directory.ezt
# For an alternate form, where the first column displays a revision number
# and brings you to the log view (and the filename displays the HEAD), then
# you may use this template:
# directory = templates/dir_alternate.ezt
log = templates/log.ezt
# For a log view where the revisions are displayed in a table, you may
# want to try this template:
# There is also a new style table based alternative template available.
# You might want to try it out:
# log = templates/log_table.ezt
query = templates/query.ezt
#---------------------------------------------------------------------------
[cvsdb]
@@ -249,6 +162,59 @@ log = templates/log.ezt
#readonly_passwd =
#row_limit = 1000
#---------------------------------------------------------------------------
[images]
#
# All images are defined with three values: URL, WIDTH, HEIGHT
#
#
# these icons represent a back-pointer, a directory (folder), and a file.
# they are normally available in a standard Apache distribution, along
# with larger versions if these are too small for you.
#
back_icon = /icons/small/back.gif, 16, 16
dir_icon = /icons/small/dir.gif, 16, 16
file_icon = /icons/small/text.gif, 16, 16
#---------------------------------------------------------------------------
[colors]
# background color of log entry in markup
markup_log = #ffffff
# The following six colors are used together:
# color of change-section headings in a diff (default turquoise)
diff_heading = #99cccc
# color of "empty" lines (default light gray)
diff_empty = #cccccc
# removed lines (default light red)
diff_remove = #ffaaaa
# changed lines (default light yellow)
diff_change = #ffff77
# added lines (default light green)
diff_add = #aaffaa
# empty lines in a change block (if one part smaller is than the other;
# default is a greyish yellow: the color should match the hue of 'diff_change')
diff_dark_change = #eeee77
# navigation header (in diff screen, file view, annotation, etc)
nav_header = #9999ee
# color of text on most pages
text = #000000
# color of standard background
background = #ffffff
# color of alternate background (diffs, file view, annotations, etc)
alt_background = #eeeeee
#---------------------------------------------------------------------------
[options]
### DOC
@@ -261,9 +227,9 @@ log = templates/log.ezt
# log Sort by log message
sort_by = file
# hide_attic: Hide or show the contents of the Attic subdirectory
# 1 Hide dead files inside Attic subdir
# 0 Show the files which are inside the Attic subdir
# hide_attic: Hide or show files in Attic
# 1 Hide files in Attic
# 0 Show files in Attic
hide_attic = 1
# log_sort: Sort order for CVS logs
@@ -285,6 +251,14 @@ diff_format = h
# 0 Show CVSROOT directory
hide_cvsroot = 1
# hide_non_readable: Don't show entries which cannot be read
# 1 Hide non-readable entries
# 0 Show non-readble entries
hide_non_readable = 1
# Show author of last change
show_author = 1
# set to 1 to make lines break at spaces,
# set to 0 to make no-break lines,
# set to a positive integer to make the lines cut at that length
@@ -317,6 +291,14 @@ allow_markup = 1
# [make sure to have gzip in the path]
allow_compress = 1
# Make use of javascript functions to skip the need for submitting a form.
# For example, this way you can select one of your CVS roots without
# pressing 'Go' (... if you have more than one CVSROOT defined)
use_java_script = 1
# open Download-Links in another window
open_extern_window = 1
# If you have files which automatically refers to other files
# (such as HTML) then this allows you to browse the checked
# out files as if outside CVS.
@@ -332,6 +314,15 @@ checkout_magic = 1
# Enable this if you like the feature, but don't rely on correct results.
show_subdir_lastmod = 0
# The next flag defines the meaning of clicking on either a filename or
# the revision number of that file in the directory view. if 0 then
# the traditional behavior applies: clicking on the name takes you to the
# CVS log page, where clicking on the revision number displays that revision.
# If the flag is set to 1 then both columns will be swapped and the meaning
# of clicking is also exchanged. This should be more intuitive to new users.
# The classic setting is default:
flip_links_in_dirview = 0
# show a portion of the most recent log entry in directory listings
show_logs = 1
@@ -401,31 +392,6 @@ cvsgraph_path =
#
cvsgraph_conf = <VIEWCVS_INSTALL_DIRECTORY>/cvsgraph.conf
#
# Set to enable regular expression search of all files in a directory
#
# WARNING:
#
# Enabling this option can consume HUGE amounts of server time. A
# "checkout" must be performed on *each* file in a directory, and
# the result needs to be searched for a match against the regular
# expression.
#
#
# SECURITY WARNING: Denial Of Service
#
# Since a user can enter the regular expression, it is possible for
# them to enter an expression with many alternatives and a lot of
# backtracking. Executing that search over thousands of lines over
# dozens of files can easily tie up a server for a long period of
# time.
#
# This option should only be used on sites with trusted users. It is
# highly inadvisable to use this on a public site.
#
use_re_search = 0
# use_re_search = 1
#---------------------------------------------------------------------------
[vhosts]
### DOC

View File

@@ -1,190 +0,0 @@
# -*-python-*-
#
# Copyright (C) 1999-2001 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewCVS
# distribution or at http://viewcvs.sourceforge.net/license-1.html.
#
# Contact information:
# Greg Stein, PO Box 760, Palo Alto, CA, 94302
# gstein@lyra.org, http://viewcvs.sourceforge.net/
#
# -----------------------------------------------------------------------
#
# accept.py: parse/handle the various Accept headers from the client
#
# -----------------------------------------------------------------------
#
import re
import string
def language(hdr):
"Parse an Accept-Language header."
# parse the header, storing results in a _LanguageSelector object
return _parse(hdr, _LanguageSelector())
# -----------------------------------------------------------------------
_re_token = re.compile(r'\s*([^\s;,"]+|"[^"]*")+\s*')
_re_param = re.compile(r';\s*([^;,"]+|"[^"]*")+\s*')
_re_split_param = re.compile(r'([^\s=])\s*=\s*(.*)')
def _parse(hdr, result):
# quick exit for empty or not-supplied header
if not hdr:
return result
pos = 0
while pos < len(hdr):
name = _re_token.match(hdr, pos)
if not name:
raise AcceptParseError()
a = result.item_class(string.lower(name.group(1)))
pos = name.end()
while 1:
# are we looking at a parameter?
match = _re_param.match(hdr, pos)
if not match:
break
param = match.group(1)
pos = match.end()
# split up the pieces of the parameter
match = _re_split_param.match(param)
if not match:
# the "=" was probably missing
continue
pname = string.lower(match.group(1))
if pname == 'q' or pname == 'qs':
try:
a.quality = float(match.group(2))
except ValueError:
# bad float literal
pass
elif pname == 'level':
try:
a.level = float(match.group(2))
except ValueError:
# bad float literal
pass
elif pname == 'charset':
a.charset = string.lower(match.group(2))
result.append(a)
if hdr[pos:pos+1] == ',':
pos = pos + 1
return result
class _AcceptItem:
def __init__(self, name):
self.name = name
self.quality = 1.0
self.level = 0.0
self.charset = ''
def __str__(self):
s = self.name
if self.quality != 1.0:
s = '%s;q=%.3f' % (s, self.quality)
if self.level != 0.0:
s = '%s;level=%.3f' % (s, self.level)
if self.charset:
s = '%s;charset=%s' % (s, self.charset)
return s
class _LanguageRange(_AcceptItem):
def matches(self, tag):
"Match the tag against self. Returns the qvalue, or None if non-matching."
if tag == self.name:
return self.quality
# are we a prefix of the available language-tag
name = self.name + '-'
if tag[:len(name)] == name:
return self.quality
return None
class _LanguageSelector:
item_class = _LanguageRange
def __init__(self):
self.requested = [ ]
def select_from(self, avail):
"""Select one of the available choices based on the request.
Note: if there isn't a match, then the first available choice is
considered the default.
avail is a list of language-tag strings of available languages
"""
# tuples of (qvalue, language-tag)
matches = [ ]
# try matching all pairs of desired vs available, recording the
# resulting qvalues. we also need to record the longest language-range
# that matches since the most specific range "wins"
for tag in avail:
longest = 0
final = 0.0
# check this tag against the requests from the user
for want in self.requested:
qvalue = want.matches(tag)
#print 'have %s. want %s. qvalue=%s' % (tag, want.name, qvalue)
if qvalue is not None and len(want.name) > longest:
# we have a match and it is longer than any we may have had
final = qvalue
longest = len(want.name)
# a non-zero qvalue is a potential match
if final:
matches.append((final, tag))
# if we have any matches, then look at the highest qvalue
if matches:
matches.sort()
qvalue, tag = matches[-1]
if len(matches) >= 2 and matches[-2][0] == qvalue:
#print "non-deterministic choice", avail
pass
# if the qvalue is non-zero, then we have a valid match
if qvalue:
return tag
# the qvalue is zero (non-match). drop thru to return the default
# return the default language tag
return avail[0]
def append(self, item):
self.requested.append(item)
class AcceptParseError(Exception):
pass
def _test():
s = language('en')
assert s.select_from(['en']) == 'en'
assert s.select_from(['en', 'de']) == 'en'
assert s.select_from(['de', 'en']) == 'en'
s = language('fr, de;q=0.9, en-gb;q=0.7, en;q=0.6, en-gb-foo;q=0.8')
assert s.select_from(['en']) == 'en'
assert s.select_from(['en-gb-foo']) == 'en-gb-foo'
assert s.select_from(['de', 'fr']) == 'fr'
assert s.select_from(['de', 'en-gb']) == 'de'
assert s.select_from(['en-gb', 'en-gb-foo']) == 'en-gb-foo'
assert s.select_from(['en-bar']) == 'en-bar'
assert s.select_from(['en-gb-bar', 'en-gb-foo']) == 'en-gb-foo'
# non-deterministic. en-gb;q=0.7 matches both avail tags.
#assert s.select_from(['en-gb-bar', 'en-gb']) == 'en-gb'

View File

@@ -41,9 +41,8 @@ import fnmatch
#########################################################################
class Config:
_sections = ('general', 'options', 'cvsdb', 'templates')
_force_multi_value = ('cvs_roots', 'forbidden', 'disable_enscript_lang',
'languages', 'kv_files')
_sections = ('general', 'images', 'options', 'colors', 'cvsdb', 'templates')
_force_multi_value = ('cvs_roots', 'forbidden', 'disable_enscript_lang')
def __init__(self):
for section in self._sections:
@@ -52,8 +51,6 @@ class Config:
def load_config(self, fname, vhost=None):
this_dir = os.path.dirname(sys.argv[0])
pathname = os.path.join(this_dir, fname)
self.base = os.path.dirname(pathname)
parser = ConfigParser.ConfigParser()
parser.read(pathname)
@@ -64,41 +61,12 @@ class Config:
if vhost and parser.has_section('vhosts'):
self._process_vhost(parser, vhost)
def load_kv_files(self, language):
kv = _sub_config()
for fname in self.general.kv_files:
if fname[0] == '[':
idx = string.index(fname, ']')
parts = string.split(fname[1:idx], '.')
fname = string.strip(fname[idx+1:])
else:
parts = [ ]
fname = string.replace(fname, '%lang%', language)
parser = ConfigParser.ConfigParser()
parser.read(os.path.join(self.base, fname))
for section in parser.sections():
for option in parser.options(section):
full_name = parts + [section]
ob = kv
for name in full_name:
try:
ob = getattr(ob, name)
except AttributeError:
c = _sub_config()
setattr(ob, name, c)
ob = c
setattr(ob, option, parser.get(section, option))
return kv
def _process_section(self, parser, section, subcfg_name):
sc = getattr(self, subcfg_name)
for opt in parser.options(section):
value = parser.get(section, opt)
if opt in self._force_multi_value:
if opt in self._force_multi_value or subcfg_name == 'images':
value = map(string.strip, filter(None, string.split(value, ',')))
else:
try:
@@ -152,17 +120,10 @@ class Config:
self.general.address = '<a href="mailto:user@insert.your.domain.here">No CVS admin address has been configured</a>'
self.general.main_title = 'CVS Repository'
self.general.forbidden = ()
self.general.kv_files = [ ]
self.general.languages = ['en-us']
self.templates.directory = 'templates/directory.ezt'
self.templates.log = 'templates/log.ezt'
self.templates.query = 'templates/query.ezt'
self.templates.footer = 'templates/footer.ezt'
self.templates.diff = 'templates/diff.ezt'
self.templates.graph = 'templates/graph.ezt'
self.templates.annotate = 'templates/annotate.ezt'
self.templates.markup = 'templates/markup.ezt'
self.cvsdb.enabled = 0
self.cvsdb.host = ''
@@ -173,11 +134,33 @@ class Config:
self.cvsdb.readonly_passwd = ''
self.cvsdb.row_limit = 1000
self.images.back_icon = "/icons/small/back.gif", 16, 16
self.images.dir_icon = "/icons/small/dir.gif", 16, 16
self.images.file_icon = "/icons/small/text.gif", 16, 16
self.colors.markup_log = "#ffffff"
self.colors.diff_heading = "#99cccc"
self.colors.diff_empty = "#cccccc"
# trafic light methaphor:
self.colors.diff_remove = "#ffaaaa" # red
self.colors.diff_change = "#ffff77" # yellow/orange
self.colors.diff_add = "#aaffaa" # green
self.colors.diff_dark_change = "#eeee77" # meets hue of diff_change
self.colors.nav_header = "#9999ee"
self.colors.text = "#000000"
self.colors.background = "#ffffff"
self.colors.alt_background = "#eeeeee"
self.options.sort_by = 'file'
self.options.hide_attic = 1
self.options.log_sort = 'date'
self.options.diff_format = 'h'
self.options.hide_cvsroot = 1
self.options.hide_non_readable = 1
self.options.show_author = 1
self.options.hr_breakable = 1
self.options.hr_funout = 1
self.options.hr_ignore_white = 1
@@ -185,8 +168,11 @@ class Config:
self.options.allow_annotate = 1
self.options.allow_markup = 1
self.options.allow_compress = 1
self.options.use_java_script = 1
self.options.open_extern_window = 1
self.options.checkout_magic = 1
self.options.show_subdir_lastmod = 0
self.options.flip_links_in_dirview = 0
self.options.show_logs = 1
self.options.show_log_in_markup = 1
self.options.py2html_path = '.'
@@ -200,7 +186,6 @@ class Config:
self.options.use_cvsgraph = 0
self.options.cvsgraph_path = ''
self.options.cvsgraph_conf = "<VIEWCVS_INSTALL_DIRECTORY>/cvsgraph.conf"
self.options.use_re_search = 0
def is_forbidden(self, module):
if not module:
@@ -216,7 +201,13 @@ class Config:
return default
class _sub_config:
pass
def get_image(self, which):
text = '[%s]' % string.upper(which)
path, width, height = getattr(self, which)
if path:
return '<img src="%s" alt="%s" border=0 width=%s height=%s>' % \
(path, text, width, height)
return text
if not hasattr(sys, 'hexversion'):
# Python 1.5 or 1.5.1. fix the syntax for ConfigParser options.

View File

@@ -12,22 +12,19 @@
#
# -----------------------------------------------------------------------
#
# Note: a t_start/t_end pair consumes about 0.00005 seconds on a P3/700.
# the lambda form (when debugging is disabled) should be even faster.
#
if 0:
import time
_timers = { }
_stack = [ ]
_times = { }
def t_start(which):
_timers[which] = time.time()
def t_start():
_stack.append(time.time())
def t_end(which):
t = time.time() - _timers[which]
t = time.time() - _stack.pop()
if _times.has_key(which):
_times[which] = _times[which] + t
else:

View File

@@ -147,15 +147,11 @@ Directives
import string
import re
from types import StringType, IntType, FloatType
import os
#
# This regular expression matches three alternatives:
# expr: DIRECTIVE | BRACKET | COMMENT
# DIRECTIVE: '[' ITEM (whitespace ITEM)* ']
# ITEM: STRING | NAME
# STRING: '"' (not-slash-or-dquote | '\' anychar)* '"'
# NAME: (alphanum | '_' | '-' | '.')+
# DIRECTIVE: '[' ('-' | '.' | ' ' | '"' | '/' | alphanum)+ ']
# BRACKET: '[[]'
# COMMENT: '[#' not-rbracket* ']'
#
@@ -164,10 +160,7 @@ import os
# the COMMENT matches are not placed into a group, they are considered a
# "splitting" value and simply dropped.
#
_item = r'(?:"(?:[^\\"]|\\.)*"|[-\w.]+)'
_re_parse = re.compile(r'\[(%s(?: +%s)*)\]|(\[\[\])|\[#[^\]]*\]' % (_item, _item))
_re_args = re.compile(r'"(?:[^\\"]|\\.)*"|[-\w.]+')
_re_parse = re.compile('(\[[-\w."/ ]+\])|(\[\[\])|\[#[^\]]*\]')
# block commands and their argument counts
_block_cmd_specs = { 'if-any':1, 'if-index':2, 'for':1, 'is':2 }
@@ -179,12 +172,6 @@ _block_cmds = _block_cmd_specs.keys()
_re_newline = re.compile('[ \t\r\f\v]*\n\\s*')
_re_whitespace = re.compile(r'\s\s+')
# this regex is used to substitute arguments into a value. we split the value,
# replace the relevant pieces, and then put it all back together. splitting
# will produce a list of: TEXT ( splitter TEXT )*. splitter will be '%' or
# an integer.
_re_subst = re.compile('%(%|[0-9]+)')
class Template:
def __init__(self, fname=None):
@@ -211,11 +198,10 @@ class Template:
ctx.for_index = { }
self._execute(self.program, fp, ctx)
def _parse_file(self, fname, for_names=None, file_args=()):
return self._parse(open(fname, "rt").read(), for_names, file_args,
os.path.dirname(fname))
def _parse_file(self, fname, for_names=None):
return self._parse(open(fname, "rt").read(), for_names)
def _parse(self, text, for_names=None, file_args=(), base=None):
def _parse(self, text, for_names=None):
"""text -> string object containing the HTML template.
This is a private helper function doing the real work for method parse.
@@ -246,7 +232,7 @@ class Template:
program.append('[')
elif piece:
# DIRECTIVE is present.
args = _re_args.findall(piece)
args = string.split(piece[1:-1])
cmd = args[0]
if cmd == 'else':
if len(args) > 1:
@@ -270,46 +256,34 @@ class Template:
if len(args) > _block_cmd_specs[cmd] + 1:
raise ArgCountSyntaxError()
### this assumes arg1 is always a ref
args[1] = _prepare_ref(args[1], for_names, file_args)
args[1] = _prepare_ref(args[1], for_names)
# handle arg2 for the 'is' command
if cmd == 'is':
args[2] = _prepare_ref(args[2], for_names, file_args)
if args[2][0] == '"':
# strip the quotes
args[2] = args[2][1:-1]
else:
args[2] = _prepare_ref(args[2], for_names)
elif cmd == 'for':
for_names.append(args[1][0])
# remember the cmd, current pos, args, and a section placeholder
stack.append([cmd, len(program), args[1:], None])
elif cmd == 'include':
if args[1][0] == '"':
if len(args) != 2:
raise ArgCountSyntaxError()
if args[1][0] in ('"', "'"):
include_filename = args[1][1:-1]
if base:
include_filename = os.path.join(base, include_filename)
f_args = [ ]
for arg in args[2:]:
f_args.append(_prepare_ref(arg, for_names, file_args))
program.extend(self._parse_file(include_filename, for_names,
f_args))
program.extend(self._parse_file(include_filename, for_names))
else:
if len(args) != 2:
raise ArgCountSyntaxError()
program.append((self._cmd_include,
(_prepare_ref(args[1], for_names, file_args),
base)))
program.append((self._cmd_include, _prepare_ref(args[1], for_names)))
else:
# implied PRINT command
if len(args) > 1:
f_args = [ ]
for arg in args:
f_args.append(_prepare_ref(arg, for_names, file_args))
program.append((self._cmd_format, (f_args[0], f_args[1:])))
else:
program.append((self._cmd_print,
_prepare_ref(args[0], for_names, file_args)))
raise ArgCountSyntaxError()
program.append((self._cmd_print, _prepare_ref(args[0], for_names)))
if stack:
### would be nice to say which blocks...
raise UnclosedBlocksError()
return program
def _execute(self, program, fp, ctx):
@@ -324,38 +298,11 @@ class Template:
step[0](step[1], fp, ctx)
def _cmd_print(self, valref, fp, ctx):
value = _get_value(valref, ctx)
### type check the value
fp.write(_get_value(valref, ctx))
# if the value has a 'read' attribute, then it is a stream: copy it
if hasattr(value, 'read'):
while 1:
chunk = value.read(16384)
if not chunk:
break
fp.write(chunk)
else:
fp.write(value)
def _cmd_format(self, (valref, args), fp, ctx):
fmt = _get_value(valref, ctx)
parts = _re_subst.split(fmt)
for i in range(len(parts)):
piece = parts[i]
if i%2 == 1 and piece != '%':
idx = int(piece)
if idx < len(args):
piece = _get_value(args[idx], ctx)
else:
piece = '<undef>'
fp.write(piece)
def _cmd_include(self, (valref, base), fp, ctx):
fname = _get_value(valref, ctx)
if base:
fname = os.path.join(base, fname)
### note: we don't have the set of for_names to pass into this parse.
### I don't think there is anything to do but document it.
self._execute(self._parse_file(fname), fp, ctx)
def _cmd_include(self, valref, fp, ctx):
self._execute(self._parse_file(_get_value(valref, ctx)), fp, ctx)
def _cmd_if_any(self, args, fp, ctx):
"If the value is a non-empty string or non-empty list, then T else F."
@@ -379,9 +326,10 @@ class Template:
self._do_if(value, t_section, f_section, fp, ctx)
def _cmd_is(self, args, fp, ctx):
((left_ref, right_ref), t_section, f_section) = args
value = _get_value(right_ref, ctx)
value = string.lower(_get_value(left_ref, ctx)) == string.lower(value)
((valref, value), t_section, f_section) = args
if not isinstance(value, StringType):
value = _get_value(value, ctx)
value = string.lower(_get_value(valref, ctx)) == string.lower(value)
self._do_if(value, t_section, f_section, fp, ctx)
def _do_if(self, value, t_section, f_section, fp, ctx):
@@ -401,40 +349,20 @@ class Template:
if isinstance(list, StringType):
raise NeedSequenceError()
refname = valref[0]
ctx.for_index[refname] = idx = [ list, 0 ]
for item in list:
ctx.for_index[refname] = [ list, 0 ]
for i in range(len(list)):
ctx.for_index[refname][1] = i
self._execute(section, fp, ctx)
idx[1] = idx[1] + 1
del ctx.for_index[refname]
def boolean(value):
"Return a value suitable for [if-any bool_var] usage in a template."
if value:
return 'yes'
return None
def _prepare_ref(refname, for_names, file_args):
def _prepare_ref(refname, for_names):
"""refname -> a string containing a dotted identifier. example:"foo.bar.bang"
for_names -> a list of active for sequences.
Returns a `value reference', a 3-Tupel made out of (refname, start, rest),
for fast access later.
"""
# is the reference a string constant?
if refname[0] == '"':
return None, refname[1:-1], None
# if this is an include-argument, then just return the prepared ref
if refname[:3] == 'arg':
try:
idx = int(refname[3:])
except ValueError:
pass
else:
if idx < len(file_args):
return file_args[idx]
parts = string.split(refname, '.')
start = parts[0]
rest = parts[1:]
@@ -456,9 +384,6 @@ def _get_value((refname, start, rest), ctx):
for blocks take precedence over data dictionary members with the
same name.
"""
if rest is None:
# it was a string constant
return start
if ctx.for_index.has_key(start):
list, idx = ctx.for_index[start]
ob = list[idx]
@@ -495,23 +420,7 @@ class UnknownReference(Exception):
class NeedSequenceError(Exception):
pass
class UnclosedBlocksError(Exception):
pass
# --- standard test environment ---
def test_parse():
assert _re_parse.split('[a]') == ['', '[a]', None, '']
assert _re_parse.split('[a] [b]') == \
['', '[a]', None, ' ', '[b]', None, '']
assert _re_parse.split('[a c] [b]') == \
['', '[a c]', None, ' ', '[b]', None, '']
assert _re_parse.split('x [a] y [b] z') == \
['x ', '[a]', None, ' y ', '[b]', None, ' z']
assert _re_parse.split('[a "b" c "d"]') == \
['', '[a "b" c "d"]', None, '']
assert _re_parse.split(r'["a \"b[foo]" c.d f]') == \
['', '["a \\"b[foo]" c.d f]', None, '']
def _test(argv):
import doctest, ezt
verbose = "-v" in argv

View File

@@ -1,345 +0,0 @@
#! /usr/bin/env python
# Module ndiff version 1.6.0
# Released to the public domain 08-Dec-2000,
# by Tim Peters (tim.one@home.com).
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
"""ndiff [-q] file1 file2
or
ndiff (-r1 | -r2) < ndiff_output > file1_or_file2
Print a human-friendly file difference report to stdout. Both inter-
and intra-line differences are noted. In the second form, recreate file1
(-r1) or file2 (-r2) on stdout, from an ndiff report on stdin.
In the first form, if -q ("quiet") is not specified, the first two lines
of output are
-: file1
+: file2
Each remaining line begins with a two-letter code:
"- " line unique to file1
"+ " line unique to file2
" " line common to both files
"? " line not present in either input file
Lines beginning with "? " attempt to guide the eye to intraline
differences, and were not present in either input file. These lines can be
confusing if the source files contain tab characters.
The first file can be recovered by retaining only lines that begin with
" " or "- ", and deleting those 2-character prefixes; use ndiff with -r1.
The second file can be recovered similarly, but by retaining only " " and
"+ " lines; use ndiff with -r2; or, on Unix, the second file can be
recovered by piping the output through
sed -n '/^[+ ] /s/^..//p'
See module comments for details and programmatic interface.
"""
__version__ = 1, 5, 0
# SequenceMatcher tries to compute a "human-friendly diff" between
# two sequences (chiefly picturing a file as a sequence of lines,
# and a line as a sequence of characters, here). Unlike e.g. UNIX(tm)
# diff, the fundamental notion is the longest *contiguous* & junk-free
# matching subsequence. That's what catches peoples' eyes. The
# Windows(tm) windiff has another interesting notion, pairing up elements
# that appear uniquely in each sequence. That, and the method here,
# appear to yield more intuitive difference reports than does diff. This
# method appears to be the least vulnerable to synching up on blocks
# of "junk lines", though (like blank lines in ordinary text files,
# or maybe "<P>" lines in HTML files). That may be because this is
# the only method of the 3 that has a *concept* of "junk" <wink>.
#
# Note that ndiff makes no claim to produce a *minimal* diff. To the
# contrary, minimal diffs are often counter-intuitive, because they
# synch up anywhere possible, sometimes accidental matches 100 pages
# apart. Restricting synch points to contiguous matches preserves some
# notion of locality, at the occasional cost of producing a longer diff.
#
# With respect to junk, an earlier version of ndiff simply refused to
# *start* a match with a junk element. The result was cases like this:
# before: private Thread currentThread;
# after: private volatile Thread currentThread;
# If you consider whitespace to be junk, the longest contiguous match
# not starting with junk is "e Thread currentThread". So ndiff reported
# that "e volatil" was inserted between the 't' and the 'e' in "private".
# While an accurate view, to people that's absurd. The current version
# looks for matching blocks that are entirely junk-free, then extends the
# longest one of those as far as possible but only with matching junk.
# So now "currentThread" is matched, then extended to suck up the
# preceding blank; then "private" is matched, and extended to suck up the
# following blank; then "Thread" is matched; and finally ndiff reports
# that "volatile " was inserted before "Thread". The only quibble
# remaining is that perhaps it was really the case that " volatile"
# was inserted after "private". I can live with that <wink>.
#
# NOTE on junk: the module-level names
# IS_LINE_JUNK
# IS_CHARACTER_JUNK
# can be set to any functions you like. The first one should accept
# a single string argument, and return true iff the string is junk.
# The default is whether the regexp r"\s*#?\s*$" matches (i.e., a
# line without visible characters, except for at most one splat).
# The second should accept a string of length 1 etc. The default is
# whether the character is a blank or tab (note: bad idea to include
# newline in this!).
#
# After setting those, you can call fcompare(f1name, f2name) with the
# names of the files you want to compare. The difference report
# is sent to stdout. Or you can call main(args), passing what would
# have been in sys.argv[1:] had the cmd-line form been used.
from difflib import SequenceMatcher
import string
TRACE = 0
# define what "junk" means
import re
def IS_LINE_JUNK(line, pat=re.compile(r"\s*#?\s*$").match):
return pat(line) is not None
def IS_CHARACTER_JUNK(ch, ws=" \t"):
return ch in ws
del re
# meant for dumping lines
def dump(tag, x, lo, hi):
for i in xrange(lo, hi):
print tag, x[i],
def plain_replace(a, alo, ahi, b, blo, bhi):
assert alo < ahi and blo < bhi
# dump the shorter block first -- reduces the burden on short-term
# memory if the blocks are of very different sizes
if bhi - blo < ahi - alo:
dump('+', b, blo, bhi)
dump('-', a, alo, ahi)
else:
dump('-', a, alo, ahi)
dump('+', b, blo, bhi)
# When replacing one block of lines with another, this guy searches
# the blocks for *similar* lines; the best-matching pair (if any) is
# used as a synch point, and intraline difference marking is done on
# the similar pair. Lots of work, but often worth it.
def fancy_replace(a, alo, ahi, b, blo, bhi):
if TRACE:
print '*** fancy_replace', alo, ahi, blo, bhi
dump('>', a, alo, ahi)
dump('<', b, blo, bhi)
# don't synch up unless the lines have a similarity score of at
# least cutoff; best_ratio tracks the best score seen so far
best_ratio, cutoff = 0.74, 0.75
cruncher = SequenceMatcher(IS_CHARACTER_JUNK)
eqi, eqj = None, None # 1st indices of equal lines (if any)
# search for the pair that matches best without being identical
# (identical lines must be junk lines, & we don't want to synch up
# on junk -- unless we have to)
for j in xrange(blo, bhi):
bj = b[j]
cruncher.set_seq2(bj)
for i in xrange(alo, ahi):
ai = a[i]
if ai == bj:
if eqi is None:
eqi, eqj = i, j
continue
cruncher.set_seq1(ai)
# computing similarity is expensive, so use the quick
# upper bounds first -- have seen this speed up messy
# compares by a factor of 3.
# note that ratio() is only expensive to compute the first
# time it's called on a sequence pair; the expensive part
# of the computation is cached by cruncher
if cruncher.real_quick_ratio() > best_ratio and \
cruncher.quick_ratio() > best_ratio and \
cruncher.ratio() > best_ratio:
best_ratio, best_i, best_j = cruncher.ratio(), i, j
if best_ratio < cutoff:
# no non-identical "pretty close" pair
if eqi is None:
# no identical pair either -- treat it as a straight replace
plain_replace(a, alo, ahi, b, blo, bhi)
return
# no close pair, but an identical pair -- synch up on that
best_i, best_j, best_ratio = eqi, eqj, 1.0
else:
# there's a close pair, so forget the identical pair (if any)
eqi = None
# a[best_i] very similar to b[best_j]; eqi is None iff they're not
# identical
if TRACE:
print '*** best_ratio', best_ratio, best_i, best_j
dump('>', a, best_i, best_i+1)
dump('<', b, best_j, best_j+1)
# pump out diffs from before the synch point
fancy_helper(a, alo, best_i, b, blo, best_j)
# do intraline marking on the synch pair
aelt, belt = a[best_i], b[best_j]
if eqi is None:
# pump out a '-', '?', '+', '?' quad for the synched lines
atags = btags = ""
cruncher.set_seqs(aelt, belt)
for tag, ai1, ai2, bj1, bj2 in cruncher.get_opcodes():
la, lb = ai2 - ai1, bj2 - bj1
if tag == 'replace':
atags += '^' * la
btags += '^' * lb
elif tag == 'delete':
atags += '-' * la
elif tag == 'insert':
btags += '+' * lb
elif tag == 'equal':
atags += ' ' * la
btags += ' ' * lb
else:
raise ValueError, 'unknown tag ' + `tag`
printq(aelt, belt, atags, btags)
else:
# the synch pair is identical
print ' ', aelt,
# pump out diffs from after the synch point
fancy_helper(a, best_i+1, ahi, b, best_j+1, bhi)
def fancy_helper(a, alo, ahi, b, blo, bhi):
if alo < ahi:
if blo < bhi:
fancy_replace(a, alo, ahi, b, blo, bhi)
else:
dump('-', a, alo, ahi)
elif blo < bhi:
dump('+', b, blo, bhi)
# Crap to deal with leading tabs in "?" output. Can hurt, but will
# probably help most of the time.
def printq(aline, bline, atags, btags):
common = min(count_leading(aline, "\t"),
count_leading(bline, "\t"))
common = min(common, count_leading(atags[:common], " "))
print "-", aline,
if count_leading(atags, " ") < len(atags):
print "?", "\t" * common + atags[common:]
print "+", bline,
if count_leading(btags, " ") < len(btags):
print "?", "\t" * common + btags[common:]
def count_leading(line, ch):
i, n = 0, len(line)
while i < n and line[i] == ch:
i += 1
return i
def fail(msg):
import sys
out = sys.stderr.write
out(msg + "\n\n")
out(__doc__)
return 0
# open a file & return the file object; gripe and return 0 if it
# couldn't be opened
def fopen(fname):
try:
return open(fname, 'r')
except IOError, detail:
return fail("couldn't open " + fname + ": " + str(detail))
# open two files & spray the diff to stdout; return false iff a problem
def fcompare(f1name, f2name):
f1 = fopen(f1name)
f2 = fopen(f2name)
if not f1 or not f2:
return 0
a = f1.readlines(); f1.close()
b = f2.readlines(); f2.close()
cruncher = SequenceMatcher(IS_LINE_JUNK, a, b)
for tag, alo, ahi, blo, bhi in cruncher.get_opcodes():
if tag == 'replace':
fancy_replace(a, alo, ahi, b, blo, bhi)
elif tag == 'delete':
dump('-', a, alo, ahi)
elif tag == 'insert':
dump('+', b, blo, bhi)
elif tag == 'equal':
dump(' ', a, alo, ahi)
else:
raise ValueError, 'unknown tag ' + `tag`
return 1
# crack args (sys.argv[1:] is normal) & compare;
# return false iff a problem
def main(args):
import getopt
try:
opts, args = getopt.getopt(args, "qr:")
except getopt.error, detail:
return fail(str(detail))
noisy = 1
qseen = rseen = 0
for opt, val in opts:
if opt == "-q":
qseen = 1
noisy = 0
elif opt == "-r":
rseen = 1
whichfile = val
if qseen and rseen:
return fail("can't specify both -q and -r")
if rseen:
if args:
return fail("no args allowed with -r option")
if whichfile in "12":
restore(whichfile)
return 1
return fail("-r value must be 1 or 2")
if len(args) != 2:
return fail("need 2 filename args")
f1name, f2name = args
if noisy:
print '-:', f1name
print '+:', f2name
return fcompare(f1name, f2name)
def restore(which):
import sys
tag = {"1": "- ", "2": "+ "}[which]
prefixes = (" ", tag)
for line in sys.stdin.readlines():
if line[:2] in prefixes:
print line[2:],
if __name__ == '__main__':
import sys
args = sys.argv[1:]
if "-profile" in args:
import profile, pstats
args.remove("-profile")
statf = "ndiff.pro"
profile.run("main(args)", statf)
stats = pstats.Stats(statf)
stats.strip_dirs().sort_stats('time').print_stats()
else:
main(args)

File diff suppressed because it is too large Load Diff

View File

@@ -172,11 +172,8 @@ If this doesn't work, please click on the link above.
decoded_query = string.replace(query, '+', ' ')
self.send_response(200)
# FIXME: I'm not sure about this: Sometimes it hurts, sometimes
# it is required. Please enlight me
if 1:
self.send_header("Content-type", "text/html")
self.end_headers()
self.send_header("Content-type", "text/html")
self.end_headers()
# Preserve state, because we execute script in current process:
save_argv = sys.argv
@@ -317,13 +314,13 @@ def gui(port):
command=self.toggle_subdirmod)
self.subdirmod_toggle.pack(side='top', anchor='w')
# use_re_search toggle:
self.useresearch_ivar = Tkinter.IntVar()
self.useresearch_ivar.set(viewcvs.cfg.options.use_re_search)
self.useresearch_toggle = Tkinter.Checkbutton(self.options_frm,
text="allow regular expr search", var=self.useresearch_ivar,
command=self.toggle_useresearch)
self.useresearch_toggle.pack(side='top', anchor='w')
# flip_links_in_dirview toggle:
self.fliplinks_ivar = Tkinter.IntVar()
self.fliplinks_ivar.set(viewcvs.cfg.options.flip_links_in_dirview)
self.fliplinks_toggle = Tkinter.Checkbutton(self.options_frm,
text="flip file/rev columns (dir view)", var=self.fliplinks_ivar,
command=self.toggle_fliplinks)
self.fliplinks_toggle.pack(side='top', anchor='w')
# directory view template:
self.dirtemplate_lbl = Tkinter.Label(self.options_frm,
@@ -339,10 +336,6 @@ def gui(port):
text="directory.ezt", value="templates/directory.ezt",
var=self.dirtemplate_svar, command=self.set_templates_directory)
self.templates_dir.pack(side='top', anchor='w')
self.templates_dir_alt = Tkinter.Radiobutton(self.options_frm,
text="dir_alternate.ezt", value="templates/dir_alternate.ezt",
var=self.dirtemplate_svar, command=self.set_templates_directory)
self.templates_dir_alt.pack(side='top', anchor='w')
# log view template:
self.logtemplate_lbl = Tkinter.Label(self.options_frm,
@@ -401,8 +394,8 @@ def gui(port):
def toggle_subdirmod(self, event=None):
viewcvs.cfg.options.show_subdir_lastmod = self.subdirmod_ivar.get()
def toggle_useresearch(self, event=None):
viewcvs.cfg.options.use_re_search = self.useresearch_ivar.get()
def toggle_fliplinks(self, event=None):
viewcvs.cfg.options.flip_links_in_dirview = self.fliplinks_ivar.get()
def set_templates_log(self, event=None):
viewcvs.cfg.templates.log = self.logtemplate_svar.get()

View File

@@ -1,3 +0,0 @@
[include "header.ezt" "annotate"]
<hr noshade>

View File

@@ -1,88 +0,0 @@
[include "header.ezt" "diff"]
<h3 align=center>Diff for /[where] between version [rev1] and [rev2]</h3>
<table border=0 cellspacing=0 cellpadding=0 width="100%">
<tr bgcolor=white>
<th width="50%" valign=top>
version [rev1][date1]
[if-any tag1]<br>Tag: [tag1][end]
</th>
<th width="50%" valign=top>
version [rev2][date2]
[if-any tag2]<br>Tag: [tag2][end]
</th>
</tr>
[for changes]
[is changes.type "header"]
<tr bgcolor="#99cccc"><td width="50%">
<table width="100%" border=1 cellpadding=5><tr>
<td><b>Line [changes.line1]</b>&nbsp;<font
size="-1">[changes.extra]</font></td>
</tr></table></td><td width="50%">
<table width="100%" border=1 cellpadding=5><tr>
<td><b>Line [changes.line2]</b>&nbsp;<font
size="-1">[changes.extra]</font></td>
</tr></table>
</td></tr>
[else]
[is changes.type "add"]
<tr>
<td bgcolor="#cccccc">&nbsp;</td>
<td bgcolor="#aaffaa">[changes.right]</td>
</tr>
[else]
[is changes.type "remove"]
<tr>
<td bgcolor="#ffaaaa">[changes.left]</td>
<td bgcolor="#cccccc">&nbsp;</td>
</tr>
[else]
[is changes.type "change"]
<tr>
[if-any changes.have_left]<td bgcolor="#ffff77">[changes.left]</td>
[else]<td bgcolor="#eeee77">&nbsp;</td>[end]
[if-any changes.have_right]<td bgcolor="#ffff77">[changes.right]</td>
[else]<td bgcolor="#eeee77">&nbsp;</td>[end]
</tr>
[else]
[is changes.type "no-changes"]
<tr><td colspan=2>&nbsp;</td></tr>
<tr bgcolor="#cccccc"><td colspan=2 align=center>
<br><b>- No changes -</b><br>&nbsp;
</td></tr>
[else][# a line of context]
<tr><td>[changes.left]</td><td>[changes.right]</td></tr>
[end][end][end][end][end]
[end]
</table><br><hr noshade width="100%">
<table border=0 cellpadding=10><tr><td>
<table border=1><tr><td>Legend:<br>
<table border=0 cellspacing=0 cellpadding=1>
<tr>
<td align=center bgcolor="#ffaaaa">Removed from v.[rev1]</td>
<td bgcolor="#cccccc">&nbsp;</td>
</tr>
<tr bgcolor="#ffff77"><td align=center colspan=2>changed lines</td></tr>
<tr>
<td bgcolor="#cccccc">&nbsp;</td>
<td align=center bgcolor="#aaffaa">Added in v.[rev2]</td>
</tr>
</table></td></tr></table></td>
<td><form method="GET" action="[request.url]">
[hidden_values]
<select name="diff_format" onchange="submit()">
<option value="h" [is diff_format "h"]selected[end]>Colored Diff</option>
<option value="l" [is diff_format "l"]selected[end]>Long Colored Diff</option>
<option value="u" [is diff_format "u"]selected[end]>Unidiff</option>
<option value="c" [is diff_format "c"]selected[end]>Context Diff</option>
<option value="s" [is diff_format "s"]selected[end]>Side by Side</option>
</select>
<input type=submit value="Show">
</form></td></tr>
</table>
[include "footer.ezt"]

View File

@@ -1,307 +0,0 @@
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html><head>
<!-- ViewCVS -- http://viewcvs.sourceforge.net/
by Greg Stein -- mailto:gstein@lyra.org
-->
<title>[if-any where][where][else][cfg.general.main_title][end]</title>
</head>
<body text="#000000" bgcolor="#ffffff">
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td rowspan=2><h1>[if-any where][where][else][cfg.general.main_title][end]</h1></td>
<td align=right><img src="/icons/apache_pb.gif" alt="(logo)" border=0
width=259 height=32></td>
</tr>
<tr>
<td align=right><h3><b><a target="_blank"
href="[request.script_name]/*docroot*/help_[if-any where]dir[else]root[end]view.html">ViewCVS and CVS Help</a></b></h3></td>
</tr>
</table>
[if-any where][else]
<!-- you may insert repository access instructions here -->
[if-any roots]
<h3>Project Root</h3>
<form method=GET action="./">
<select name=cvsroot onchange="submit()">
[for roots]
[is roots current_root]
<option selected>[roots]</option>
[else]
<option>[roots]</option>
[end]
[end]
</select>
<input type=submit value="Go">
</form>
[end]
[end]
<p><a name="dirlist"></a></p>
[if-any where]
<table>
<tr><td>Current directory:</td><td><b>[nav_path]</b></td></tr>
[if-any view_tag]
<tr><td>Current tag:</td><td><b>[view_tag]</b></td></tr>
[end]
[if-any search_re]
<tr><td>Current search:</td><td><b>[search_re]</b></td></tr>
[end]
[is num_files "0"]
[else]
<tr><td>Files shown:</td><td><b>[files_shown]</b></td></tr>
[end]
</table>
[end]
<hr noshade>
[# if you want a colored border around the table of directory
information, then add this additional table tag:
<table border=0 cellpadding=0 width="100%"><tr>
<td bgcolor="#999999">
]
<table width="100%" border=0 cellspacing=1 cellpadding=2>
<tr>
[if-any have_logs]
[is sortby "rev"]
<th align=left bgcolor="#88ff88">Rev.</th>
[else]
<th align=left bgcolor="#cccccc"
><a href="./[sortby_rev_href]"#dirlist>Rev.</a></th>
[end]
[is sortby "file"]
<th align=left bgcolor="#88ff88"
[is cfg.options.use_cvsgraph "1"]colspan=2[end]
>File</th>
[else]
<th align=left bgcolor="#cccccc"
[is cfg.options.use_cvsgraph "1"]colspan=2[end]
><a href="./[sortby_file_href]#dirlist">File</a></th>
[end]
[is sortby "date"]
<th align=left bgcolor="#88ff88">Age</th>
[else]
<th align=left bgcolor="#cccccc"
><a href="./[sortby_date_href]#dirlist">Age</a></th>
[end]
[is sortby "author"]
<th align=left bgcolor="#88ff88">Author</th>
[else]
<th align=left bgcolor="#cccccc"
><a href="./[sortby_author_href]#dirlist">Author</a></th>
[end]
[is sortby "log"]
<th align=left bgcolor="#88ff88">Last log entry</th>
[else]
<th align=left bgcolor="#cccccc"
><a href="./[sortby_log_href]#dirlist">Last log entry</a></th>
[end]
[else]
<th align=left bgcolor="#cccccc">File</th>
[end]
</tr>
[for rows]
<tr bgcolor="[if-index rows even]#ffffff[else]#ccccee[end]">
[is rows.type "unreadable"]
[if-any have_logs]
<td>&nbsp;</td> [# revision ]
[end]
<td><a name="[rows.anchor]">[rows.name]</a>
[if-any have_logs]
</td>
<td colspan=[is cfg.options.use_cvsgraph "1"]4[else]3[end]>
<i>this entry is unreadable</i>
</td>
[else]
- <i>this entry is unreadable</i>
[end]
</td>
[else]
[is rows.type "dir"]
[if-any have_logs]
<td>&nbsp;</td> [# revision ]
[end]
<td [if-any have_logs][is cfg.options.use_cvsgraph "1"]colspan=2[end][end]>
<a name="[rows.anchor]" href="[rows.href]">
<img src="/icons/small/dir.gif" alt="(dir)" border=0 width=16 height=16>
[rows.name]
</a>
[is rows.name "Attic/"]
&nbsp; <a href="./[show_attic_href]#dirlist">[[]show contents]</a>
[end]
</td>
[is rows.cvs "error"]
[# for an error to occur, we must have some logs. always use colspan]
<td colspan=3>
<i>Last modification unavailable - could not read CVS information</i>
</td>
[else]
[if-any have_logs]
[is rows.cvs "none"]
<td>&nbsp;</td> [# age ]
<td>&nbsp;</td> [# author ]
<td>&nbsp;</td> [# log ]
[else]
<td>&nbsp;[rows.time]</td>
[if-any rows.author]
<td>&nbsp;[rows.author]</td>
[end]
[if-any rows.show_log]
<td>&nbsp;[rows.log_file]/[rows.log_rev]<br>
&nbsp;<font size="-1">[rows.log]</font></td>
[end]
[end]
[end]
[end]
[else]
[is rows.cvs "error"]
<td>&nbsp;</td>
<td [is cfg.options.use_cvsgraph "1"]colspan=2[end]>
<a name="[rows.anchor]">[rows.name]</a>
</td>
<td colspan=3><i>CVS information is unreadable</i></td>
[else]
<td>&nbsp;<a href="[rows.href]"><b>[rows.rev]</b></a></td>
<td width="1%"><a name="[rows.anchor]" href="[rows.rev_href]&content-type=text/vnd.viewcvs-markup">
[# to display the revision in a separate window, you could use:
<a name="{rows.anchor}" href="{rows.rev_href}" target="cvs_checkout"
onClick="window.open('{rows.rev_href}', 'cvs_checkout',
'resizeable=1,scrollbars=1')"><b>{rows.rev}</b></a>
(substitute brackets for the braces)
]
<img src="/icons/small/text.gif" alt="(file)" border=0
width=16 height=16>
[rows.name]
</a>
[is rows.state "dead"]
[# don't let this phrase/link be wrapped ]
[if-any view_tag](not&nbsp;exist)[else](in&nbsp;the&nbsp;Attic)[end]&nbsp;<a href="./[hide_attic_href]#dirlist">[[]hide]</a>
[end]
</td>
[if-any rows.graph_href]
<td width="1%"><a href="[rows.graph_href]"><img
src="[request.script_name]/*docroot*/images/cvsgraph_16x16.png"
alt="(graph)" width=16 height=16 border=0>
</a></td>
[end]
<td>&nbsp;[rows.time]</td>
[if-any rows.author]
<td>&nbsp;[rows.author]</td>
[end]
[if-any rows.show_log]
<td>&nbsp;[rows.log]</td>
[end]
[end]
[end]
[end]
</tr>
[end]
</table>
[# if you are using a table border (see above), then add:
</td></tr></table>
]
[if-any no_match]
<p><b>NOTE:</b> There are [num_files] files, but none match the
current selection criteria.
[end]
[if-any unreadable]
<hr size=1 noshade>
<b>NOTE:</b> One or more files were unreadable. The files in the CVS
repository should be readable by the web server process. Please
report this condition to the administrator of this CVS repository.
[end]
[if-any selection_form]
<hr size=1 noshade>
[# this table holds the selectors on the left, and reset on the right ]
<table><tr><td>
<form method=GET action="./">
[for params]
<input type=hidden name="[params.name]" value="[params.value]">
[end]
<table>
[if-any has_tags]
<tr>
<td>Show files using tag:</td>
<td>
<select name=only_with_tag onchange="submit()">
[if-any branch_tags]
<option value="">- Branches -</option>
[for branch_tags]
[is branch_tags view_tag]
<option selected>[branch_tags]</option>
[else]
<option>[branch_tags]</option>
[end]
[end]
[end]
<option value="">- Non-branch tags -</option>
[for plain_tags]
[is plain_tags view_tag]
<option selected>[plain_tags]</option>
[else]
<option>[plain_tags]</option>
[end]
[end]
</select></td>
</tr>
[end]
[is cfg.options.use_re_search "1"]
<tr>
<td>Show files containing the regular expression:</td>
<td><input type="text" name="search" value="[search_re]">
</tr>
[end]
<tr><td>&nbsp;</td><td><input type="submit" value="Show"></td></tr>
</table>
</form>
</td>
[if-any view_tag]
<td valign=bottom><form method=GET action="./">
[for params]
<input type=hidden name="[params.name]" value="[params.value]">
[end]
<input type="submit" value="Show all files">
</form></td>
[else][if-any search_re]
<td valign=bottom><form method=GET action="./">
[for params]
<input type=hidden name="[params.name]" value="[params.value]">
[end]
<input type="submit" value="Show all files">
</form></td>
[end][end]
</tr></table>
[end]
[# if you want to disable tarball generation remove the following: ]
[if-any tarball_href]
<a href="[tarball_href]">Download tarball</a>
[end]
[include "footer.ezt"]

View File

@@ -15,7 +15,7 @@
</tr>
<tr>
<td align=right><h3><b><a target="_blank"
href="[request.script_name]/*docroot*/help_[if-any where]dir[else]root[end]view.html">ViewCVS and CVS Help</a></b></h3></td>
href="[request.script_name]/*docroot*/help_[if-any where]dir[else]root[end]view.html">Help</a></b></h3></td>
</tr>
</table>
@@ -42,22 +42,13 @@ href="[request.script_name]/*docroot*/help_[if-any where]dir[else]root[end]view.
<p><a name="dirlist"></a></p>
[if-any where]
<table>
<tr><td>Current directory:</td><td><b>[nav_path]</b></td></tr>
<p>Current directory: <b>[nav_path]</b></p>
[if-any view_tag]
<tr><td>Current tag:</td><td><b>[view_tag]</b></td></tr>
<p>Current tag: <b>[view_tag]</b></p>
[end]
[if-any search_re]
<tr><td>Current search:</td><td><b>[search_re]</b></td></tr>
[end]
[is num_files "0"]
[else]
<tr><td>Files shown:</td><td><b>[files_shown]</b></td></tr>
[end]
</table>
[end]
<hr noshade>
<p></p><hr noshade>
[# if you want a colored border around the table of directory
information, then add this additional table tag:
@@ -69,82 +60,44 @@ href="[request.script_name]/*docroot*/help_[if-any where]dir[else]root[end]view.
<table width="100%" border=0 cellspacing=1 cellpadding=2>
<tr>
[if-any have_logs]
[is sortby "file"]
<th align=left bgcolor="#88ff88"
[is cfg.options.use_cvsgraph "1"]colspan=2[end]
>File</th>
[for headers]
[is headers.which sortby]
<th align=left bgcolor="#88ff88" colspan=[headers.colspan]>[headers.title]</th>
[else]
<th align=left bgcolor="#cccccc"
[is cfg.options.use_cvsgraph "1"]colspan=2[end]
><a href="./[sortby_file_href]#dirlist">File</a></th>
<th align=left bgcolor="#cccccc" colspan=[headers.colspan]>
<a href="[headers.href]">[headers.title]</a>
</th>
[end]
[is sortby "rev"]
<th align=left bgcolor="#88ff88">Rev.</th>
[else]
<th align=left bgcolor="#cccccc"
><a href="./[sortby_rev_href]"#dirlist>Rev.</a></th>
[end]
[is sortby "date"]
<th align=left bgcolor="#88ff88">Age</th>
[else]
<th align=left bgcolor="#cccccc"
><a href="./[sortby_date_href]#dirlist">Age</a></th>
[end]
[is sortby "author"]
<th align=left bgcolor="#88ff88">Author</th>
[else]
<th align=left bgcolor="#cccccc"
><a href="./[sortby_author_href]#dirlist">Author</a></th>
[end]
[is sortby "log"]
<th align=left bgcolor="#88ff88">Last log entry</th>
[else]
<th align=left bgcolor="#cccccc"
><a href="./[sortby_log_href]#dirlist">Last log entry</a></th>
[end]
[else]
<th align=left bgcolor="#cccccc">File</th>
[end]
</tr>
[for rows]
<tr bgcolor="[if-index rows even]#ffffff[else]#ccccee[end]">
[is rows.type "unreadable"]
<td><a name="[rows.anchor]">[rows.name]</a>
[if-any have_logs]
</td>
<td colspan=[is cfg.options.use_cvsgraph "1"]5[else]4[end]>
<i>this entry is unreadable</i>
</td>
[else]
- <i>this entry is unreadable</i>
[end]
</td>
[is rev_in_front "1"]<td width="0%">&nbsp;</td>[end]
<td><a name="[rows.anchor]">[rows.name]</a></td>
<td colspan=[rows.span]><i>this entry is unreadable</i></td>
[else]
[is rows.type "dir"]
<td [if-any have_logs][is cfg.options.use_cvsgraph "1"]colspan=2[end][end]>
<a name="[rows.anchor]" href="[rows.href]">
[is rev_in_front "1"]<td width="0%">&nbsp;</td>[end]
<td><a name="[rows.anchor]" href="[rows.href]">
<img src="/icons/small/dir.gif" alt="(dir)" border=0 width=16 height=16>
[rows.name]
</a>
[is rows.name "Attic/"]
&nbsp; <a href="./[show_attic_href]#dirlist">[[]show contents]</a>
[if-any rows.hide_attic_href]
&nbsp; <a href="[rows.hide_attic_href]">[[]Don't hide]</a>
[end]
</td>
[is rows.cvs "error"]
[# for an error to occur, we must have some logs. always use colspan]
<td colspan=4>
<i>Last modification unavailable - could not read CVS information</i>
</td>
<td colspan=[rows.span]><i>CVS information is unreadable</i></td>
[else]
[if-any have_logs]
<td>&nbsp;</td> [# revision ]
[is rows.cvs "none"]
<td>&nbsp;</td> [# age ]
<td>&nbsp;</td> [# author ]
<td>&nbsp;</td> [# log ]
[for rows.cols]<td>&nbsp;</td>[end]
[else]
[if-any rows.graph_href]
<td width="1%">&nbsp;</td>
[end]
[is cfg.options.flip_links_in_dirview "0"]<td>&nbsp;</td>[end]
<td>&nbsp;[rows.time]</td>
[if-any rows.author]
<td>&nbsp;[rows.author]</td>
@@ -155,36 +108,46 @@ href="[request.script_name]/*docroot*/help_[if-any where]dir[else]root[end]view.
[end]
[end]
[end]
[end]
[else]
[is rows.cvs "error"]
<td [is cfg.options.use_cvsgraph "1"]colspan=2[end]>
<a name="[rows.anchor]">[rows.name]</a>
</td>
<td colspan=4><i>CVS information is unreadable</i></td>
[is rev_in_front "1"]<td>&nbsp;</td>[end]
<td><a name="[rows.anchor]">[rows.name]</a></td>
<td colspan=[rows.span]><i>CVS information is unreadable</i></td>
[else]
<td><a name="[rows.anchor]" href="[rows.href]">
<img src="/icons/small/text.gif" alt="(file)" border=0
width=16 height=16>
[rows.name]
</a>
[is rows.state "dead"]
[# don't let this phrase/link be wrapped ]
[if-any view_tag](not&nbsp;exist)[else](in&nbsp;the&nbsp;Attic)[end]&nbsp;<a href="./[hide_attic_href]#dirlist">[[]hide]</a>
[end]
</td>
[is cfg.options.flip_links_in_dirview "1"]
<td><a name="[rows.anchor]" href="[rows.href]"><b>[rows.rev]</b></a>
</td>
[end]
<td><a name="[rows.anchor]"
[is cfg.options.flip_links_in_dirview "0"]
href="[rows.href]">
[else]
href="[rows.rev_href]&content-type=text/vnd.viewcvs-markup">
[# to display the revision in a separate window, you could use:
href="{rows.rev_href}" target="cvs_checkout"
onClick="window.open('{rows.rev_href}', 'cvs_checkout',
'resizeable=1,scrollbars=1')">
(substitute brackets for the braces)
] [end]<img src="/icons/small/text.gif" alt="(file)" border=0
width=16 height=16>
[rows.name]
</a>
[rows.attic]
</td>
[if-any rows.graph_href]
<td width="1%"><a href="[rows.graph_href]"><img
src="[request.script_name]/*docroot*/images/cvsgraph_16x16.png"
alt="(graph)" width=16 height=16 border=0>
</a></td>
[end]
<td>&nbsp;
<a href="[rows.rev_href]&content-type=text/vnd.viewcvs-markup">
<b>[rows.rev]</b>
</a>
[is cfg.options.flip_links_in_dirview "0"]
<td>&nbsp;
<a href="[rows.rev_href]&content-type=text/vnd.viewcvs-markup">
<b>[rows.rev]</b>
</a>
[# to display the revision in a separate window, you could use:
<a href="{rows.rev_href}" target="cvs_checkout"
@@ -193,7 +156,8 @@ href="[request.script_name]/*docroot*/help_[if-any where]dir[else]root[end]view.
(substitute brackets for the braces)
]
</td>
</td>
[end]
<td>&nbsp;[rows.time]</td>
[if-any rows.author]
<td>&nbsp;[rows.author]</td>
@@ -216,7 +180,7 @@ href="[request.script_name]/*docroot*/help_[if-any where]dir[else]root[end]view.
[if-any no_match]
<p><b>NOTE:</b> There are [num_files] files, but none match the
current selection criteria.
current tag ([view_tag])
[end]
[if-any unreadable]
@@ -226,75 +190,36 @@ href="[request.script_name]/*docroot*/help_[if-any where]dir[else]root[end]view.
report this condition to the administrator of this CVS repository.
[end]
[if-any selection_form]
[if-any has_tags]
<hr size=1 noshade>
[# this table holds the selectors on the left, and reset on the right ]
<table><tr><td>
<form method=GET action="./">
[for params]
<input type=hidden name="[params.name]" value="[params.value]">
[end]
<table>
[if-any has_tags]
<tr>
<td>Show files using tag:</td>
<td>
Show only files with tag:
<select name=only_with_tag onchange="submit()">
[if-any branch_tags]
<option value="">- Branches -</option>
[for branch_tags]
[is branch_tags view_tag]
<option selected>[branch_tags]</option>
[else]
<option>[branch_tags]</option>
[end]
[end]
[end]
<option value="">- Non-branch tags -</option>
[for plain_tags]
[is plain_tags view_tag]
<option selected>[plain_tags]</option>
[if-any branch_tags]
<option value="">- Branches -</option>
[for branch_tags]
[is branch_tags view_tag]
<option selected>[branch_tags]</option>
[else]
<option>[plain_tags]</option>
<option>[branch_tags]</option>
[end]
[end]
</select></td>
</tr>
[end]
[is cfg.options.use_re_search "1"]
<tr>
<td>Show files containing the regular expression:</td>
<td><input type="text" name="search" value="[search_re]">
</tr>
<option value="">- Non-branch tags -</option>
[for plain_tags]
[is plain_tags view_tag]
<option selected>[plain_tags]</option>
[else]
<option>[plain_tags]</option>
[end]
[end]
<tr><td>&nbsp;</td><td><input type="submit" value="Show"></td></tr>
</table>
</select>
<input type=submit value="Go">
</form>
</td>
[if-any view_tag]
<td valign=bottom><form method=GET action="./">
[for params]
<input type=hidden name="[params.name]" value="[params.value]">
[end]
<input type="submit" value="Show all files">
</form></td>
[else][if-any search_re]
<td valign=bottom><form method=GET action="./">
[for params]
<input type=hidden name="[params.name]" value="[params.value]">
[end]
<input type="submit" value="Show all files">
</form></td>
[end][end]
</tr></table>
[end]
[# if you want to disable tarball generation remove the following: ]
@@ -302,4 +227,10 @@ href="[request.script_name]/*docroot*/help_[if-any where]dir[else]root[end]view.
<a href="[tarball_href]">Download tarball</a>
[end]
[include "footer.ezt"]
<hr noshade>
<table width="100%" border=0 cellpadding=0 cellspacing=0><tr>
<td align=left><address>[address]</address></td>
<td align=right>
Powered by<br><a href="http://viewcvs.sourceforge.net/">ViewCVS [vsn]</a>
</td></tr></table>
</body></html>

View File

@@ -1,9 +0,0 @@
[# standard footer used by all ViewCVS pages ]
<hr noshade>
<table width="100%" border=0 cellpadding=0 cellspacing=0><tr>
<td align=left><address>[cfg.general.address]</address></td>
<td align=right>
Powered by<br><a href="http://viewcvs.sourceforge.net/">ViewCVS [vsn]</a>
</td></tr></table>
</body></html>

View File

@@ -1,12 +0,0 @@
[include "header.ezt" "graph"]
<center>
<h1>Revision graph of [request.where]</h1>
[imagemap]
<img border="0" usemap="#MyMapName"
src="[request.url]?graph=[rev]&makeimage=1[request.amp_query]"
alt="Revisions of [request.where]">
</center>
[include "footer.ezt"]

View File

@@ -1,25 +0,0 @@
<html><head>
<!-- ViewCVS -- http://viewcvs.sourceforge.net/
by Greg Stein -- mailto:gstein@lyra.org
-->
[### NOTE: the "diff" is the TITLE param to navigate_header() ]
<title>[path]/[filename] - [arg0] - [rev]</title>
</head>
<body bgcolor="#eeeeee">
<table width="100%" border=0 cellspacing=0 cellpadding=1 bgcolor="#9999ee">
<tr valign=bottom>
<td>
<a href="[file_url][qquery]#rev[rev]">
<img src="/icons/small/back.gif" alt="(file)" border=0 width=16 height=16>
</a>
<b>Return to
<a href="[file_url][qquery]#rev[rev]">[filename]</a>
CVS log</b>
<img src="/icons/small/text.gif" alt="(file)" border=0 width=16 height=16>
</td>
<td align=right>
<img src="/icons/small/dir.gif" alt="(dir)" border=0 width=16 height=16>
<b>Up to [nav_path]</b>
</td>
</tr>
</table>

View File

@@ -9,14 +9,10 @@
<body text="#000000" bgcolor="#ffffff">
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td rowspan=2><h1>CVS log for [where]</h1></td>
<td><h1>CVS log for [where]</h1></td>
<td align=right><img src="/icons/apache_pb.gif" alt="(logo)" border=0
width=259 height=32></td>
</tr>
<tr>
<td align=right><h3><b><a target="_blank"
href="[request.script_name]/*docroot*/help_log.html">Help</a></b></h3></td>
</tr>
</table>
<a href="[back_url]"><img src="/icons/small/back.gif" alt="(back)" border=0
@@ -210,7 +206,7 @@ and
<option value="l" [is diff_format "l"]selected[end]>Long Colored Diff</option>
<option value="u" [is diff_format "u"]selected[end]>Unidiff</option>
<option value="c" [is diff_format "c"]selected[end]>Context Diff</option>
<option value="s" [is diff_format "s"]selected[end]>Side by Side</option>
<option value="s" [is diff_format "c"]selected[end]>Side by Side</option>
</select>
<input type=submit value=" Get Diffs "></form>
@@ -243,4 +239,10 @@ and
<input type=submit value=" Sort ">
</form>
[include "footer.ezt"]
<hr noshade>
<table width="100%" border=0 cellpadding=0 cellspacing=0><tr>
<td align=left><address>[address]</address></td>
<td align=right>
Powered by<br><a href="http://viewcvs.sourceforge.net/">ViewCVS [vsn]</a>
</td></tr></table>
</body></html>

View File

@@ -9,14 +9,10 @@
<body text="#000000" bgcolor="#ffffff">
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td rowspan=2><h1>CVS log for [where]</h1></td>
<td><h1>CVS log for [where]</h1></td>
<td align=right><img src="/icons/apache_pb.gif" alt="(logo)" border=0
width=259 height=32></td>
</tr>
<tr>
<td align=right><h3><b><a target="_blank"
href="[request.script_name]/*docroot*/help_logtable.html">Help</a></b></h3></td>
</tr>
</table>
<a href="[back_url]"><img src="/icons/small/back.gif" alt="(back)" border=0
@@ -215,7 +211,7 @@ and
<option value="l" [is diff_format "l"]selected[end]>Long Colored Diff</option>
<option value="u" [is diff_format "u"]selected[end]>Unidiff</option>
<option value="c" [is diff_format "c"]selected[end]>Context Diff</option>
<option value="s" [is diff_format "s"]selected[end]>Side by Side</option>
<option value="s" [is diff_format "c"]selected[end]>Side by Side</option>
</select>
<input type=submit value=" Get Diffs "></form>
@@ -248,4 +244,10 @@ and
<input type=submit value=" Sort ">
</form>
[include "footer.ezt"]
<hr noshade>
<table width="100%" border=0 cellpadding=0 cellspacing=0><tr>
<td align=left><address>[address]</address></td>
<td align=right>
Powered by<br><a href="http://viewcvs.sourceforge.net/">ViewCVS [vsn]</a>
</td></tr></table>
</body></html>

View File

@@ -1,49 +0,0 @@
[include "header.ezt" "view"]
<hr noshade>
<table width="100%"><tr><td bgcolor="#ffffff">
File: [nav_file]
(<a href="[href]" target="cvs_checkout"
onClick="window.open('about:blank','cvs_checkout',
'resizeable=1,scrollbars=1[is mime_type "text/html"],status,toolbar[end]');"
><b>download</b></a>)
[is mime_type "text/plain"]
[else]
/
(<a href="[text_href]" target="cvs_checkout"
onClick="window.open('about:blank', 'cvs_checkout',
'resizeable=1,scrollbars=1')"><b>as text</b></a>)
[end]
<br>
[if-any log]
Revision: <b>[rev]</b>[if-any vendor_branch] <i>(vendor branch)</i>[end],
<i>[utc_date] UTC</i> ([ago] ago) by <i>[author]</i>
[if-any branches]
<br>Branch: <b>[branches]</b>
[end]
[if-any tags]
<br>CVS Tags: <b>[tags]</b>
[end]
[if-any branch_points]
<br>Branch point for: <b>[branch_points]</b>
[end]
[if-any prev]
[if-any changed]
<br>Changes since <b>[prev]: [changed] lines</b>
[end]
[end]
[is state "dead"]
<br><b><i>FILE REMOVED</i></b>
[end]
<pre>[log]</pre>
[else]
Revision: <b>[rev]</b><br>
[if-any tag]
Tag: <b>[tag]</b><br>
[end]
[end]
</td></tr></table>
<hr noshade>

View File

@@ -225,4 +225,10 @@
[end]
[end]
[include "footer.ezt"]
<hr noshade>
<table width="100%" border=0 cellpadding=0 cellspacing=0><tr>
<td align=left><address>[address]</address></td>
<td align=right>
Powered by<br><a href="http://viewcvs.sourceforge.net/">ViewCVS [vsn]</a>
</td></tr></table>
</body></html>

View File

@@ -46,7 +46,7 @@ find $2 -print | xargs chmod uoa+r
find $2 -type d -print | xargs chmod uoa+x
# cut the tarball:
tar cf - $2 | gzip -9 > $2.tar.gz
tar cfz - $2 | gzip -9 > $2.tar.gz
# create also a ZIP file for those poor souls :-) still using Windows:
zip -qor9 $2.zip $2

View File

@@ -27,14 +27,12 @@ import string
import re
import traceback
import py_compile
import StringIO
# get access to our library modules
sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), 'lib'))
import compat
import viewcvs
import ndiff
version = viewcvs.__version__
@@ -86,18 +84,10 @@ went into the new files in subdirectory templates.""", 0),
("lib/viewcvs.py", "lib/viewcvs.py", 0644, 1, 0, 1),
("lib/ezt.py", "lib/ezt.py", 0644, 0, 0, 1),
("lib/apache_icons.py", "lib/apache_icons.py", 0644, 0, 0, 1),
("lib/accept.py", "lib/accept.py", 0644, 0, 0, 1),
("templates/annotate.ezt", "templates/annotate.ezt", 0644, 0, 1, 0),
("templates/diff.ezt", "templates/diff.ezt", 0644, 0, 1, 0),
("templates/directory.ezt", "templates/directory.ezt", 0644, 0, 1, 0),
("templates/dir_alternate.ezt", "templates/dir_alternate.ezt", 0644, 0, 1, 0),
("templates/footer.ezt", "templates/footer.ezt", 0644, 0, 1, 0),
("templates/graph.ezt", "templates/graph.ezt", 0644, 0, 1, 0),
("templates/header.ezt", "templates/header.ezt", 0644, 0, 1, 0),
("templates/log.ezt", "templates/log.ezt", 0644, 0, 1, 0),
("templates/log_table.ezt", "templates/log_table.ezt", 0644, 0, 1, 0),
("templates/markup.ezt", "templates/markup.ezt", 0644, 0, 1, 0),
("templates/query.ezt", "templates/query.ezt", 0644, 0, 1, 0),
("tools/loginfo-handler", "loginfo-handler", 0755, 1, 0, 0),
@@ -106,9 +96,6 @@ went into the new files in subdirectory templates.""", 0),
("website/help_rootview.html", "doc/help_rootview.html", 0644, 0, 0, 0),
("website/help_dirview.html", "doc/help_dirview.html", 0644, 0, 0, 0),
("website/help_query.html", "doc/help_query.html", 0644, 0, 0, 0),
("website/help_log.html", "doc/help_log.html", 0644, 0, 0, 0),
("website/help_logtable.html", "doc/help_logtable.html", 0644, 0, 0, 0),
("website/images/logo.png", "doc/images/logo.png", 0644, 0, 0, 0),
("website/images/chalk.jpg", "doc/images/chalk.jpg", 0644, 0, 0, 0),
@@ -145,7 +132,6 @@ def SetOnePath(contents, var, value):
repl = '%s = "%s"' % (var, os.path.join(ROOT_DIR, value))
return re.sub(pattern, repl, contents)
def SetPythonPaths(contents):
if contents[:2] == '#!':
shbang = '#!' + sys.executable
@@ -158,86 +144,39 @@ def SetPythonPaths(contents):
def InstallFile(src_path, dest_path, mode, set_python_paths, prompt_replace,
compile_it):
dest_path = os.path.join(ROOT_DIR, dest_path)
dest_path = os.path.join(ROOT_DIR, dest_path)
if prompt_replace and os.path.exists(dest_path):
# Collect ndiff output from ndiff
sys.stdout = StringIO.StringIO()
ndiff.main([dest_path,src_path])
ndiff_output = sys.stdout.getvalue()
# Return everything to normal
sys.stdout = sys.__stdout__
# Collect the '+ ' and '- ' lines
# total collects the difference lines to be printed later
total = ""
# I use flag to throw out match lines.
flag = 1
for line in string.split(ndiff_output,'\n'):
# Print line if it is a difference line
if line[:2] == "+ " or line[:2] == "- " or line[:2] == "? ":
total = total + line + "\n"
flag = 1
else:
# Compress lines that are the same to print one blank line
if flag:
total = total + "\n"
flag = 0
if total == "\n":
print " File %s exists,\n but there is no difference between target and source files.\n" % (dest_path)
return
if type(prompt_replace) == type(""):
print prompt_replace
while 1:
temp = raw_input("\n File %s\n exists and is different from source file.\n DO YOU WANT TO,\n overwrite [o]\n do not overwrite [d]\n view differences [v]: " % (dest_path))
print
temp = string.lower(temp[0])
if temp == "d":
return
if temp == "v":
print total
print "\nLEGEND\n A leading '- ' indicates line to remove from installed file\n A leading '+ ' indicates line to add to installed file\n A leading '? ' shows intraline differences."
if temp == "o":
ReplaceFile(src_path, dest_path, mode, set_python_paths, prompt_replace, compile_it)
return
else:
ReplaceFile(src_path, dest_path, mode, set_python_paths, prompt_replace, compile_it)
return
def ReplaceFile(src_path, dest_path, mode, set_python_paths, prompt_replace, compile_it):
try:
contents = open(src_path, "r").read()
except IOError, e:
Error(str(e))
if set_python_paths:
contents = SetPythonPaths(contents)
## write the file to the destination location
path, basename = os.path.split(dest_path)
MkDir(path)
try:
open(dest_path, "w").write(contents)
except IOError, e:
if e[0] == 13:
# EACCES: permission denied
Error("You do not have permission to write file %s" % dest_path)
Error("Unknown error writing file %s" % dest_path, IOError, e)
if prompt_replace and os.path.exists(dest_path):
if type(prompt_replace) == type(""):
print prompt_replace
temp = raw_input("File %s exists, overwrite? [y/N]: " % (dest_path))
if not temp or string.lower(temp[0]) != "y":
return
os.chmod(dest_path, mode)
if compile_it:
py_compile.compile(dest_path)
return
try:
contents = open(src_path, "r").read()
except IOError, e:
Error(str(e))
if set_python_paths:
contents = SetPythonPaths(contents)
## write the file to the destination location
path, basename = os.path.split(dest_path)
MkDir(path)
try:
open(dest_path, "w").write(contents)
except IOError, e:
if e[0] == 13:
# EACCES: permission denied
Error("You do not have permission to write file %s" % dest_path)
Error("Unknown error writing file %s" % dest_path, IOError, e)
os.chmod(dest_path, mode)
if compile_it:
py_compile.compile(dest_path)
## MAIN
@@ -255,7 +194,7 @@ if __name__ == "__main__":
print "Installing ViewCVS to:", ROOT_DIR
for args in FILE_INFO_LIST:
print " ", args[0]
print " ", args[0]
apply(InstallFile, args)
print

View File

@@ -15,13 +15,9 @@
</td>
</tr>
<tr><td width="1%" valign=top bgcolor="#ffffff">
<h3>Help</h3>
<h3>Other&nbsp;Help</h3>
<a href="help_rootview.html">General</a><br>
<b>Directory&nbsp;View</b><br>
<a href="help_log.html">Classic&nbsp;Log&nbsp;View</a><br>
<a href="help_logtable.html">Alternative&nbsp;Log&nbsp;View</a><br>
<a href="help_query.html">Query&nbsp;Database</a><br>
<h3>Internet</h3>
<a href="http://viewcvs.sf.net/index.html">Home</a><br>
<a href="http://viewcvs.sf.net/upgrading.html">Upgrading</a><br>

View File

@@ -1,61 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>ViewCVS Help: Classic CVS Log View</title>
</head>
<body background="images/chalk.jpg">
<table width="100&#37;" cellspacing=5>
<tr>
<td width="1%"><a href="http://viewcvs.sf.net/index.html"><img border=0
src="images/logo.png"></a>
</td>
<td>
<h1>ViewCVS Help: Classic CVS Log View</h1>
</td>
</tr>
<tr><td width="1%" valign=top bgcolor="#ffffff">
<h3>Help</h3>
<a href="help_rootview.html">General</a><br>
<a href="help_dirview.html">Directory&nbsp;View</a><br>
<b>Classic&nbsp;Log&nbsp;View</b><br>
<a href="help_logtable.html">Alternative&nbsp;Log&nbsp;View</a><br>
<a href="help_query.html">Query&nbsp;Database</a><br>
<h3>Internet</h3>
<a href="http://viewcvs.sf.net/index.html">Home</a><br>
<a href="http://viewcvs.sf.net/upgrading.html">Upgrading</a><br>
<a href="http://viewcvs.sf.net/contributing.html">Contributing</a><br>
<a href="http://viewcvs.sf.net/license-1.html">License</a><br>
</td><td colspan=2>
<p>
The log view displays the revision history of the selected source
file. For each revision the following information is displayed:
<ul>
<li>the revision number (clickable to download it)</li>
<li>a link to view this revision annotated</li>
<li>a link to select this revision for diffs (see below)</li>
<li>the date and age of this change</li>
<li>and the author of this modification.</li>
<li>The CVS branch (usually <code>MAIN</code>, if not on a branch).</li>
<li>Possibly a list of CVS tags bound to this revision (if any).</li>
<li>The size of this change measured in added and removed lines of
code.</li>
<li>Links to view Diffs to the previous revision or possibly to
an arbitrary selected revision (if any, see above).
<li>And last but not least, the commit log message which should tell
about the reason for this change.</li>
</ul>
</p><p>
At the bottom of such a page you will find a form which allows
to request diffs between arbitrary revisions.
</p>
</td></tr></table>
<hr>
<address><a href="mailto:viewcvs-dev@lyra.org">ViewCVS Group</a></address>
<!-- Created: Thu Oct 25 22:08:29 CEST 2001 -->
<!-- hhmts start -->
Last modified: Wed Dec 12 13:56:52 CET 2001
<!-- hhmts end -->
</body>
</html>

View File

@@ -1,59 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>ViewCVS Help: CVS Log Table View</title>
</head>
<body background="images/chalk.jpg">
<table width="100&#37;" cellspacing=5>
<tr>
<td width="1%"><a href="http://viewcvs.sf.net/index.html"><img border=0
src="images/logo.png"></a>
</td>
<td>
<h1>ViewCVS Help: CVS Log Table View</h1>
</td>
</tr>
<tr><td width="1%" valign=top bgcolor="#ffffff">
<h3>Help</h3>
<a href="help_rootview.html">General</a><br>
<a href="help_dirview.html">Directory&nbsp;View</a><br>
<a href="help_log.html">Classic&nbsp;Log&nbsp;View</a><br>
<b>Alternative&nbsp;Log&nbsp;View</b><br>
<a href="help_query.html">Query&nbsp;Database</a><br>
<h3>Internet</h3>
<a href="http://viewcvs.sf.net/index.html">Home</a><br>
<a href="http://viewcvs.sf.net/upgrading.html">Upgrading</a><br>
<a href="http://viewcvs.sf.net/contributing.html">Contributing</a><br>
<a href="http://viewcvs.sf.net/license-1.html">License</a><br>
</td><td colspan=2>
<p>
The table based log view must be enabled in the site wide
ViewCVS configuration file.
</p><p>
It displays the revision history of the selected source
file in a table containing the following columns:
<ul>
<li><b>Revision</b>: The CVS revision number.</li>
<li><b>Tasks</b>: This column contains several links to view
a revision.</li>
<li><b>Diffs</b>: Several links to view the changes between this
and other revisions.
<li><b>Branches and Tags</b>: Displays the branch and a pulldown
menu button displaying all tags bound to that revision</li>
<li>FIXME: Document the other columns</li>
</ul>
</p><p>
At the bottom of such a page you will find a form which allows
to request diffs between arbitrary revisions.
</p>
</td></tr></table>
<hr>
<address><a href="mailto:viewcvs-dev@lyra.org">ViewCVS Group</a></address>
<!-- Created: Thu Oct 25 22:08:29 CEST 2001 -->
<!-- hhmts start -->
Last modified: Sat Dec 8 23:26:52 CET 2001
<!-- hhmts end -->
</body>
</html>

View File

@@ -16,10 +16,6 @@
<h3>Other&nbsp;Help:</h3>
<a href="help_rootview.html">General</a><br>
<a href="help_dirview.html">Directory&nbsp;View</a><br>
<a href="help_log.html">Classic&nbsp;Log&nbsp;View</a><br>
<a href="help_logtable.html">Alternative&nbsp;Log&nbsp;View</a><br>
<b>Query&nbsp;Database</b>
<h3>Internet</h3>
<a href="http://viewcvs.sf.net/index.html">Home</a><br>
<a href="http://viewcvs.sf.net/upgrading.html">Upgrading</a><br>

View File

@@ -15,13 +15,9 @@
</td>
</tr>
<tr><td width="1%" valign=top bgcolor="#ffffff">
<h3>Help</h3>
<b>General</b>
<h3>Other&nbsp;Help</h3>
<a href="help_dirview.html">Directory&nbsp;View</a><br>
<a href="help_log.html">Classic&nbsp;Log&nbsp;View</a><br>
<a href="help_logtable.html">Alternative&nbsp;Log&nbsp;View</a><br>
<a href="help_query.html">Query&nbsp;Database</a><br>
<h3>Internet</h3>
<a href="http://viewcvs.sf.net/index.html">Home</a><br>
<a href="http://viewcvs.sf.net/upgrading.html">Upgrading</a><br>

View File

@@ -13,7 +13,7 @@
</td>
<td align=center valign=top bgcolor="white" width="1%">
<b>Quickstart:</b>
<a href="viewcvs-0.9.tar.gz">download</a>
<a href="viewcvs-0.8.tar.gz">download</a>
</td>
<td width="1%"><a href="http://sourceforge.net/"><img border=0
src="http://sourceforge.net/sflogo.php?group_id=18760&type=1"></a><br><a href="http://sourceforge.net/projects/viewcvs/">ViewCVS&nbsp;project&nbsp;page</a>
@@ -128,11 +128,6 @@
ViewCVS by editing the provided EZT templates, which are used
to generate the pages.
</li>
<li>
Internationalization support: ViewCVS will parse and handle
the Accept-Language request header, and can select different
inputs for localized page generation.
</li>
<li>
Colorization for many file types via <code>enscript</code>.
</li>
@@ -150,18 +145,11 @@
across virtual hosts, yet still be able to fine-tune the
options when necessary.
</li>
<li>
Automatic generation of tarballs for the HEAD or a specified
tag.
</li>
<li>
Runs either as CGI script, called from an installed web server
(such as <a href="http://httpd.apache.org/"><i>Apache</i></a>),
or as a standalone server.
</li>
<li>
Searching files for matches for a regular expression.
</li>
<li>Better reporting for unreadable files.</li>
<li>
More robust when given varying <code>rcsdiff</code> or
@@ -210,10 +198,10 @@
The software is available for download:
</p>
<blockquote>
<a href="viewcvs-0.9.tar.gz">Version 0.9 of ViewCVS as a gzipped
<a href="viewcvs-0.8.tar.gz">Version 0.8 of ViewCVS as a gzipped
tar</a>
<br>
<a href="viewcvs-0.9.zip">Version 0.9 of ViewCVS as a ZIP
<a href="viewcvs-0.8.zip">Version 0.8 of ViewCVS as a ZIP
file</a>
</blockquote>
<p>
@@ -299,7 +287,7 @@
<address><a href="mailto:viewcvs@lyra.org">ViewCVS Users Group</a></address>
<!-- Created: Fri Dec 3 02:51:37 PST 1999 -->
<!-- hhmts start -->
Last modified: Sun Dec 23 03:23:09 PST 2001
Last modified: Mon Dec 10 05:38:45 PST 2001
<!-- hhmts end -->
</body>
</html>

View File

@@ -41,185 +41,18 @@
</p>
<ul>
<li><a href="#from8">Upgrading from ViewCVS 0.8</a></li>
<li><a href="#from7">Upgrading from ViewCVS 0.7 or earlier</a></li>
</ul>
<hr>
<h2><a name="from8">Upgrading from ViewCVS 0.8</a></h2>
<p>
This section discusses how to upgrade ViewCVS 0.8 to version
0.9 or a later version of the software.
</p>
<h3>Configuration Options</h3>
<p>
More templates were introduced in version 0.8 of the software,
which made many of the configuration options obsolete. This
section covers which options were removed. If you made any
changes to these options, then you will need to make
corresponding changes in the templates.
</p>
<blockquote>
<dl>
<dt>
Colors:
<strong>diff_heading</strong>,
<strong>diff_empty</strong>,
<strong>diff_remove</strong>,
<strong>diff_change</strong>,
<strong>diff_add</strong>,
and <strong>diff_dark_change</strong>
</dt>
<dd>
These options have been incorporated into the
<code>diff.ezt</code> template.
<p></p>
</dd>
<dt><strong>markup_log</strong></dt>
<dd>
This option has been incorporated into the
<code>markup.ezt</code> template.
<p></p>
</dd>
<dt>Colors: <strong>nav_header</strong>
and <strong>alt_background</strong></dt>
<dd>
These options have been incorporated into the
<code>header.ezt</code> template.
<p></p>
</dd>
<dt>
Images:
<strong>back_icon</strong>,
<strong>dir_icon</strong>,
and <strong>file_icon</strong>
</dt>
<dd>
These options have been incorporated into the
<code>directory.ezt</code>, <code>header.ezt</code>,
<code>log.ezt</code>, <code>log_table.ezt</code>, and
<code>query.ezt</code> templates.
<p></p>
</dd>
<dt><strong>use_java_script</strong>
and <strong>open_extern_window</strong></dt>
<dd>
The templates now use JavaScript in all applicable places,
and open external windows for most downloading and viewing
of files. If you wish to not use JavaScript and/or external
windows, then remove the feature(s) from the templates.
<p></p>
</dd>
<dt><strong>show_author</strong></dt>
<dd>
Changing this option would be quite strange and rare. If you
do not want to show the author for the revisions, then you
should remove it from the various templates.
<p></p>
</dd>
<dt><strong>hide_non_readable</strong></dt>
<dd>
This option was never used, so it has been removed.
<p></p>
</dd>
<dt><strong>flip_links_in_dirview</strong></dt>
<dd>
This option is no longer available. If you want the links in
your directory view flipped, then you may use the
<code>dir_alternate.ezt</code> template.
<p></p>
</dd>
</dl>
</blockquote>
<h3>Template Variables</h3>
<p>
Some template variables that were available in 0.8 have been
removed in 0.9. If you have custom templates that refer to these
variables, then you will need to modify your templates.
</p>
<blockquote>
<dl>
<dt><code>directory.ezt</code>: <var>headers</var></dt>
<dd>
The headers are now listed explicitly in the template,
rather than made available through a list.
<p></p>
</dd>
<dt>
<code>directory.ezt</code>:
<var>rows.cols</var>,
and <var>rows.span</var>
</dt>
<dd>
These variables were used in conjunction with the
<var>headers</var> variable to control the column
displays. This is now controlled explicitly within the
templates.
<p></p>
</dd>
<dt><code>directory.ezt</code>:
<var>rev_in_front</var></dt>
<dd>
This was used to indicate that revision links should
be used in the first column, rather than in their
standard place in the second column. Changing the
links should now be done in the template, rather than
according to this variable. You may want to look at
the <code>dir_alternate.ezt</code> template, which has
the revision in front.
<p></p>
</dd>
<dt><code>directory.ezt</code>:
<var>rows.attic</var>
and <var>rows.hide_attic_href</var></dt>
<dd>
These variable were used to manage the hide and
showing of the contents of the <code>Attic/</code>
subdirectory. Several new variables were introduced
which can be used to replace this functionality:
<var>show_attic_href</var>,
<var>hide_attic_href</var>, and <var>rows.state</var>.
<p></p>
</dd>
</dl>
</blockquote>
<hr>
<h2><a name="from7">Upgrading from ViewCVS 0.7 or earlier</a></h2>
<p>
This section discusses how to upgrade ViewCVS 0.7, or earlier,
to 0.8 or a later version of the software.
</p>
<p>
<strong>NOTE:</strong> these changes will bring you up to the
requirements of version 0.8. You must also follow the directions
for <a href="#from8">upgrading from 0.8</a>.
This section discusses how to upgrade ViewCVS 0.7 or earlier to
0.8 or a later version of the software.
</p>
<h3>Configuration Options</h3>
<h3>Templates</h3>
<p>
The largest change from 0.7 to 0.8, that you will need to deal
with, is the introduction of templates. This shifted many
@@ -331,17 +164,6 @@
<p></p>
</dd>
<dt>Colors: <strong>text</strong>
and <strong>background</strong></dt>
<dd>
These options have been incorporated into the
<code>directory.ezt</code>, <code>log.ezt</code>, and
<code>log_table.ezt</code> templates.
<p></p>
</dd>
</dl>
</blockquote>
@@ -350,7 +172,7 @@
<address><a href="mailto:viewcvs@lyra.org">ViewCVS Users Group</a></address>
<!-- Created: Mon Sep 24 04:23:53 PDT 2001 -->
<!-- hhmts start -->
Last modified: Sat Dec 22 20:05:14 PST 2001
Last modified: Mon Dec 10 02:06:31 PST 2001
<!-- hhmts end -->
</body>
</html>