ViewCVS: Repository Browsing

On this page:


ViewCVS Users Group

Upgrading Basics

This document describes some of the things that you will need to consider, change, or handle when upgrading an existing ViewCVS installation to a newer version.

Upgrading from an ancient version of ViewCVS to the latest version isn't necessarily a multi step process. The instructions are only organized that way. You can certainly upgrade in a single step.

It is always recommended to install the new version in a fresh directory and to carefully compare the configuration files. A possible approach is to name the directories /usr/local/viewcvs-0.6, /usr/local/viewcvs-0.7 and so on and than create a symbolic link viewcvs pointing to the production version. This way you can easily test several versions and switch back, if your users start to complain.

Upgrading From 0.9

This section discusses how to upgrade ViewCVS 0.9 to version 1.0 or a later version of the software.

CGI Stubs

The CGI stub scripts haved been moved from <VIEWCVS_INSTALLATION_DIRECTORY>/cgi/ to <VIEWCVS_INSTALLATION_DIRECTORY>/www/cgi/, so you will need update any ScriptAlias directives pointing to them in your apache configuration. Also, the contents of these scripts have changed, so you may need to replace copies of the old scripts you put in other directories.

Checkin Database

ViewCVS 1.0 reads and writes commit times in the MySQL database in UTC time rather than local time. This can cause times displayed on the query page to be a few hours off if an old database is being used with a new version of ViewCVS. The best way to fix this is to rebuild the database with the new version of cvsdbadmin, but it it is also possible to enable a backwards compatibility mode by setting utc_time = 0 at the top of lib/dbi.py

Configuration Options

The following options have been added:

  • general/svn_roots
  • general/root_parents
  • general/use_rcsparse
  • general/cvsnt_exe_path
  • options/docroot
  • options/http_expiration_time
  • options/generate_etags
  • options/root_as_url_component
  • options/use_pagesize
  • options/use_localtime
  • options/cross_copies
  • options/use_php
  • options/php_path
  • templates/error
  • templates/query_form
  • templates/query_results

The following options have been removed:

  • general/main_title
  • options/diff_font_face
  • options/diff_font_size
  • templates/footer

Templates

The templates have changed drastically in this version of ViewCVS. If you are using customized templates from 0.9 or earlier, you will almost certainly find it easier to port your old customizations to the new templates than to port the old templates themselves. Either way, you might find it helpful to know what's different in the templates since 0.9, so we've listed the changes below.

Template Arrangement

The default templates have been rearranged a bit in ViewCVS 1.0. Specifically, "header.ezt" and "footer.ezt" have moved into the "templates/include/" subdirectory. Also, "directory.ezt" and "dir_alternate.ezt" now reference new template files "dir_header.ezt" and "dir_footer.ezt", also found in the "templates/include/" subdirectory.

Notably, the "markup.ezt" and "annotate.ezt" templates are now fully self-contained. That is, the markup and annotation data generated by ViewCVS is now accessible in those templates just like other template variables. As a result, ViewCVS now has no more internal need for the templates.footer configuration variable, so that variable has been removed from the default configuration file.

Removed Template Variables

directory.ezt and dir_alternate.ezt: params
Replaced with new search_tag_hidden_values variable.
directory.ezt and dir_alternate.ezt: rows.cvs
Replaced by rows.errors
directory.ezt and dir_alternate.ezt: no_match
Replaced by num_dead
directory.ezt and dir_alternate.ezt: have_logs and unreadable
Deemed unnecessary.
directory.ezt and dir_alternate.ezt: sortdir_up_href and sortdir_down_href
Removed because sortby_*_href variables now set sort directions
directory.ezt and dir_alternate.ezt: roots
Replaced by a different variable of the same name which is available to all templates (see new variables table below).
directory.ezt, dir_alternate.ezt, log.ezt, and log_table.ezt: current_root
Replaced by rootname, which is now available to all templates.
graph.ezt: request.url
Replaced with new imagesrc variable.
graph.ezt: request.where
Replaced with path variable.
header.ezt: qquery
Combined into file_url variable.
markup.ezt: utc_date, href, text_href, and nav_file
Replaced with new date_str, download_href, download_text_href, and nav_path variables.
log.ezt and log_table.ezt: href, query, qquery, head_href, head_abs_href, back_url, entries.href, and entries.text_href
Replaced with new diff_url, diff_params, diff_select_action, branch_select_action, logsort_action, view_href, download_href, download_text_href, up_href, entries.download_href, entries.download_text_href, and entries.annotate_href variables.
log.ezt and log_table.ezt: viewable and is_text
Deemed unnecessary.

New Template Variables

