Finish issue #305 by allowing "markup" to be the configured default
file view. This causes less-than-perfectly-compact URL generation in some cases, but frankly, we'd have fewer URL-compatibility issues if we hadn't been trying to discard information in the first place. * lib/viewvc.py (Request.run_viewvc, Request.get_link): Honor "markup" as a valid value for default_file_view. * viewvc.conf.dist (default_file_view): Note that "markup" is now a valid option here. * CHANGES Record this change. git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1775 8cb11bc2-c004-0410-86c3-e597b4017df7remotes/merged-file-views
parent
47ad6e149c
commit
cedb97c3d4
1
CHANGES
1
CHANGES
|
@ -23,6 +23,7 @@ Version 1.1.0 (released ??-???-????)
|
||||||
- Subversion authz files
|
- Subversion authz files
|
||||||
- regexp-based path hiding
|
- regexp-based path hiding
|
||||||
- file glob top-level directory hiding (for compat with 1.0.x)
|
- file glob top-level directory hiding (for compat with 1.0.x)
|
||||||
|
* allow default file view to be "markup" (issue #305)
|
||||||
|
|
||||||
Version 1.0.4 (released 10-Apr-2007)
|
Version 1.0.4 (released 10-Apr-2007)
|
||||||
|
|
||||||
|
|
|
@ -330,8 +330,9 @@ class Request:
|
||||||
self.view_func = view_cvsgraph_image
|
self.view_func = view_cvsgraph_image
|
||||||
elif self.query_dict.has_key('revision') \
|
elif self.query_dict.has_key('revision') \
|
||||||
or cfg.options.default_file_view != "log":
|
or cfg.options.default_file_view != "log":
|
||||||
if self.query_dict.get('content-type', None) in (viewcvs_mime_type,
|
if cfg.options.default_file_view == "markup" \
|
||||||
alt_mime_type):
|
or self.query_dict.get('content-type', None) \
|
||||||
|
in (viewcvs_mime_type, alt_mime_type):
|
||||||
self.view_func = view_markup
|
self.view_func = view_markup
|
||||||
else:
|
else:
|
||||||
self.view_func = view_checkout
|
self.view_func = view_checkout
|
||||||
|
@ -512,13 +513,19 @@ class Request:
|
||||||
view_func = None
|
view_func = None
|
||||||
|
|
||||||
# no need to explicitly specify checkout view when it's the default
|
# no need to explicitly specify checkout view when it's the default
|
||||||
# view, when checkout_magic is enabled, or when "revision" is present
|
# view or when checkout_magic is enabled
|
||||||
if view_func is view_checkout:
|
if view_func is view_checkout:
|
||||||
if ((cfg.options.default_file_view != "log" and pathtype == vclib.FILE)
|
if ((cfg.options.default_file_view == "co" and pathtype == vclib.FILE)
|
||||||
or cfg.options.checkout_magic
|
or cfg.options.checkout_magic):
|
||||||
or params.get('revision') is not None):
|
|
||||||
view_func = None
|
view_func = None
|
||||||
|
|
||||||
|
# no need to explicitly specify markup view when it's the default view
|
||||||
|
if view_func is view_markup:
|
||||||
|
if (cfg.options.default_file_view == "markup" \
|
||||||
|
and pathtype == vclib.FILE):
|
||||||
|
view_func = None
|
||||||
|
|
||||||
|
# set the view parameter
|
||||||
view_code = _view_codes.get(view_func)
|
view_code = _view_codes.get(view_func)
|
||||||
if view_code and not (params.has_key('view') and params['view'] is None):
|
if view_code and not (params.has_key('view') and params['view'] is None):
|
||||||
params['view'] = view_code
|
params['view'] = view_code
|
||||||
|
|
|
@ -330,16 +330,16 @@ authorizer = forbidden
|
||||||
# addresses that appear in version control metadata (e.g. log messages).
|
# addresses that appear in version control metadata (e.g. log messages).
|
||||||
mangle_email_addresses = 0
|
mangle_email_addresses = 0
|
||||||
|
|
||||||
# default_file_view: "log" or "co"
|
# default_file_view: "log", "co", or "markup"
|
||||||
# Controls whether the default view for file URLs is a checkout view or
|
# Controls whether the default view for file URLs is a checkout view or
|
||||||
# a log view. "log" is the default for backwards compatibility with old
|
# a log view. "log" is the default for backwards compatibility with old
|
||||||
# ViewCVS URLs, but "co" has the advantage that it allows ViewVC to serve
|
# ViewCVS URLs, but "co" has the advantage that it allows ViewVC to serve
|
||||||
# static HTML pages directly from a repository with working links
|
# static HTML pages directly from a repository with working links
|
||||||
# to other repository files
|
# to other repository files
|
||||||
# Note: Changing this option may cause old ViewCVS URLs that referred
|
# Note: Changing this option may break compatibility with existing
|
||||||
# to log pages to load checkout pages instead.
|
# bookmarked URLs.
|
||||||
# Also note: If you choose the "co" view, be sure to enable it (via
|
# Also note: If you choose one of the "co" or "markup" views, be sure
|
||||||
# the allowed_views option)
|
# to enable it (via the allowed_views option)
|
||||||
default_file_view = log
|
default_file_view = log
|
||||||
|
|
||||||
# http_expiration_time: Expiration time (in seconds) for cacheable
|
# http_expiration_time: Expiration time (in seconds) for cacheable
|
||||||
|
|
Loading…
Reference in New Issue