mirror of
https://github.com/vitalif/viewvc-4intranet
synced 2019-04-16 04:14:59 +03:00
Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
51298ea2b8 | ||
![]() |
51011abec8 | ||
![]() |
0bbe7f5751 | ||
![]() |
1df169ab24 | ||
![]() |
98e7612420 | ||
![]() |
70b0076d88 | ||
![]() |
e23b88d389 | ||
![]() |
336ee6b95d | ||
![]() |
642130cf93 | ||
![]() |
1e3c57f2e0 | ||
![]() |
9693f2b981 | ||
![]() |
69ab22922f | ||
![]() |
d422c3abc9 | ||
![]() |
ded0015f5c | ||
![]() |
6232555f79 | ||
![]() |
81fa4ce6fd | ||
![]() |
98378e7560 | ||
![]() |
8da2897df2 | ||
![]() |
45bca25fbc | ||
![]() |
a54b3bcbbe |
119
CHANGES
119
CHANGES
@@ -1,56 +1,70 @@
|
||||
Version 1.0 (1-May-2006)
|
||||
Version 1.0.2 (released 29-Sep-2006)
|
||||
|
||||
* minor documentation fixes
|
||||
* fix Subversion annotate functionality on Windows (issue #18)
|
||||
* fix annotate assertions on uncanonicalized #include paths (issue #208)
|
||||
* make RSS URL method match the method used to generate it (issue #245)
|
||||
* fix Subversion annotation to run non-interactively, preventing hangs
|
||||
* fix bug in custom syntax highlighter fallback logic
|
||||
* fix bug in PHP CGI hack to avoid force-cgi-redirect errors
|
||||
|
||||
Version 1.0.1 (released 20-Jul-2006)
|
||||
|
||||
* fix exception on log page when use_pagesize is enabled
|
||||
* fix an XHTML validation bug in the footer template (issue #239)
|
||||
* fix handling of single-component CVS revision numbers (issue #237)
|
||||
* fix bug in download-as-text URL link generation (issue #241)
|
||||
* fix query.cgi bug, missing 'rss_href' template data item (issue #249)
|
||||
* no longer omit empty Subversion directories from tarballs (issue #250)
|
||||
* use actual modification time for Subversion directories in tarballs
|
||||
|
||||
Version 1.0 (released 01-May-2006)
|
||||
|
||||
* add support for viewing Subversion repositories
|
||||
* add support for running on MS Windows (2003-Feb-09)
|
||||
* generate strict XHTML output (2005-Sep-08)
|
||||
* add support for running on MS Windows
|
||||
* generate strict XHTML output
|
||||
* add support for caching by sending "Last-Modified", "Expires",
|
||||
"ETag", and "Cache-Control" headers (2004-Jun-03)
|
||||
"ETag", and "Cache-Control" headers
|
||||
* add support for Mod_Python on Apache 2.x and ASP on IIS
|
||||
* Several changes to standalone.py:
|
||||
- -h commandline option to specify hostname for non local use.
|
||||
- -r commandline option may be repeated to use more than repository
|
||||
before actually installing ViewCVS.
|
||||
- New GUI field to test paging.
|
||||
* add new, better-integrated query interface (2004-Jul-17)
|
||||
* add integrated RSS feeds (2005-Dec-22)
|
||||
* add new, better-integrated query interface
|
||||
* add integrated RSS feeds
|
||||
* add new "root_as_url_component" option to embed root names as
|
||||
path components in ViewCVS URLs for a more natural URL scheme
|
||||
in ViewCVS configurations with multiple repositories.
|
||||
(2002-Dec-12)
|
||||
* add new "use_localtime" option to display local times instead of
|
||||
UTC times (2002-May-06)
|
||||
* add new "use_localtime" option to display local times instead of UTC times
|
||||
* add new "root_parents" option to make it possible to add and
|
||||
remove repositories without modifying the ViewCVS configuration
|
||||
(2004-Jul-16)
|
||||
* add new "template_dir" option to facilitate switching between
|
||||
sets of templates (2005-Feb-08)
|
||||
* add new "template_dir" option to facilitate switching between sets of
|
||||
templates
|
||||
* add new "sort_group_dirs" option to disable grouping of
|
||||
directories in directory listings (2005-Mar-07)
|
||||
* add new "port" option to connect to a MySQL database on a nonstandard
|
||||
port (2005-Dec-22)
|
||||
directories in directory listings
|
||||
* add new "port" option to connect to a MySQL database on a nonstandard port
|
||||
* make "default_root" option optional. When no root is specified,
|
||||
show a page listing all available repositories (2005-Feb-04)
|
||||
show a page listing all available repositories
|
||||
* add "default_file_view" option to make it possible for relative
|
||||
links and image paths in checked out HTML files to work without
|
||||
the need for special /*checkout*/ prefixes in URLs. Deprecate
|
||||
"checkout_magic" option and disable by default (2006-Apr-03)
|
||||
* add "limit_changes" option to limit number of changed files shown
|
||||
per commit by default in query results and in the Subversion revision
|
||||
view (2005-Dec-23)
|
||||
"checkout_magic" option and disable by default
|
||||
* add "limit_changes" option to limit number of changed files shown per
|
||||
commit by default in query results and in the Subversion revision view
|
||||
* hide CVS "Attic" directories and add simple toggle for showing
|
||||
dead files in directory listings (2004-Jul-31)
|
||||
dead files in directory listings
|
||||
* show Unified, Context and Side-by-side diffs in HTML instead of
|
||||
in bare text pages (2004-Jun-22)
|
||||
in bare text pages
|
||||
* make View/Download links work the same for all file types
|
||||
(2004-Jan-21)
|
||||
* add links to tip of selected branch on log page (2005-Oct-03)
|
||||
* allow use of "Highlight" program for colorizing (2005-Dec-20)
|
||||
* add links to tip of selected branch on log page
|
||||
* allow use of "Highlight" program for colorizing
|
||||
* enable enscript colorizing for more file types
|
||||
* add sorting arrows for directory views (2004-Jul-21)
|
||||
* get rid of popup windows for checkout links (2004-Jan-21)
|
||||
* add sorting arrows for directory views
|
||||
* get rid of popup windows for checkout links
|
||||
* obfuscate email addresses in html output by encoding @ symbol
|
||||
with an HTML character reference (2004-Jul-29)
|
||||
* add paging capability (2001-Dec-31)
|
||||
with an HTML character reference
|
||||
* add paging capability
|
||||
* Improvements to templates
|
||||
- add new template authoring guide
|
||||
- increase coverage, use templates to produce HTML for diff pages,
|
||||
@@ -59,43 +73,36 @@ Version 1.0 (1-May-2006)
|
||||
- add new template variables providing ViewCVS URLs for more
|
||||
links between related pages and less URL generation inside
|
||||
templates
|
||||
* add new [define] EZT directive for assigning variables within
|
||||
templates (2004-Apr-21)
|
||||
* add new [define] EZT directive for assigning variables within templates
|
||||
* add command line argument parsing to install script to allow
|
||||
non-interactive installs (2005-Jan-06)
|
||||
* add stricter parameter validation to lower likelihood of CSS
|
||||
vulnerabilities (2002-May-24)
|
||||
non-interactive installs
|
||||
* add stricter parameter validation to lower likelihood of cross-site
|
||||
scripting vulnerabilities
|
||||
* add support for cvsweb's "mime_type=text/x-cvsweb-markup" URLs
|
||||
(2002-Oct-10)
|
||||
* fix incompatibility with enscript 1.6.3 (2002-Feb-05)
|
||||
* fix bug in parsing FreeBSD rlog output (2003-Jul-24)
|
||||
* fix incompatibility with enscript 1.6.3
|
||||
* fix bug in parsing FreeBSD rlog output
|
||||
* work around rlog assumption all two digit years in RCS files are
|
||||
relative to the year 1900. (2005-Sep-30)
|
||||
relative to the year 1900.
|
||||
* change loginfo-handler to cope with spaces in filenames and
|
||||
support a simpler command line invocation from CVS (2003-Feb-11)
|
||||
support a simpler command line invocation from CVS
|
||||
* make cvsdbadmin work properly when invoked on CVS subdirectory
|
||||
paths instead of top-level CVS root paths (2006-Mar-17)
|
||||
* show diff error when comparing two binary files (2002-Jan-23)
|
||||
* make regular expression search skip binary files (2002-Jan-17)
|
||||
paths instead of top-level CVS root paths
|
||||
* show diff error when comparing two binary files
|
||||
* make regular expression search skip binary files
|
||||
* make regular expression search skip nonversioned files in CVS
|
||||
directories instead of choking on them (2002-Sep-27)
|
||||
directories instead of choking on them
|
||||
* fix tarball generator so it doesn't include forbidden modules
|
||||
(2002-Feb-22)
|
||||
* output "404 Not Found" errors instead of "403 Forbidden" errors
|
||||
to not reveal whether forbidden paths exist (2005-May-17)
|
||||
* fix sorting bug in directory view (2002-Apr-18)
|
||||
to not reveal whether forbidden paths exist
|
||||
* fix sorting bug in directory view
|
||||
* reset log and directory page numbers when leaving those pages
|
||||
(2005-Jan-29)
|
||||
* reset sort direction in directory listing when clicking new
|
||||
columns (2004-Jul-21)
|
||||
* fix "Accept-Language" handling for Netscape 4.x browsers
|
||||
(2002-May-23)
|
||||
* fix file descriptor leak in standalone server (2004-Jul-17)
|
||||
* clean up zombie processes from running enscript (2002-Jun-15)
|
||||
* fix mysql "Too many connections" error in cvsdbadmin (2003-Jul-24)
|
||||
* get rid of mxDateTime dependency for query database (2003-Feb-09)
|
||||
* reset sort direction in directory listing when clicking new columns
|
||||
* fix "Accept-Language" handling for Netscape 4.x browsers
|
||||
* fix file descriptor leak in standalone server
|
||||
* clean up zombie processes from running enscript
|
||||
* fix mysql "Too many connections" error in cvsdbadmin
|
||||
* get rid of mxDateTime dependency for query database
|
||||
* store query database times in UTC instead of local time
|
||||
(2003-Feb-09)
|
||||
* fix daylight saving time bugs in various parts of the code
|
||||
|
||||
Version 0.9.4 (released 17-Aug-2005)
|
||||
|
34
INSTALL
34
INSTALL
@@ -64,10 +64,10 @@ Congratulations on getting this far. :-)
|
||||
To start installing right away (on UNIX): type "./viewvc-install"
|
||||
in the current directory and answer the prompts. When it
|
||||
finishes, edit the file viewvc.conf in the installation directory
|
||||
to tell viewvc the paths to your CVS and Subversion repositories. Next,
|
||||
configure your web server to run <INSTALL>/cgi/viewvc.cgi, as
|
||||
appropriate for your web server. The section `INSTALLING VIEWVC'
|
||||
below is still recommended reading.
|
||||
to tell viewvc the paths to your CVS and Subversion repositories.
|
||||
Next, configure your web server (in the way appropriate to that browser)
|
||||
to run <VIEWVC_INSTALLATION_DIRECTORY>/bin/cgi/viewvc.cgi. The section
|
||||
`INSTALLING VIEWVC' below is still recommended reading.
|
||||
|
||||
|
||||
INSTALLING VIEWVC
|
||||
@@ -118,12 +118,12 @@ installation instructions.
|
||||
then edit the files in <VIEWVC_INSTALLATION_DIRECTORY>/templates.
|
||||
You need knowledge about HTML to edit the templates.
|
||||
|
||||
4) The CGI programs are in <VIEWVC_INSTALLATION_DIRECTORY>/www/cgi/. You can
|
||||
4) The CGI programs are in <VIEWVC_INSTALLATION_DIRECTORY>/bin/cgi/. You can
|
||||
symlink to this directory from somewhere in your published HTTP server
|
||||
path if your webserver is configured to follow symbolic links. You can
|
||||
also copy the installed <VIEWVC_INSTALLATION_DIRECTORY>/www/cgi/*.cgi
|
||||
also copy the installed <VIEWVC_INSTALLATION_DIRECTORY>/bin/cgi/*.cgi
|
||||
scripts after the install (unlike the other files in ViewVC, the scripts
|
||||
under www/ can be moved).
|
||||
under bin/ can be moved).
|
||||
|
||||
If you are using Apache, then see below at the section
|
||||
titled APACHE CONFIGURATION.
|
||||
@@ -149,26 +149,26 @@ Either METHOD A:
|
||||
2) The ScriptAlias directive is very useful for pointing
|
||||
directly to the viewvc.cgi script. Simply insert a line containing
|
||||
|
||||
ScriptAlias /viewvc <VIEWVC_INSTALLATION_DIRECTORY>/www/cgi/viewvc.cgi
|
||||
ScriptAlias /viewvc <VIEWVC_INSTALLATION_DIRECTORY>/bin/cgi/viewvc.cgi
|
||||
|
||||
into your httpd.conf file. Choose the location in httpd.conf where
|
||||
also the other ScriptAlias lines reside. Some examples:
|
||||
|
||||
ScriptAlias /viewvc /usr/local/viewvc-1.0/www/cgi/viewvc.cgi
|
||||
ScriptAlias /query /usr/local/viewvc-1.0/www/cgi/query.cgi
|
||||
ScriptAlias /viewvc /usr/local/viewvc-1.0/bin/cgi/viewvc.cgi
|
||||
ScriptAlias /query /usr/local/viewvc-1.0/bin/cgi/query.cgi
|
||||
|
||||
continue with step 3).
|
||||
|
||||
or alternatively METHOD B:
|
||||
2) Copy the CGI scripts from
|
||||
<VIEWVC_INSTALLATION_DIRECTORY>/www/cgi/*.cgi
|
||||
<VIEWVC_INSTALLATION_DIRECTORY>/bin/cgi/*.cgi
|
||||
to the /cgi-bin/ directory configured in your httpd.conf file.
|
||||
|
||||
continue with step 3).
|
||||
|
||||
and then there's METHOD C:
|
||||
2) Copy the CGI scripts from
|
||||
<VIEWVC_INSTALLATION_DIRECTORY>/www/cgi/*.cgi
|
||||
<VIEWVC_INSTALLATION_DIRECTORY>/bin/cgi/*.cgi
|
||||
to the directory of your choosing in the Document Root adding the following
|
||||
apache directives for the directory in httpd.conf or an .htaccess file:
|
||||
|
||||
@@ -183,7 +183,7 @@ and then there's METHOD C:
|
||||
|
||||
or if you've got Mod_Python installed you can use METHOD D:
|
||||
2) Copy the Python scripts and .htaccess file from
|
||||
<VIEWVC_INSTALLATION_DIRECTORY>/www/mod_python/
|
||||
<VIEWVC_INSTALLATION_DIRECTORY>/bin/mod_python/
|
||||
to a directory being served by apache.
|
||||
|
||||
In httpd.conf, make sure that "AllowOverride All" or at least
|
||||
@@ -246,7 +246,7 @@ there are some additional steps required to get the database working.
|
||||
Optionally, you can create a second user with read-only access to the
|
||||
database.
|
||||
|
||||
3) Run the <VIEWVC_INSTALLATION_DIRECTORY>/make-database script. It will
|
||||
3) Run the <VIEWVC_INSTALLATION_DIRECTORY>/bin/make-database script. It will
|
||||
prompt you for your MySQL user, password, and the name of database you
|
||||
want to create. The database name defaults to "ViewVC". This script
|
||||
creates the database and sets up the empty tables. If you run this on a
|
||||
@@ -285,7 +285,7 @@ there are some additional steps required to get the database working.
|
||||
To get real-time updates, you'll want to checkout the CVSROOT module
|
||||
from your CVS repository and edit CVSROOT/loginfo. Add the line:
|
||||
|
||||
ALL <VIEWVC_INSTALLATION_DIRECTORY>/loginfo-handler %{sVv}
|
||||
ALL <VIEWVC_INSTALLATION_DIRECTORY>/bin/loginfo-handler %{sVv}
|
||||
|
||||
If you have other scripts invoked by CVSROOT/loginfo, you will want
|
||||
to make sure to change any running under the "DEFAULT" keyword to
|
||||
@@ -295,7 +295,7 @@ there are some additional steps required to get the database working.
|
||||
If you are running the Unix port of CVS-NT, you'll need to use a
|
||||
slightly different command line:
|
||||
|
||||
ALL <VIEWVC_INSTALLATION_DIRECTORY>/loginfo-handler %{sVv} cvsnt
|
||||
ALL <VIEWVC_INSTALLATION_DIRECTORY>/bin/loginfo-handler %{sVv} cvsnt
|
||||
|
||||
The extra 'cvsnt' parameter tells the handler script to parse the
|
||||
commit information in a different way.
|
||||
@@ -316,7 +316,7 @@ there are some additional steps required to get the database working.
|
||||
#!/bin/sh
|
||||
REPOS="$1"
|
||||
REV="$2"
|
||||
<VIEWVC_INSTALLATION_DIRECTORY>/svndbadmin rebuild "$REPOS" "$REV"
|
||||
<VIEWVC_INSTALLATION_DIRECTORY>/bin/svndbadmin rebuild "$REPOS" "$REV"
|
||||
|
||||
If you allow revision property changes in your repository, create a
|
||||
post-revprop-change hook script containing the same commands as the
|
||||
|
35
lib/blame.py
35
lib/blame.py
@@ -42,25 +42,28 @@ def link_includes(text, repos, path_parts, include_url):
|
||||
match = re_includes.match(text)
|
||||
if match:
|
||||
incfile = match.group(3)
|
||||
include_path_parts = path_parts[:-1]
|
||||
for part in filter(None, string.split(incfile, '/')):
|
||||
if part == "..":
|
||||
if not include_path_parts:
|
||||
# nothing left to pop; don't bother marking up this include.
|
||||
return text
|
||||
include_path_parts.pop()
|
||||
elif part and part != ".":
|
||||
include_path_parts.append(part)
|
||||
|
||||
# check current directory and parent directory for file
|
||||
for depth in (-1, -2):
|
||||
include_path = path_parts[:depth] + [incfile]
|
||||
try:
|
||||
# will throw if path doesn't exist
|
||||
if repos.itemtype(include_path, None) == vclib.FILE:
|
||||
break
|
||||
except vclib.ItemNotFound:
|
||||
pass
|
||||
else:
|
||||
include_path = None
|
||||
include_path = None
|
||||
try:
|
||||
if repos.itemtype(include_path_parts, None) == vclib.FILE:
|
||||
include_path = string.join(include_path_parts, '/')
|
||||
except vclib.ItemNotFound:
|
||||
pass
|
||||
|
||||
if include_path:
|
||||
url = string.replace(include_url, '/WHERE/',
|
||||
string.join(include_path, '/'))
|
||||
return '#%sinclude%s<a href="%s">"%s"</a>' % \
|
||||
(match.group(1), match.group(2), url, incfile)
|
||||
|
||||
return '#%sinclude%s<a href="%s">"%s"</a>' % \
|
||||
(match.group(1), match.group(2),
|
||||
string.replace(include_url, '/WHERE/', include_path), incfile)
|
||||
|
||||
return text
|
||||
|
||||
|
||||
|
@@ -403,6 +403,7 @@ def main(server, cfg, viewvc_link):
|
||||
'query' : query,
|
||||
'commits' : commits,
|
||||
'num_commits' : len(commits),
|
||||
'rss_href' : None,
|
||||
}
|
||||
|
||||
if form_data.hours:
|
||||
|
@@ -474,7 +474,7 @@ def _tag_tuple(revision_string):
|
||||
t = map(int, string.split(revision_string, '.'))
|
||||
l = len(t)
|
||||
if l == 1:
|
||||
raise ValueError
|
||||
return ()
|
||||
if l > 2 and t[-2] == 0 and l % 2 == 0:
|
||||
del t[-2]
|
||||
return tuple(t)
|
||||
|
@@ -483,10 +483,18 @@ class BlameSource:
|
||||
self.last = None
|
||||
self.first_rev = first_rev
|
||||
|
||||
# Do a little dance to get a URL that works in both Unix-y and
|
||||
# Windows worlds.
|
||||
rootpath = os.path.abspath(rootpath)
|
||||
if rootpath and rootpath[0] != '/':
|
||||
rootpath = '/' + rootpath
|
||||
if os.sep != '/':
|
||||
rootpath = string.replace(rootpath, os.sep, '/')
|
||||
|
||||
url = 'file://' + string.join([rootpath, fs_path], "/")
|
||||
fp = popen.popen(svn_client_path,
|
||||
('blame', "-r%d" % int(rev), "%s@%d" % (url, int(rev))),
|
||||
('blame', "-r%d" % int(rev), "--non-interactive",
|
||||
"%s@%d" % (url, int(rev))),
|
||||
'rb', 1)
|
||||
self.fp = fp
|
||||
|
||||
|
112
lib/viewvc.py
112
lib/viewvc.py
@@ -14,7 +14,7 @@
|
||||
#
|
||||
# -----------------------------------------------------------------------
|
||||
|
||||
__version__ = '1.0.0'
|
||||
__version__ = '1.0.2'
|
||||
|
||||
# this comes from our library; measure the startup time
|
||||
import debug
|
||||
@@ -946,7 +946,7 @@ def get_file_view_info(request, where, rev=None, mime_type=None, pathrev=-1):
|
||||
pathtype=vclib.FILE,
|
||||
params={'content-type': 'text/plain',
|
||||
'revision': rev,
|
||||
'pathrev': rev},
|
||||
'pathrev': pathrev},
|
||||
escape=1)
|
||||
if request.cfg.options.allow_annotate:
|
||||
annotate_href = request.get_url(view_func=view_annotate,
|
||||
@@ -1313,18 +1313,15 @@ def markup_stream_php(fp, cfg):
|
||||
if not cfg.options.use_php:
|
||||
return None
|
||||
|
||||
sys.stdout.flush()
|
||||
|
||||
# clearing the following environment variables prevents a
|
||||
# "No input file specified" error from the php cgi executable
|
||||
# when ViewVC is running under a cgi environment. when the
|
||||
# php cli executable is used they can be left alone
|
||||
#
|
||||
#os.putenv("GATEWAY_INTERFACE", "")
|
||||
#os.putenv("PATH_TRANSLATED", "")
|
||||
#os.putenv("REQUEST_METHOD", "")
|
||||
#os.putenv("SERVER_NAME", "")
|
||||
#os.putenv("SERVER_SOFTWARE", "")
|
||||
# The following HACK may be be used to allow a PHP CGI executable to be
|
||||
# invoked instead of a CLI executable, on systems that do not have PHP's
|
||||
# CLI (command line interface) installed. Just uncomment the following lines:
|
||||
#os.unsetenv("SERVER_SOFTWARE")
|
||||
#os.unsetenv("SERVER_NAME")
|
||||
#os.unsetenv("GATEWAY_INTERFACE")
|
||||
#os.unsetenv("REQUEST_METHOD")
|
||||
#os.unsetenv("SCRIPT_FILENAME")
|
||||
#os.unsetenv("PATH_TRANSLATED")
|
||||
|
||||
return MarkupPHP(cfg.options.php_exe_path, fp)
|
||||
|
||||
@@ -1425,14 +1422,17 @@ def view_markup(request):
|
||||
streamer = markup_streamers.get(ext)
|
||||
if streamer:
|
||||
markup_fp = streamer(fp, cfg)
|
||||
elif cfg.options.use_enscript:
|
||||
markup_fp = MarkupEnscript(cfg, fp, request.path_parts[-1])
|
||||
elif cfg.options.use_highlight:
|
||||
markup_fp = MarkupHighlight(cfg, fp, request.path_parts[-1])
|
||||
|
||||
# If no one has a suitable markup handler, we'll use the default.
|
||||
if not markup_fp:
|
||||
markup_fp = MarkupPipeWrapper(fp)
|
||||
# If there wasn't a custom streamer, or the streamer wasn't enabled, we'll
|
||||
# try to use one of the configured syntax highlighting programs.
|
||||
if not markup_fp:
|
||||
if cfg.options.use_enscript:
|
||||
markup_fp = MarkupEnscript(cfg, fp, request.path_parts[-1])
|
||||
elif cfg.options.use_highlight:
|
||||
markup_fp = MarkupHighlight(cfg, fp, request.path_parts[-1])
|
||||
else:
|
||||
# If no one has a suitable markup handler, we'll use the default.
|
||||
markup_fp = MarkupPipeWrapper(fp)
|
||||
|
||||
data['markup'] = markup_fp
|
||||
|
||||
@@ -2123,7 +2123,7 @@ def view_log(request):
|
||||
if cfg.options.use_pagesize:
|
||||
data['log_pagestart'] = int(request.query_dict.get('log_pagestart',0))
|
||||
data['entries'] = paging(data, 'entries', data['log_pagestart'],
|
||||
'revision', cfg.options.use_pagesize)
|
||||
'rev', cfg.options.use_pagesize)
|
||||
|
||||
request.server.header()
|
||||
generate_page(request, "log", data)
|
||||
@@ -2830,7 +2830,7 @@ def generate_tarball_header(out, name, size=0, mode=None, mtime=0,
|
||||
|
||||
out.write(block)
|
||||
|
||||
def generate_tarball(out, request, reldir, stack):
|
||||
def generate_tarball(out, request, reldir, stack, dir_mtime=None):
|
||||
# get directory info from repository
|
||||
rep_path = request.path_parts + reldir
|
||||
entries = request.repos.listdir(rep_path, request.pathrev, {})
|
||||
@@ -2847,30 +2847,43 @@ def generate_tarball(out, request, reldir, stack):
|
||||
if reldir:
|
||||
tar_dir = tar_dir + _path_join(reldir) + '/'
|
||||
|
||||
# Subdirectory datestamps will be the youngest of the datestamps of
|
||||
# version items (files for CVS, files or dirs for Subversion) in
|
||||
# that subdirectory.
|
||||
latest_date = 0
|
||||
cvs = request.roottype == 'cvs'
|
||||
for file in entries:
|
||||
# Skip dead or busted CVS files, and CVS subdirs.
|
||||
if (cvs and (file.kind != vclib.FILE or (file.rev is None or file.dead))):
|
||||
continue
|
||||
if file.date > latest_date:
|
||||
latest_date = file.date
|
||||
|
||||
# If our caller doesn't dictate a datestamp to use for the current
|
||||
# directory, its datestamps will be the youngest of the datestamps
|
||||
# of versioned items in that subdirectory. We'll be ignoring dead
|
||||
# or busted items and, in CVS, subdirs.
|
||||
if dir_mtime is None:
|
||||
dir_mtime = 0
|
||||
for file in entries:
|
||||
if cvs and (file.kind != vclib.FILE or file.rev is None or file.dead):
|
||||
continue
|
||||
if file.date > dir_mtime:
|
||||
dir_mtime = file.date
|
||||
|
||||
# push directory onto stack. it will only be included in the tarball if
|
||||
# files are found underneath it
|
||||
# Push current directory onto the stack.
|
||||
stack.append(tar_dir)
|
||||
|
||||
# If this is Subversion, we generate a header for this directory
|
||||
# regardless of its contents. For CVS it will only get into the
|
||||
# tarball if it has files underneath it, which we determine later.
|
||||
if not cvs:
|
||||
generate_tarball_header(out, tar_dir, mtime=dir_mtime)
|
||||
|
||||
# Run through the files in this directory, skipping busted ones.
|
||||
for file in entries:
|
||||
if (file.kind != vclib.FILE or
|
||||
(cvs and (file.rev is None or file.dead))):
|
||||
if file.kind != vclib.FILE:
|
||||
continue
|
||||
if cvs and (file.rev is None or file.dead):
|
||||
continue
|
||||
|
||||
for dir in stack:
|
||||
generate_tarball_header(out, dir, mtime=latest_date)
|
||||
del stack[:]
|
||||
# If we get here, we've seen at least one valid file in the
|
||||
# current directory. For CVS, we need to make sure there are
|
||||
# directory parents to contain it, so we flush the stack.
|
||||
if cvs:
|
||||
for dir in stack:
|
||||
generate_tarball_header(out, dir, mtime=dir_mtime)
|
||||
del stack[:]
|
||||
|
||||
if cvs:
|
||||
info = os.stat(file.path)
|
||||
@@ -2878,7 +2891,8 @@ def generate_tarball(out, request, reldir, stack):
|
||||
else:
|
||||
mode = 0644
|
||||
|
||||
### read the whole file into memory? bad... better to do 2 passes
|
||||
### FIXME: Read the whole file into memory? Bad... better to do
|
||||
### 2 passes.
|
||||
fp = request.repos.openfile(rep_path + [file.name], request.pathrev)[0]
|
||||
contents = fp.read()
|
||||
fp.close()
|
||||
@@ -2888,21 +2902,22 @@ def generate_tarball(out, request, reldir, stack):
|
||||
out.write(contents)
|
||||
out.write('\0' * (511 - ((len(contents) + 511) % 512)))
|
||||
|
||||
# recurse into subdirectories
|
||||
# Recurse into subdirectories, skipping busted ones.
|
||||
for file in entries:
|
||||
if file.errors or file.kind != vclib.DIR:
|
||||
continue
|
||||
|
||||
# skip forbidden/hidden directories (top-level only)
|
||||
# Skip forbidden/hidden directories (top-level only).
|
||||
if not rep_path:
|
||||
if (request.cfg.is_forbidden(file.name)
|
||||
or (cvs and request.cfg.options.hide_cvsroot
|
||||
and file.name == 'CVSROOT')):
|
||||
continue
|
||||
|
||||
generate_tarball(out, request, reldir + [file.name], stack)
|
||||
mtime = request.roottype == 'svn' and file.date or None
|
||||
generate_tarball(out, request, reldir + [file.name], stack, mtime)
|
||||
|
||||
# pop directory (if it's being pruned. otherwise stack is already empty)
|
||||
# Pop the current directory from the stack.
|
||||
del stack[-1:]
|
||||
|
||||
def download_tarball(request):
|
||||
@@ -2916,6 +2931,8 @@ def download_tarball(request):
|
||||
sys.stdout.flush()
|
||||
fp = popen.pipe_cmds([('gzip', '-c', '-n')])
|
||||
|
||||
### FIXME: For Subversion repositories, we can get the real mtime of the
|
||||
### top-level directory here.
|
||||
generate_tarball(fp, request, [], [])
|
||||
|
||||
fp.write('\0' * 1024)
|
||||
@@ -3188,8 +3205,9 @@ def build_commit(request, files, limited_files, dir_strip):
|
||||
commit.rss_date = make_rss_time_string(files[0].GetTime(), request.cfg)
|
||||
if request.roottype == 'svn':
|
||||
commit.rev = files[0].GetRevision()
|
||||
commit.rss_url = 'http://%s%s' % \
|
||||
(request.server.getenv("HTTP_HOST"),
|
||||
commit.rss_url = '%s://%s%s' % \
|
||||
(request.server.getenv("HTTPS") == "on" and "https" or "http",
|
||||
request.server.getenv("HTTP_HOST"),
|
||||
request.get_url(view_func=view_revision,
|
||||
params={'revision': commit.rev},
|
||||
escape=1))
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td><address>[cfg.general.address]</address></td>
|
||||
<td style="text-align: right;"><strong><a href="[help_href]">ViewVC Help</strong></td>
|
||||
<td style="text-align: right;"><strong><a href="[help_href]">ViewVC Help</a></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Powered by <a href="http://viewvc.tigris.org/">ViewVC [vsn]</a></td>
|
||||
|
@@ -459,6 +459,10 @@ highlight_convert_tabs = 2
|
||||
use_php = 0
|
||||
|
||||
# path to php executable
|
||||
# (This should be set to the path of a PHP CLI executable, not the path
|
||||
# to a CGI executable. If you use a CGI executable, you may see "no input file
|
||||
# specified" or "force-cgi-redirect" errors instead of colorized source. The
|
||||
# output of "php -v" tells you whether an given executable is CLI or CGI.)
|
||||
php_exe_path = php
|
||||
# php_exe_path = /usr/local/bin/php
|
||||
# php_exe_path = C:\Program Files\php\cli\php.exe
|
||||
|
Reference in New Issue
Block a user