All files: roottype, rootname, and pathtype
Strings denoting the type ("cvs" or "svn") of the current repository, name of the current repository, and type ("dir" or "file") of the current path being viewed.
All files: nav_path
List representing the current path. Unlike the old nav_path variable which was just a block of html with links to parent directories, this is a list of objects, with parent directory names and links accessible as nav_path.name and nav_path.type inside a [for] loop.
All files: up_href
Link to parent directory.
All files: roots
List of roots. Unlike the old roots variable which is just a list of root names, this is a list of root objects with name and type information accessible via roots.name and roots.type.
All files: docroot
Web path to directory containing ViewCVS static files (files in <VIEWCVS_INSTALLATION_DIRECTORY>/templates/docroot)
All files: log_href and graph_href
Links to the log and graph pages of the current file, if there is one.
graph.ezt: imagesrc
String contain URL for graph image.
markup.ezt: annotate_href
Link to the annotation page for the current revision, if available.
markup.ezt: date_str
String representing checkin date
markup.ezt: markup
New placeholder for the marked-up file contents.
markup.ezt: download_href and download_text_href
New variables for links.
directory.ezt and dir_alternate.ezt: tree_rev, tree_rev_href, and jump_rev
New Subversion-only directory revision items.
directory.ezt and dir_alternate.ezt: rows.mime_type
New mime-type variable for file directory entries.
directory.ezt and dir_alternate.ezt: rows.size
New filesize variable for file directory entries.
directory.ezt and dir_alternate.ezt: rows.errors
List of error messages pertaining to an entry.
directory.ezt and dir_alternate.ezt: num_dead
Number of dead files.
diff.ezt: raw_diff
New variable for testing and presenting the raw (non-colored) diff contents.
annotate.ezt: lines, lines.line_number, lines.rev, lines.author, lines.prev_rev, lines.diff_url, and lines.text
New variables for annotations.
log.ezt and log_table.ezt: entries.filename, entries.size, entries.copy_path, entries.copy_rev, entries.copy_href, entries.prev_path, and entries.revision_href
New attributes for Subversion revisions.
log.ezt and log_table.ezt: view_href, download_href, download_text_href, entries.download_href, and entries.download_text_href
New variables for links.

New Template Form Variables

Each HTML form that appears in ViewCVS templates is now associated with 2 new variables which should be used to determine its ACTION value and its hidden field values. Forms using the new variables look like:

<form method=get action="[my_form_action]">
  [my_form_hidden_values]
   ... form widgets go here ...
</form>

Here is a list of the new variable names and the forms they are associated with:

VariablesForm
change_root_action
change_root_hidden_values
Root selector form in directory.ezt and dir_alternate.ezt.
jump_rev_action
jump_rev_hidden_values
Subversion directory revision selector form in directory.ezt and dir_alternate.ezt.
dir_paging_action
dir_paging_hidden_values
Directory paging form in directory.ezt and dir_alternate.ezt.
search_tag_action
search_tag_hidden_values
Tag choosing and regular expression searching form in directory.ezt and dir_alternate.ezt.
log_paging_action
log_paging_hidden_values
Log page paging form in include/paging.ezt.
diff_select_action
diff_select_hidden_values
Arbitrary diff form on log page in include/diff_form.ezt.
branch_select_action
branch_select_hidden_values
Branch select form on log page in include/branch_form.ezt.
logsort_action
logsort_hidden_values
Log sort form on log page in include/sort.ezt.
diff_format_action
diff_format_hidden_values
Diff format form in include/diff.ezt.

Other Template Changes

In directory.ezt and dir_alternate.ezt:

  • A new form for changing the current directory revision is displayed for subversion directories.
  • A new form that controls paging is displayed when cfg.options.use_pagesize is not 0
  • The sorting links and "hide attic" link are no longer prefixed with "./"
  • The revision number links no longer need "content-type=text/vnd.viewcvs-markup" suffixes.
  • The link to Attic/ is only displayed for CVS roots
  • Directory rows.name values no longer have trailing slashes

In log.ezt and log_table.ezt:

  • "Default branch" section moved into include/branch.ezt and is only displayed for CVS roots
  • "Current tag" section moved into include/view_tag.ezt and is only displayed for CVS roots
  • "Changes since" is only displayed for cvs roots
  • New paging form is included from include/paging.ezt
  • Arbitrary diff form moved into include/diff_form.ezt
  • Branch select form moved into include/branch_form.ezt
  • Log sort form moved into include/sort.ezt

Upgrading From 0.8

This section discusses how to upgrade ViewCVS 0.8 to version 0.9 or a later version of the software.

NOTE: these changes will bring you up to the requirements of version 0.9. You must also follow the directions for upgrading from 0.9.

Configuration Options

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.

Colors: diff_heading, diff_empty, diff_remove, diff_change, diff_add, and diff_dark_change
These options have been incorporated into the diff.ezt template.

markup_log
This option has been incorporated into the markup.ezt template.

Colors: nav_header and alt_background
These options have been incorporated into the header.ezt template.

Images: back_icon, dir_icon, and file_icon
These options have been incorporated into the directory.ezt, header.ezt, log.ezt, log_table.ezt, and query.ezt templates.

use_java_script and open_extern_window
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.

show_author
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.

hide_non_readable
This option was never used, so it has been removed.

flip_links_in_dirview
This option is no longer available. If you want the links in your directory view flipped, then you may use the dir_alternate.ezt template.

Template Variables

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.

directory.ezt: headers
The headers are now listed explicitly in the template, rather than made available through a list.

directory.ezt: rows.cols, and rows.span
These variables were used in conjunction with the headers variable to control the column displays. This is now controlled explicitly within the templates.

directory.ezt: rev_in_front
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 dir_alternate.ezt template, which has the revision in front.

directory.ezt: rows.attic and rows.hide_attic_href
These variable were used to manage the hide and showing of the contents of the Attic/ subdirectory. Several new variables were introduced which can be used to replace this functionality: show_attic_href, hide_attic_href, and rows.state.