Any objections?

Wed Aug  6 19:13:35 BST 2008  Eric Kow <[EMAIL PROTECTED]>
  * Remove darcs.cgi.
  We cannot realistically support this.  Besides, darcsweb and trac+darcs seem 
to
  do the same thing just as well.

New patches:

[Remove darcs.cgi.
Eric Kow <[EMAIL PROTECTED]>**20080806181335
 We cannot realistically support this.  Besides, darcsweb and trac+darcs seem to
 do the same thing just as well.
] hunk ./tools/cgi/README.in 1
-darcs.cgi is the darcs repository viewer.  It provides a web interface
-for viewing darcs repositories, using XSLT to transform darcs' XML
-output into XHTML. It is written in perl and is more featureful than
-the older haskell cgi program darcs_cgi.lhs (seen in URLs as "darcs").
-
-dependencies
-
-  darcs.cgi requires with the following tools and has been tested with
-  the version mentioned:
-
-  darcs-1.0.1           http://www.darcs.net
-  libxslt-1.1.6         http://xmlsoft.org/XSLT/
-  perl-5.8.0            http://www.perl.com
-
-installation
-
-  1) copy darcs.cgi to your webserver's cgi directory, eg
-     /usr/lib/cgi-bin. A symlink probably won't do. Make
-     sure it's executable.
-  2) copy cgi.conf to @sysconfdir@/darcs/cgi.conf and edit appropriately.
-     You can overwrite the cgi.conf used by the old darcs cgi script.
-     You probably don't need to change anything here.
-  3) copy the xslt directory to @datadir@/darcs/xslt
-  4) copy xslt/styles.css to @sysconfdir@/darcs/styles.css
-
-  Test by browsing "http://<host>/cgi-bin/darcs.cgi/".
-
-troubleshooting
-
-  if the configuration is incorrect error messages will be printed to
-  the webserver's error log, for example "/var/log/apache/error.log".
-
-  you can also double check the configuration by running darcs.cgi
-  from the command line and supplying a --check argument:
-
-     $ ./darcs.cgi --check
-
-character encodings
-
-  if your repositories contain files with characters encoded in
-  something other than ASCII or UTF-8, change the 'xml_encoding'
-  setting in cgi.conf to the appropriate encoding.
rmfile ./tools/cgi/README.in
hunk ./tools/cgi/cgi.conf.in 1
-# This is an example for cgi.conf
-
-# reposdir is the directory containing the repositories
-
-reposdir = /var/www/repos
-
-# cachedir is a directory writable by www-data (or whatever user your cgi
-# scripts run as) which is used to cache the web pages.
-
-cachedir = /var/cache/darcs
-
-# The following are used by darcs.cgi (not darcs_cgi)
-PATH = /bin:/usr/bin:/usr/local/bin
-
-# paths to executables, or just the executables if they are in 'PATH'
-#darcs = darcs
-#xsltproc = xsltproc
-
-# Path to XSLT templates (default is /usr/local/share/darcs/xslt)
-xslt_dir = @datadir@/darcs/xslt
-
-# HTTP request path of the style sheet, the default will magically read 
-# @sysconfdir@/darcs/styles.css
-#stylesheet = /cgi-bin/darcs.cgi/styles.css
-
-css_styles  = @sysconfdir@/darcs/styles.css
-
-# encoding to include in XML declaration.  Set this to the encoding used
-# by the files in your repositories.
-
-xml_encoding = UTF-8
rmfile ./tools/cgi/cgi.conf.in
hunk ./tools/cgi/darcs.cgi.in 1
-#!/usr/bin/perl -T
-#
-# darcs.cgi - the darcs repository viewer
-#
-# Copyright (c) 2004 Will Glozer
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#
-# This program calls darcs (or its own subroutines) to generate XML
-# which is rendered into HTML by XSLT.  It is capable of displaying
-# the files in a repository, various patch histories, annotations, etc.
-#
-
-use strict;
-
-use CGI qw( :standard );
-use CGI::Util;
-use File::Basename;
-use File::stat;
-use IO::File;
-use POSIX;
-
-## the following variables can be customized to reflect your system
-## configuration by defining them appropriately in the file
-## "@sysconfdir@/darcs/cgi.conf".  The syntax accepts equals signs or simply
-## blanks separating values from assignments.
-
-$ENV{'PATH'} = read_conf('PATH', $ENV{'PATH'});
-
-# path to executables, or just the executable if they are in $ENV{'PATH'}
-my $darcs_program    = read_conf("darcs", "darcs");
-my $xslt_program     = read_conf("xsltproc", "xsltproc");
-
-# directory containing repositories
-my $repository_root  = read_conf("reposdir", "/var/www");
-
-# XSLT template locations
-my $template_root = read_conf("xslt_dir", '@datadir@/darcs/xslt');
-
-my $xslt_annotate = "$template_root/annotate.xslt";
-my $xslt_browse   = "$template_root/browse.xslt";
-my $xslt_patches  = "$template_root/patches.xslt";
-my $xslt_repos    = "$template_root/repos.xslt";
-my $xslt_rss      = "$template_root/rss.xslt";
-
-my $xslt_errors   = "$template_root/errors.xslt";
-
-# CSS stylesheet that XSLT templates refer to.  This is a HTTP request
-# path, not a local file system path. The default will cause darcs.cgi
-# to serve the stylesheet rather than the web server.
-my $stylesheet = read_conf("stylesheet", "/cgi-bin/darcs.cgi/styles.css");
-
-# location of the CSS stylesheet that darcs.cgi will serve if it
-# receives a request for '/styles.css'
-my $css_styles = read_conf("css_styles", '@sysconfdir@/darcs/styles.css');
-
-# location of the favicon that darcs.cgi will serve if it
-# receives a request for '/[\w\-]+/favicon.ico'
-my $favicon = read_conf("favicon", "/cgi-bin/favicon.ico");
-
-# XML source for the error pages
-my $xml_errors = "$template_root/errors.xml";
-
-# encoding to include in XML declaration
-my $xml_encoding = read_conf("xml_encoding", "UTF-8");
-
-## end customization
-
-# ----------------------------------------------------------------------
-
-# read a value from the cgi.conf file.
-{
-  my(%conf);
-
-  sub read_conf {
-    my ($flag, $val) = @_;
-    $val = "" if !defined($val);
-    
-    if (!%conf && open(CGI_CONF, '@sysconfdir@/darcs/cgi.conf')) {
-      while (<CGI_CONF>) {
-        chomp;
-	next if /^\s*(?:\#.*)?$/;   # Skip blank lines and comment lines
-        if (/^\s*(\S+)\s*(?:\=\s*)?(\S+)\s*$/) {
-           $conf{$1} = $2;
-	   # print "read_conf: $1 = $2\n";
-        } else {
-           warn "read_conf: $_\n";
-        }
-      }
-      close(CGI_CONF);
-    }
-
-    $val = $conf{$flag} if exists($conf{$flag});
-
-    return $val;
-  }
-}
-
-# open xsltproc to transform and output `xml' with stylesheet file `xslt'
-sub transform {
-    my ($xslt, $args, $content_type) = @_;
-
-    $| = 1;
-    printf "Content-type: %s\r\n\r\n", $content_type || "text/html";
-    my $pipe = new IO::File "| $xslt_program $args $xslt -";
-    $pipe->autoflush(0);
-    return $pipe;
-}
-
-sub pristine_dir {
-    my ($repo) = @_;
-    my $pristine = "current";
-    if (! -d "${repository_root}/${repo}/_darcs/$pristine") {
-        $pristine = "pristine";
-    }
-    return "${repository_root}/${repo}/_darcs/$pristine";
-}
-
-# begin an XML document with a root element and the repository path
-sub make_xml {
-    my ($fh, $repo, $dir, $file) = @_;
-    my ($full_path, $path) = '/';
-
-    printf $fh qq(<?xml version="1.0" encoding="$xml_encoding"?>\n);
-
-    printf $fh qq(<darcs repository="$repo" target="%s/%s%s">\n),
-        $repo, ($dir ? "$dir/" : ''), ($file ? "$file" : '');
-
-    print $fh qq(<path>\n);
-    foreach $path (split('/', "$repo/$dir")) {
-        $full_path .= "$path/";
-        print $fh qq(<directory full-path="$full_path">$path</directory>\n);
-    }
-    if ($file) {
-        print $fh qq(<file full-path="$full_path$file">$file</file>\n) if $file;
-    }
-    print $fh qq(</path>\n\n);
-}
-
-# finish XML output
-sub finish_xml {
-    my ($fh) = @_;
-    print $fh "\n</darcs>\n";
-    $fh->flush;
-}
-
-# run darcs and wrap the output in an XML document
-sub darcs_xml {
-    my ($fh, $repo, $cmd, $args, $dir, $file) = @_;
-
-    make_xml($fh, $repo, $dir, $file);
-
-    push(@$args, '--xml-output');
-    darcs($fh, $repo, $cmd, $args, $dir, $file);
-
-    finish_xml($fh);
-}
-
-# run darcs with output redirected to the specified file handle
-sub darcs {
-    my ($fh, $repo, $cmd, $args, $dir, $file) = @_;
-    my (@darcs_argv) = ($darcs_program, $cmd, @$args);
-
-    # push target only if there is one, otherwise darcs will get an empty param
-    if ($dir || $file) {
-        push(@darcs_argv, sprintf("%s%s%s", $dir, ($dir ? '/' : ''), $file));
-    }
-
-    my($pid) = fork;
-    if ($pid) {
-	# in the parent process
-	my($status) = waitpid($pid, 0);
-	die "$darcs_program exited with status $?\n" if $?;
-    } elsif(defined($pid)) {
-	# in the child process
-	open(STDIN, '/dev/null');
-	if (defined($fh)) {
-	    open(STDOUT, '>&', $fh)
-		|| die "can't dup to stdout: $!\n";
-	}
-	chdir "$repository_root/$repo"
-	    || die "chdir: $repository_root/$repo: $!\n";
-	exec @darcs_argv;
-	die "can't exec ".$darcs_argv[0].": $!\n";
-    } else {
-	# fork failed
-	die "can't fork: $!\n";
-    }
-}
-
-# get a directory listing as XML output
-sub dir_listing {
-    my ($fh, $repo, $dir) = @_;
-    make_xml($fh, $repo, $dir, '');
-
-    print $fh "<files>\n";
-    my $dir_ = pristine_dir ($repo) . "/$dir";
-    opendir(DH, $dir_);
-    while( defined (my $file_ = readdir(DH)) ) {
-        next if $file_ =~ /^\.\.?$/;
-        my $file = "$dir_/$file_";
-        my $secs  = stat($file)->mtime;
-        my $mtime = localtime($secs);
-        my $ts = POSIX::strftime("%Y%m%d%H%M%S", gmtime $secs);
-
-        my ($name, $type);
-
-         if (-d $file) {
-             ($name, $type) = (basename($file) . '/', 'directory');
-         } else {
-             ($name, $type) = (basename($file), 'file');
-         }
-         printf $fh qq(  <$type name="$name" modified="$mtime" ts="$ts" />\n);
-    }
-    closedir(DH);
-    print $fh "</files>\n";
-
-    finish_xml($fh);
-}
-
-# get a repository listing as XML output
-sub repo_listing {
-    my($fh) = @_;
-
-    make_xml($fh, "", "", "");
-
-    print $fh "<repositories>\n";
-    opendir(DH, $repository_root);
-    while( defined (my $name = readdir(DH)) ) {
-        next if $name =~ /^\.\.?$/;
-        if (-d "$repository_root/$name/_darcs") {
-            printf $fh qq(  <repository name="$name" />\n);
-        }
-    }
-    closedir(DH);
-    print $fh "</repositories>\n";
-
-    finish_xml($fh);
-    return $fh;
-}
-
-# show an error page
-sub show_error {
-    my ($type, $code, $message) = @_;
-    my $xml;
-
-    # set the xslt processing arguments
-    my $xslt_args = qq {
-        --stringparam error-type '$type'
-        --stringparam stylesheet '$stylesheet'
-    };
-    $xslt_args =~ s/\s+/ /gm;
-
-    print "Status: $code $message\r\n\r\n";
-    system("$xslt_program $xslt_args $xslt_errors $xml_errors");
-}
-
-# check if the requested resource has been modified since the client last
-# saw it. If not send HTTP status code 304, otherwise set the Last-modified
-# and Cache-control headers.
-sub is_cached {
-    my ($path) = @_;
-    my ($stat) = stat($path);
-
-    # stat may fail because the path was renamed or deleted but still referred
-    # to by older darcs patches
-    if ($stat) {
-        my $last_modified = CGI::expires($stat->mtime);
-
-        if (http('If-Modified-Since') eq $last_modified) {
-            print("Status: 304 Not Modified\r\n\r\n");
-            return 1;
-        }
-
-        print("Cache-control: max-age=0, must-revalidate\r\n");
-        print("Last-modified: $last_modified\r\n");
-    }
-    return 0;
-}
-
-# safely extract a parameter from the http request.  This applies a regexp
-# to the parameter which should group only the appropriate parameter value
-sub safe_param {
-    my ($param, $regex, $default) = @_;
-    my $value = CGI::Util::unescape(param($param));
-    return ($value =~ $regex) ? $1 : $default;
-}
-
-# common regular expressions for validating passed parameters
-my $hash_regex = qr/^([\w\-.]+)$/;
-my $path_regex = [EMAIL PROTECTED]([^\\!\$\^&*()\[\]{}<>`|';"?\r\n]+)$@;
-
-# respond to a CGI request
-sub respond {
-    # untaint the full URL to this CGI
-    my $cgi_url = CGI::Util::unescape(url());
-    $cgi_url =~ $path_regex or die qq(bad url "$cgi_url");
-    $cgi_url = $1;
-
-    # untaint script_name, reasonable to expect only \w, -, /, and . in the name
-    my $script_name = CGI::Util::unescape(script_name());
-    $script_name =~ qr~^([\w/.\-\~]+)$~ or die qq(bad script_name "$script_name");
-    $script_name = $1;
-
-    # untaint simple parameters, which can only have chars matching \w+
-    my $cmd  = safe_param('c', '^(\w+)$', 'browse');
-    my $sort = safe_param('s', '^(\w+)$', '');
-
-    # set the xslt processing arguments
-    my $xslt_args = qq {
-        --stringparam cgi-program '$script_name'
-        --stringparam cgi-url '$cgi_url'
-        --stringparam sort-by '$sort'
-        --stringparam stylesheet '$stylesheet'
-    };
-    $xslt_args =~ s/\s+/ /gm;
-
-    my ($path) = CGI::Util::unescape(path_info());
-    # don't allow ./ or ../ in paths
-    $path =~ s|[.]+/||g;
-
-    # check whether we're asking for styles.css
-    if ($path eq '/styles.css') {
-        return if is_cached($css_styles);
-
-        open (STYLES_CSS, $css_styles) or die qq(couldn't open "${css_styles}");
-        my $size = stat($css_styles)->size;
-
-        print "Content-length: $size\r\n";
-        print "Content-type: text/css\r\n\r\n";
-
-        while (<STYLES_CSS>) {
-          print $_;
-        }
-        close (STYLES_CSS);
-        return;
-    }
-
-    # check whether we're asking for favicon.ico
-    if ($path =~ '/[\w\-]+/favicon.ico') {
-        return if is_cached($favicon);
-
-        open (FAVICON, $favicon) or die qq(couldn't open "${favicon}");
-        my $size = stat($favicon)->size;
-
-        print "Content-length: $size\r\n";
-        print "Content-type: image/x-icon\r\n\r\n";
-
-        while (<FAVICON>) {
-          print $_;
-        }
-        close (FAVICON);
-        return;
-    }
-
-    # when no repository is requested display available repositories
-    if (length($path) < 2) {
-        my $fh = transform($xslt_repos, $xslt_args);
-        repo_listing($fh);
-        return;
-    }
-
-    # don't allow any shell meta characters in paths
-    $path =~ $path_regex or die qq(bad path_info "$path");
-    my @path = split('/', substr($1, 1));
-
-    # split the path into a repository, directory, and file
-    my ($repo, $dir, $file, @bits) = ('', '', '');
-    while (@path > 0) {
-        $repo = join('/', @path);
-        # check if remaining path elements refer to a repo
-        if (-d "${repository_root}/${repo}/_darcs") {
-            if (@bits > 1) {
-                $dir  = join('/', @bits[0..$#bits - 1]);
-            }
-            $file = $bits[$#bits];
-            # check if last element of path, stored in $file, is really a dir
-            if (-d (pristine_dir ($repo) . "/${dir}/${file}")) {
-                $dir = ($dir ? "$dir/$file" : $file);
-                $file = '';
-            }
-            last;
-        } else {
-            $repo = '';
-            unshift(@bits, pop @path);
-        }
-    }
-
-    # make sure the repository exists
-    unless ($repo) {
-        show_error('invalid-repository', '404', 'Invalid repository');
-        return;
-    }
-
-    # don't generate output unless the requested path has been
-    # modified since the client last saw it.
-    return if is_cached(pristine_dir ($repo) . "/$dir/$file");
-
-    # untaint patches and tags. Tags can have arbitrary values, so
-    # never pass these unquoted, on pain of pain!
-    my $patch = safe_param('p', $hash_regex);
-    my $tag   = safe_param('t', '^(.+)$');
-
-    my @darcs_args;
-    push(@darcs_args, '--match', "hash $patch") if $patch;
-    push(@darcs_args, '-t', $tag) if $tag;
-
-    # process the requested command
-    if ($cmd eq 'browse') {
-        my $fh = transform($xslt_browse, $xslt_args);
-        dir_listing($fh, $repo, $dir);
-    } elsif ($cmd eq 'patches') {
-        # patches as an option is used to support "--patches"
-        if (my $patches = safe_param('patches','^(.+)$')) {
-            push @darcs_args, '--patches', $patches;
-        }
-
-        my $fh = transform($xslt_patches, $xslt_args);
-        darcs_xml($fh, $repo, "changes", [EMAIL PROTECTED], $dir, $file);
-    } elsif ($cmd eq 'annotate') {
-        push(@darcs_args, '--summary');
-
-        my $creator_hash  = safe_param('ch', $hash_regex);
-        my $original_path = safe_param('o', $path_regex);
-        my $fh = transform($xslt_annotate, $xslt_args);
-
-        # use the creator hash and original file name when available so
-        # annotations can span renames
-        if ($creator_hash ne '' && $original_path ne '') {
-            push(@darcs_args, '--creator-hash', $creator_hash);
-            darcs_xml($fh, $repo, "annotate", [EMAIL PROTECTED], '', $original_path);
-        } else {
-            darcs_xml($fh, $repo, "annotate", [EMAIL PROTECTED], $dir, $file);
-        }
-    } elsif ($cmd eq 'diff') {
-        push(@darcs_args, '-u');
-        print "Content-type: text/plain\r\n\r\n";
-        darcs(undef, $repo, "diff", [EMAIL PROTECTED], $dir, $file);
-    } elsif ($cmd eq 'rss') {
-        push(@darcs_args, '--last', '25');
-
-        my $fh = transform($xslt_rss, $xslt_args, "application/rss+xml");
-        darcs_xml($fh, $repo, "changes", [EMAIL PROTECTED], $dir, $file);
-    } else {
-        show_error('invalid-command', '400', 'Invalid command');
-    }
-}
-
-# run a self-test when the --check argument is supplied
-if ($ARGV[0] eq '--check') {
-    (read_conf("css_styles", "abc") ne "abc") ||
-        die "cannot read config file: $!\n";
-
-    (`$darcs_program`) ||
-        die "cannot execute darcs as '$darcs_program': $!\n";
-    (`$xslt_program`) ||
-        die "cannot execute xstlproc as '$xslt_program': $!\n";
-
-    (-d $repository_root && -r $repository_root) ||
-        die "cannot read repository root directory '$repository_root': $!\n";
-    (-d $template_root && -r $template_root) ||
-        die "cannot read template root directory '$template_root': $!\n";
-    (-f $css_styles) ||
-        die "cannot read css stylesheet '$css_styles': $!\n";
-    (-f $xml_errors) ||
-        die "cannot read error messages '$xml_errors': $!\n";
-
-    exit 0;
-}
-
-# handle the CGI request
-respond();
-
rmfile ./tools/cgi/darcs.cgi.in
hunk ./tools/cgi/xslt/annotate.xslt 1
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- template for converting darcs' `annotate` output from XML to XHTML.  This
- template expects the following external variables:
-
-   cgi-program    - path to the CGI executable, to place in links
-   sort-by        - field to sort by
-   stylesheet     - path to the CSS stylesheet
-
--->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
-  <xsl:strip-space elements="*"/>
-
-  <xsl:include href="common.xslt"/>
-
-  <xsl:template match="path">
-    <h1 class="target">
-        annotations for <span class="path"><a href="{$cgi-program}">projects</a></span> / <span class="path"><xsl:apply-templates/></span>
-    </h1>
-  </xsl:template>
-
-  <!-- patch annotate tags -->
-  <xsl:template match="/darcs/patch">
-    <xsl:call-template name="show-patch-info">
-      <xsl:with-param name="patch" select="."/>
-      <xsl:with-param name="show-comment" select="true()"/>
-      <xsl:with-param name="show-author" select="true()"/>
-      <xsl:with-param name="show-date" select="true()"/>
-    </xsl:call-template>
-  </xsl:template>
-  
-  <xsl:template match="summary">
-    <xsl:variable name="hash" select="../patch/@hash"/>
-      
-    <table>
-      <tr class="annotate">
-        <th>file</th>
-        <th>change</th>
-        <th></th>
-        <th></th>
-      </tr>
-
-      <xsl:apply-templates/>
-    </table>
-
-    <form action="{$command}" method="get">
-      <p>
-        <input type="submit" name="c" value="diff"/>
-        <input type="hidden" name="p" value="{$hash}"/>
-      </p>
-    </form>
-  </xsl:template>
-  
-  <xsl:template match="modify_file">
-    <xsl:variable name="file" select="text()"/>
-    <xsl:variable name="hash" select="/darcs/patch/@hash" />
-      
-    <tr class="modified-file">
-      <td><xsl:value-of select="$file"/></td>
-
-      <td class="line-count">
-        <xsl:for-each select="added_lines">
-          +<xsl:value-of select="@num"/>/
-        </xsl:for-each>
-        <xsl:for-each select="removed_lines">-<xsl:value-of select="@num"/>
-        </xsl:for-each>
-        lines
-      </td>
-
-      <td><a href="{$command}{$file}?c=annotate&amp;p={$hash}">annotate</a></td>
-      <td><a href="{$command}{$file}?c=patches">patches</a></td>
-    </tr>
-  </xsl:template>
-
-  <xsl:template match="add_file">
-    <xsl:variable name="file" select="text()"/>
-    <xsl:variable name="hash" select="/darcs/patch/@hash" />
-    
-    <tr class="add-remove-file">
-      <td><xsl:value-of select="$file"/></td>
-      <td>added file</td>
-      <td><a href="{$command}{$file}?c=annotate&amp;p={$hash}">annotate</a></td>
-      <td><a href="{$command}{$file}?c=patches">patches</a></td>
-    </tr>
-  </xsl:template>
-
-  <xsl:template match="move">
-    <xsl:variable name="file" select="@to"/>
-    <xsl:variable name="old-file" select="@from"/>    
-    <xsl:variable name="hash" select="/darcs/patch/@hash" />
-    
-    <tr class="add-remove-file">
-      <td><xsl:value-of select="$file"/></td>
-      <td>moved from <xsl:value-of select="$old-file"/></td>
-      <td><a href="{$command}{$file}?c=annotate&amp;p={$hash}">annotate</a></td>
-      <td><a href="{$command}{$file}?c=patches">patches</a></td>
-    </tr>
-  </xsl:template>
-
-  <xsl:template match="remove_file">
-    <xsl:variable name="file" select="text()"/>
-    <xsl:variable name="hash" select="/darcs/patch/@hash" />
-    
-    <tr class="add-remove-file">
-      <td><xsl:value-of select="$file"/></td>
-      <td>removed file</td>
-      <td><a href="{$command}{$file}?c=annotate&amp;p={$hash}">annotate</a></td>
-      <td><a href="{$command}{$file}?c=patches">patches</a></td>
-    </tr>
-  </xsl:template>
-
-  <xsl:template match="add_directory">
-    <xsl:variable name="dir" select="text()"/>
-    <xsl:variable name="hash" select="/darcs/patch/@hash" />
-    
-    <tr class="add-remove-file">
-      <td><xsl:value-of select="$dir"/></td>
-      <td>added directory</td>
-      <td><a href="{$command}{$dir}/?c=annotate&amp;p={$hash}">annotate</a></td>
-      <td><a href="{$command}{$dir}/?c=patches">patches</a></td>
-    </tr>
-  </xsl:template>
-
-  <xsl:template match="remove_directory">
-    <xsl:variable name="dir" select="text()"/>
-    <xsl:variable name="hash" select="/darcs/patch/@hash" />
-    
-    <tr class="add-remove-file">
-      <td><xsl:value-of select="$dir"/></td>
-      <td>removed directory</td>
-      <td><a href="{$command}{$dir}/?c=annotate&amp;p={$hash}">annotate</a></td>
-      <td><a href="{$command}{$dir}/?c=patches">patches</a></td>
-    </tr>
-  </xsl:template>
-  
-  <!-- directory annotate templates -->
-  <xsl:template match="/darcs/directory">
-    <xsl:call-template name="show-patch-info">
-      <xsl:with-param name="patch" select="modified/patch"/>
-    </xsl:call-template>
-
-    <table>
-      <tr class="annotate">
-        <th>file</th>
-        <th>change</th>
-        <th></th>
-        <th></th>
-      </tr>
-
-      <xsl:apply-templates/>
-    </table>
-  </xsl:template>
-  
-  <xsl:template match="directory/modified/modified_how">
-    <xsl:variable name="hash" select="../patch/@hash" />
-    <xsl:variable name="how" select="substring(text(), 0, 10)"/>
-    <xsl:variable name="target" select="/darcs/@target"/>
-
-    <!--
-      annotating a directory outputs the directory itself as well as
-      any contents.  this ugly code checks if the matching element is
-      the original directory so that the 'annotate' and 'patch' links
-      don't append the directory twice.
-    -->
-    <xsl:variable name="last" select="//darcs/path/directory[last()]"/>
-    <xsl:variable name="name" select="../../@name"/>
-    <xsl:variable name="dir">
-      <xsl:choose>
-        <xsl:when test="$last = $name"></xsl:when>
-        <xsl:otherwise><xsl:value-of select="$name"/>/</xsl:otherwise>
-      </xsl:choose>
-    </xsl:variable>
-
-    <tr class="add-remove-file">
-      <td><xsl:value-of select="$name"/></td>
-      <td>
-        <xsl:choose>
-          <xsl:when test="$how = 'Dir added'">added directory</xsl:when>
-          <xsl:when test="$how = 'Dir moved'">moved directory</xsl:when>
-          <xsl:when test="$how = 'Dir remov'">removed directory</xsl:when>
-        </xsl:choose>
-      </td>
-      <td>
-        <a href="{$command}{$dir}?c=annotate&amp;p={$hash}">annotate</a>
-      </td>
-      <td><a href="{$command}{$dir}?c=patches">patches</a></td>
-    </tr>
-  </xsl:template>
-
-  <xsl:template match="directory/file/modified/modified_how">
-    <xsl:variable name="file" select="../../@name"/>
-    <xsl:variable name="hash" select="../patch/@hash" />
-    <xsl:variable name="how" select="substring(text(), 0, 11)"/>
-    
-    <tr class="add-remove-file">
-      <td><xsl:value-of select="$file"/></td>
-      <td>
-        <xsl:choose>
-          <xsl:when test="$how = 'File added'">added file</xsl:when>
-          <xsl:when test="$how = 'File moved'">moved file</xsl:when>
-          <xsl:when test="$how = 'File remov'">removed file</xsl:when>
-        </xsl:choose>
-      </td>
-      <td><a href="{$command}{$file}?c=annotate&amp;p={$hash}">annotate</a></td>
-      <td><a href="{$command}{$file}?c=patches">patches</a></td>
-    </tr>
-  </xsl:template>
-   
-  <!-- file annotate templates -->
-  <xsl:template match="/darcs/file">
-    <xsl:variable name="modified_how" select="modified/modified_how/text()"/>
-    
-    <xsl:call-template name="show-patch-info">
-      <xsl:with-param name="patch" select="modified/patch"/>
-    </xsl:call-template>
-
-    <!-- don't display table of changes when file's contents are modified -->
-    <xsl:if test="$modified_how != 'File modified'">
-      <xsl:variable name="file" select="@name"/>
-      <xsl:variable name="how" select="substring($modified_how, 0, 11)"/>
-
-      <xsl:variable name="annotate-href">
-        <xsl:call-template name="make-annotate-href">
-          <xsl:with-param name="hash" select="modified/patch/@hash"/>
-        </xsl:call-template>
-      </xsl:variable>
-      
-      <table>
-        <tr class="annotate">
-          <th>file</th>
-          <th>change</th>
-          <th></th>
-          <th></th>
-        </tr>
-
-        <tr class="add-remove-file">
-          <td><xsl:value-of select="$file"/></td>
-          <td>
-            <xsl:choose>
-              <xsl:when test="$how = 'File added'">added file</xsl:when>
-              <xsl:when test="$how = 'File moved'">moved file</xsl:when>
-              <xsl:when test="$how = 'File remov'">removed file</xsl:when>
-            </xsl:choose>
-          </td>
-          <td><a href="{$annotate-href}">annotate</a></td>
-          <td><a href="{$command}?c=patches">patches</a></td>
-        </tr>
-      </table>
-    </xsl:if>
-
-    <!-- the empty <p/> element is a Konqueror bug workaround -->
-    <pre xml:space="preserve"><p/>
-      <xsl:apply-templates/>
-    </pre>
-  </xsl:template>
-  
-  <xsl:template match="added_line">
-    <xsl:variable name="annotate-href">
-      <xsl:call-template name="make-annotate-href">
-        <xsl:with-param name="hash" select="preceding::modified/patch/@hash"/>
-      </xsl:call-template>
-    </xsl:variable>
-
-    <xsl:variable name="annotate-name" select="preceding::modified/patch/name"/>
-    <xsl:variable name="author" select="preceding::modified/patch/@author"/>
-    
-    <a class="added-line" href="{$annotate-href}" title="added with '{$annotate-name}' by '{$author}'">
-      <pre><xsl:value-of select="text()"/></pre>
-    </a>
-    <xsl:call-template name="check-removed-by"/>
-  </xsl:template>
-
-  <xsl:template match="normal_line">
-    <xsl:variable name="annotate-href">
-      <xsl:call-template name="make-annotate-href">
-        <xsl:with-param name="hash" select="*/patch/@hash"/>
-      </xsl:call-template>
-    </xsl:variable>
-
-    <xsl:variable name="annotate-name" select="*/patch/name"/>
-    <xsl:variable name="author" select="*/patch/@author"/>
-
-    <a class="normal-line" href="{$annotate-href}" title="last changed with '{$annotate-name}' by '{$author}'">
-      <pre><xsl:value-of select="text()"/></pre>
-    </a>
-    <xsl:call-template name="check-removed-by"/>
-  </xsl:template>
-
-  <xsl:template match="removed_line">
-    <xsl:variable name="annotate-href">
-      <xsl:call-template name="make-annotate-href">
-        <xsl:with-param name="hash" select="*/patch/@hash"/>
-      </xsl:call-template>
-    </xsl:variable>
-
-    <xsl:variable name="annotate-name" select="*/patch/name"/>
-    <xsl:variable name="author" select="*/patch/@author"/>
-    
-    <!-- don't display removed lines when a file is removed -->
-    <xsl:if test="../modified/modified_how/text() != 'File removed'">
-      
-        <a class="removed-line" href="{$annotate-href}" title="removed with '{$annotate-name}' by '{$author}'">
-        <pre><xsl:value-of select="text()"/></pre>
-      </a>
-      <xsl:call-template name="check-removed-by"/>
-    </xsl:if>
-  </xsl:template>
-
-  <xsl:template name="check-removed-by">
-    <xsl:variable name="hash" select="removed_by/patch/@hash"/>
-    
-    <xsl:variable name="annotate-href">
-      <xsl:call-template name="make-annotate-href">
-        <xsl:with-param name="hash" select="$hash"/>
-      </xsl:call-template>
-    </xsl:variable>
-    
-    <xsl:choose>
-      <xsl:when test="$hash != ''">
-        <a class="removed-by" href="{$annotate-href}">-</a>
-      </xsl:when>
-    </xsl:choose>
-
-    <!-- put a newline after the hyperlink -->      
-    <xsl:text xml:space="preserve">
-    </xsl:text>
-  </xsl:template>
-
-  <xsl:template name="show-patch-info">
-    <xsl:param name="patch"/>
-    <xsl:param name="show-comment"/>
-    <xsl:param name="show-author"/>
-    <xsl:param name="show-date"/>
-    
-    <xsl:variable name="hash" select="$patch/@hash"/>
-    <xsl:variable name="name" select="$patch/name"/>
-    <xsl:variable name="author" select="$patch/@author"/>
-    <xsl:variable name="local_date" select="$patch/@local_date"/>
-    
-    <h2 class="patch">
-      patch "<span class="path">
-      <a href="{$cgi-program}/{$repo}/?c=annotate&amp;p={$hash}">
-        <xsl:value-of select="$name"/>
-      </a>
-      </span>"
-    </h2>
-
-    <xsl:if test="$show-comment">
-        <xsl:if test="$patch/comment">
-          <h2 class="patch">
-            comment "<span class="comment">
-            <xsl:value-of select="$patch/comment"/>
-            </span>"
-            </h2>
-        </xsl:if>
-        </xsl:if>
-
-      <xsl:if test="$show-author"> 
-          <h2 class="author">
-        by <span class="author">
-        <xsl:value-of select="$patch/@author"/>
-        </span>
-
-      <xsl:if test="$show-date"> 
-        on <span class="local_date">
-        <xsl:value-of select="$patch/@local_date"/>
-        </span>
-    </xsl:if>
-    </h2>
-    </xsl:if>
-
-  </xsl:template>
-
-  <xsl:template name="make-annotate-href" xml:space="default">
-    <xsl:param name="hash"/>
-
-    <xsl:variable name="created-as" select="/darcs/*/created_as"/>
-    <xsl:variable name="creator-hash" select="$created-as/patch/@hash"/>
-    <xsl:variable name="original-name" select="$created-as/@original_name"/>
-    
-    <xsl:value-of select="$command"/>?c=annotate&amp;p=<xsl:value-of select="$hash"/>&amp;ch=<xsl:value-of select="$creator-hash"/>&amp;o=<xsl:value-of select="$original-name"/>
-  </xsl:template>
-
-  <!-- ignore <name>, <comment> and <modified_how> children -->
-  <xsl:template match="name"/>
-  <xsl:template match="comment"/>
-  <xsl:template match="author"/>
-  <xsl:template match="modified_how"/>
-</xsl:stylesheet>
rmfile ./tools/cgi/xslt/annotate.xslt
hunk ./tools/cgi/xslt/browse.xslt 1
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- template for converting a darcs current/ directory listing from XML to
- XHTML.  This template expects the following external variables:
-
-   cgi-program    - path to the CGI executable, to place in links
-   sort-by        - field to sort by
-   stylesheet     - path to the CSS stylesheet
-
- the input XML must have the following structure, aside from what common.xslt
- expects:
-
- <files>
-   <directory name="" modified=""/>
-   <file name="" modified=""/>
- </files>
--->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
-  <xsl:include href="common.xslt"/>
-
-  <xsl:template match="path">
-    <h1 class="target">
-      files in <span class="path"><a href="{$cgi-program}">projects</a></span> / <span class="path"><xsl:apply-templates/></span>
-    </h1>
-  </xsl:template>
-  
-  <xsl:template match="files">
-    <table>
-      <tr class="browse">
-        <th>
-          <a class="sort" href="{$command}?c=browse&amp;s=name">name</a>
-          <a class="revsort" href="{$command}?c=browse&amp;s=revname"> (rev)</a>
-        </th>
-        <th>
-          <a class="sort" href="{$command}?c=browse&amp;s=ts">modified</a>
-          <a class="revsort" href="{$command}?c=browse&amp;s=revts"> (rev)</a>
-        </th>
-        <th></th>
-        <th></th>
-      </tr>
-      
-      <xsl:choose>
-        <xsl:when test="$sort-by = 'ts'">
-          <xsl:apply-templates>
-            <xsl:sort select="name(self::node())"/>
-            <xsl:sort select="@ts"/>
-          </xsl:apply-templates>
-        </xsl:when>
-        <xsl:when test="$sort-by = 'revts'">
-          <xsl:apply-templates>
-            <xsl:sort select="name(self::node())"/>
-            <xsl:sort select="@ts" order="descending"/>
-          </xsl:apply-templates>
-        </xsl:when>
-        <xsl:when test="$sort-by = 'name'">
-          <xsl:apply-templates>
-            <xsl:sort select="name(self::node())"/>
-            <xsl:sort select="@name"/>
-          </xsl:apply-templates>
-        </xsl:when>
-        <xsl:when test="$sort-by = 'revname'">
-          <xsl:apply-templates>
-            <xsl:sort select="name(self::node())"/>
-            <xsl:sort select="@name" order="descending"/>
-          </xsl:apply-templates>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates>
-            <xsl:sort select="name(self::node())"/>
-            <xsl:sort select="@name"/>
-          </xsl:apply-templates>
-        </xsl:otherwise>
-      </xsl:choose>
-    </table>
-  </xsl:template>
-  
-  <xsl:template match="directory">
-    <xsl:variable name="name" select="@name"/>
-    <xsl:variable name="type" select="@type"/>
-    
-    <tr class="directory">
-      <td>
-        <a href="{$command}{$name}?c=browse"><xsl:value-of select="@name"/></a>
-      </td>
-      <td><xsl:value-of select="@modified"/></td>
-      <td>
-        <a href="{$command}{$name}?c=annotate">annotate</a>
-      </td>
-      <td>
-        <a href="{$command}{$name}?c=patches">patches</a>
-      </td>
-    </tr>
-
-    <xsl:apply-templates/>
-  </xsl:template>
-
-  <xsl:template match="file">
-    <xsl:variable name="name" select="@name"/>
-    
-    <tr class="file">
-      <td><xsl:value-of select="@name"/></td>
-      <td><xsl:value-of select="@modified"/></td>
-      <td><a href="{$command}{$name}?c=annotate">annotate</a></td>
-      <td><a href="{$command}{$name}?c=patches">patches</a></td>
-    </tr>
-
-    <xsl:apply-templates/>
-  </xsl:template>
-</xsl:stylesheet>
rmfile ./tools/cgi/xslt/browse.xslt
hunk ./tools/cgi/xslt/common.xslt 1
-<!--
- templates fragments shared by all templates.  This template expects
- the following external variables:
-
-   cgi-program    - path to the CGI executable, to place in links
-   stylesheet     - path to the CSS stylesheet
-
- the input XML must have the following structure, plus any elements
- that are not common to all templates:
-
- <darcs repository="">
-   <path>
-     <element full-path=""></element>
-   </path>
-
-   ...
- 
- </darcs>
--->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
-  <xsl:variable name="command">
-    <xsl:value-of select="$cgi-program"/>/<xsl:value-of select="/darcs/@target"/>
-  </xsl:variable>
-
-  <xsl:variable name="repo" select="/darcs/@repository"/>
-  
-  <xsl:template match="/darcs">
-    <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en">
-      <head>
-        <title>darcs repository</title>
-        <link rel="stylesheet" href="{$stylesheet}"/>
-        <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="{$command}?c=rss" />
-      </head>
-
-      <body>
-        <xsl:apply-templates/>
-
-        <form action="{$command}" method="get">
-          <p>
-            <input class="patches" type="submit" name="c" value="patches"/>
-            
-            <a href="{$command}?c=rss">rss</a>
-            
-            <span class="version">
-              <a class="home" href="http://darcs.net/";>darcs.cgi</a>
-              v1.0
-            </span>
-          </p>
-        </form>
-      </body>
-    </html>
-  </xsl:template>
-
-  <xsl:template match="path/directory">
-    <xsl:variable name="full-path"  select="@full-path"/>
-    
-    <a href="{$cgi-program}{$full-path}?c=browse">
-      <xsl:apply-templates/>
-    </a> /
-  </xsl:template>
-
-  <xsl:template match="path/file">
-    <xsl:apply-templates/>
-  </xsl:template>
-  
-</xsl:stylesheet>
rmfile ./tools/cgi/xslt/common.xslt
hunk ./tools/cgi/xslt/errors.xml 1
-<!--
-  HTML templates for all potential error pages.  Each <error> element
-  should contain all of the HTML <body> content to be output if that
-  error occurs
--->
-<errors>
-  <error type="invalid-command" title="Invalid command">
-    <h1>Invalid command</h1>
-
-    <p>
-      The requested command is invalid.
-    </p>
-  </error>
-
-  <error type="invalid-repository" title="Invalid repository">
-    <h1>Invalid repository</h1>
-
-    <p>
-      The requested repository does not exist on this server.
-    </p>
-  </error>
-</errors>
rmfile ./tools/cgi/xslt/errors.xml
hunk ./tools/cgi/xslt/errors.xslt 1
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- template for converting selected content of errors.xml XML to XHTML. This
- template expects the following external variables:
-
-   error-type     - the type of error
-   stylesheet     - path to the CSS stylesheet
-
- the input XML must have the following structure
-
- <errors>
-   <error type="" title="">
-     ...
-   </error>
- </errors>
--->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
-  <xsl:template match="[EMAIL PROTECTED] = $error-type]">
-    <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en">
-      <head>
-        <title>
-          <xsl:value-of select="@title"/>
-        </title>
-        <link rel="stylesheet" href="{$stylesheet}"/>
-      </head>
-
-      <body>
-        <xsl:copy-of select="*"/>
-      </body>
-    </html>
-  </xsl:template>
-
-  <!-- ignore errors that don't match -->
-  <xsl:template match="error"/>
-</xsl:stylesheet>
rmfile ./tools/cgi/xslt/errors.xslt
hunk ./tools/cgi/xslt/patches.xslt 1
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- template for converting darcs' `changes` output from XML to XHTML.  This
- template expects the following external variables:
-
-   cgi-program    - path to the CGI executable, to place in links
-   sort-by        - field to sort by
-   stylesheet     - path to the CSS stylesheet
-
- the input XML must have the following structure, aside from what common.xslt
- expects:
-
- <changelog>
-   <patch author="" date="" localdate="" inverted="" hash="">
-     <name></name>
-   </patch>
- </changelog>
--->
-<xsl:stylesheet version="1.0"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
-                xmlns:str="http://exslt.org/strings";>
-  
-  <xsl:include href="common.xslt"/>
-
-  <xsl:template match="path">
-    <h1 class="target">
-      patches applied to <span class="path"><a href="{$cgi-program}">projects</a></span> / <span class="path"><xsl:apply-templates/></span>
-    </h1>
-  </xsl:template>
-  
-  
-  <xsl:template match="changelog">
-    <table>
-      <tr class="patches">
-        <th>
-          <a class="sort" href="{$command}?c=patches&amp;s=name">name</a>
-          <a class="revsort" href="{$command}?c=patches&amp;s=revname"> (rev)</a>
-        </th>
-        <th>
-          <a class="sort" href="{$command}?c=patches&amp;s=date">date</a>
-          <a class="revsort" href="{$command}?c=patches&amp;s=revdate"> (rev)</a>
-        </th>
-        <th>
-          <a class="sort" href="{$command}?c=patches&amp;s=author">author</a>
-          <a class="revsort" href="{$command}?c=patches&amp;s=revauthor"> (rev)</a>
-        </th>
-        <th>
-        </th>
-      </tr>
-
-      <xsl:choose>
-        <xsl:when test="$sort-by = 'name'">
-          <xsl:apply-templates>
-            <xsl:sort select="name"/>
-          </xsl:apply-templates>
-        </xsl:when>
-        <xsl:when test="$sort-by = 'revname'">
-          <xsl:apply-templates>
-            <xsl:sort select="name" order="descending"/>
-          </xsl:apply-templates>
-        </xsl:when>
-        <xsl:when test="$sort-by = 'date'">
-          <xsl:apply-templates>
-            <xsl:sort select="@date"/>
-          </xsl:apply-templates>
-        </xsl:when>
-        <xsl:when test="$sort-by = 'revdate'">
-          <xsl:apply-templates>
-            <xsl:sort select="@date" order="descending"/>
-          </xsl:apply-templates>
-        </xsl:when>
-        <xsl:when test="$sort-by = 'author'">
-          <xsl:apply-templates>
-            <xsl:sort select="@author"/>
-          </xsl:apply-templates>
-        </xsl:when>
-        <xsl:when test="$sort-by = 'revauthor'">
-          <xsl:apply-templates>
-            <xsl:sort select="@author" order="descending"/>
-          </xsl:apply-templates>
-        </xsl:when>
-        <xsl:otherwise>
-          <!-- use the repository's natural order -->
-          <xsl:apply-templates/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </table>
-  </xsl:template>
-
-  <xsl:template match="patch">
-    <xsl:variable name="author" select="@author"/>
-    <xsl:variable name="hash"   select="@hash"/>
-    <xsl:variable name="name"   select="name"/>
-    <xsl:variable name="repo"   select="/darcs/@repository"/>
-
-    <xsl:variable name="created-as" select="/darcs/changelog/created_as"/>
-    <xsl:variable name="creator-hash" select="$created-as/patch/@hash"/>
-    <xsl:variable name="original-name" select="$created-as/@original_name"/>
-
-    <xsl:variable name="annotate-href">
-      <xsl:value-of select="$command"/>?c=annotate&amp;p=<xsl:value-of select="$hash"/>
-
-      <xsl:if test="$creator-hash">&amp;ch=<xsl:value-of select="$creator-hash"/></xsl:if>
-      <xsl:if test="$original-name">&amp;o=<xsl:value-of select="$original-name"/></xsl:if>
-    </xsl:variable>
-    
-    <tr class="patch">
-      <td><a href="{$annotate-href}"><xsl:value-of select="name"/></a></td>
-      <td><xsl:value-of select="@local_date"/></td>
-      <td>
-        <a href="mailto:{$author}"><xsl:value-of select="$author"/></a>
-      </td>
-      <td>
-        <a href="{$cgi-program}/{$repo}/?c=annotate&amp;p={$hash}">detail</a>
-      </td>
-    </tr>
-    <xsl:apply-templates/>
-  </xsl:template>
-
-  <!-- ignore <created_as>, <name> and <comment> children of <patch> -->
-  <xsl:template match="created_as"/>
-  <xsl:template match="name"/>
-  <xsl:template match="comment"/>
-</xsl:stylesheet>
rmfile ./tools/cgi/xslt/patches.xslt
hunk ./tools/cgi/xslt/repos.xslt 1
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- template for displaying a list of available repositories, used when a
- CGI request has no repository path information.  This template expects
- the following external variables:
-
-   cgi-program    - path to the CGI executable, to place in links
-   stylesheet     - path to the CSS stylesheet
-
- the input XML must have the following structure:
-
- <darcs repository="">
-   <repositories>
-     <repository name=""/>
-   </repositories>
- </darcs>
--->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
-  <xsl:variable name="command">
-    <xsl:value-of select="$cgi-program"/>/<xsl:value-of select="/darcs/@target"/>
-  </xsl:variable>
-  
-  <xsl:template match="/darcs">
-    <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en">
-      <head>
-        <title>darcs repository viewer</title>
-        <link rel="stylesheet" href="{$stylesheet}"/>
-      </head>
-
-      <body>
-        <h1 class="target">Available Repositories</h1>
-
-        <table>
-          <xsl:apply-templates/>
-        </table>
-      </body>
-    </html>
-  </xsl:template>
-
-  <xsl:template match="repositories">
-    <xsl:apply-templates>
-      <xsl:sort select="name(self::node())"/>
-      <xsl:sort select="@name"/>
-    </xsl:apply-templates>
-  </xsl:template>
-
-  <xsl:template match="repositories/repository">
-    <xsl:variable name="repository"  select="@name"/>
-
-    <tr>
-      <td>
-        <a href="{$cgi-program}/{$repository}/?c=browse">
-          <xsl:value-of select="$repository"/>
-        </a>
-      </td>
-    </tr>
-  </xsl:template>
-</xsl:stylesheet>
rmfile ./tools/cgi/xslt/repos.xslt
hunk ./tools/cgi/xslt/rss.xslt 1
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- template for converting darcs' `changes` output from XML to RSS.  This
- template expects the following external variables:
-
-   cgi-url    - full URL to the CGI executable, to place in links
-
- the input XML must have the following structure:
-
- <darcs repository="">
-   <changelog>
-     <patch author="" date="" localdate="" inverted="" hash="">
-       <name></name>
-       <comment></comment>
-     </patch>
-   </changelog>
- </darcs>
--->
-<xsl:stylesheet version="1.0"
-                exclude-result-prefixes="str"
-                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
-                xmlns:str="http://exslt.org/strings";>
-
-  <xsl:variable name="repo" select="/darcs/@repository"/>
-
-  <xsl:variable name="command">
-    <xsl:value-of select="$cgi-url"/>/<xsl:value-of select="/darcs/@target"/>
-  </xsl:variable>
-
-  <xsl:template match="changelog">
-    <rss version="2.0">
-      <channel>
-        <title>changes to <xsl:value-of select="$repo"/></title>
-        <link><xsl:value-of select="$command"/></link>
-        <description>
-          Recent patches applied to the darcs repository named
-          "<xsl:value-of select='$repo'/>".
-        </description>
-
-        <xsl:apply-templates>
-          <xsl:sort select="@date"/>
-        </xsl:apply-templates>
-      </channel>
-    </rss>
-  </xsl:template>
-
-  <xsl:template match="patch">
-    <xsl:variable name="hash"       select="@hash"/>
-
-    <xsl:variable name="created-as" select="/darcs/changelog/created_as"/>
-    <xsl:variable name="creator-hash" select="$created-as/patch/@hash"/>
-    <xsl:variable name="original-name" select="$created-as/@original_name"/>
-
-    <xsl:variable name="annotate-href">
-      <xsl:value-of select="$command"/>?c=annotate&amp;p=<xsl:value-of select="$hash"/>
-
-      <xsl:if test="$creator-hash">&amp;ch=<xsl:value-of select="$creator-hash"/></xsl:if>
-      <xsl:if test="$original-name">&amp;o=<xsl:value-of select="$original-name"/></xsl:if>
-    </xsl:variable>
-
-    <xsl:variable name="date-nodes" select="str:tokenize(@local_date, ' ')"/>
-    <xsl:variable name="rfc-date">
-      <xsl:value-of select="$date-nodes[1]"/>
-      <xsl:value-of select="', '"/>
-      <xsl:if test="$date-nodes[3] &lt; 10">0</xsl:if>
-      <xsl:value-of select="$date-nodes[3]"/>
-      <xsl:value-of select="' '"/>
-      <xsl:value-of select="$date-nodes[2]"/>
-      <xsl:value-of select="' '"/>
-      <xsl:value-of select="$date-nodes[6]"/>
-      <xsl:value-of select="' '"/>
-      <xsl:value-of select="$date-nodes[4]"/>
-      <xsl:value-of select="' '"/>
-      <xsl:value-of select="$date-nodes[5]"/>
-    </xsl:variable>
-
-    <item>
-      <title><xsl:value-of select="name"/></title>
-      <link><xsl:value-of select="$annotate-href"/></link>
-      <author><xsl:value-of select="@author"/></author>
-      <description><xsl:value-of select="comment"/></description>
-      <pubDate><xsl:value-of select="$rfc-date"/></pubDate>
-    </item>
-  </xsl:template>
-
-  <!-- ignore <path> <created_as>, <name> and <comment> children of <patch> -->
-  <xsl:template match="path"/>
-  <xsl:template match="created_as"/>
-  <xsl:template match="name"/>
-  <xsl:template match="comment"/>
-</xsl:stylesheet>
rmfile ./tools/cgi/xslt/rss.xslt
hunk ./tools/cgi/xslt/styles.css 1
-/**
- stylesheet for darcs repository browser
-**/
-
-a:link, a:visited {
-  color: blue;
-  text-decoration: none;
-}
-
-a:hover { text-decoration: underline; }
-a.sort  { color: black; }
-a.revsort  { 
-  color: black;
-  font-size: 75%;
-}
-a.home  { color: #9292C9; }
-
-body { margin: 10px 10px 10px 10px; }
-
-h1.target {
-  font-size: 150%;
-  font-weight: bold;
-}
-
-h2.patch {
-  font-size: 125%;
-  font-weight: bold;
-  margin-top: -10px;
-  padding-left: 10px;
-}
-
-h2.author {
-  font-size: smaller;
-  margin-top: -10px;
-  font-weight: bold;
-  padding-left: 30px;
-}
-
-input.patches {  margin-right: 20px; }
-label.tag     {  margin-right: 5px; }
-
-span.path, span.path > a { color: #2A2A6B; }
-
-span.version {
-  color: #9292C9;  
-  margin-left: 75px;
-}
-
-span.comment {
-  color: #2A2A6B;
-  white-space: pre;
-}
-
-th,td {
-  text-align: left;
-  padding: 5px 10px 5px 10px;  
-}
-
-tr.annotate { background-color: #FFAAAA; }
-tr.browse { background-color: #FFFF99; }
-tr.patches { background-color: #AAFFAA; }
-tr.directory { background-color: #CFCFCF; }
-tr.file, tr.patch, tr.modified-file { background-color: #DCDCDA; }
-tr.modified-file, tr.add-remove-file { background-color: #DCDCDA; }
-
-pre {
-    margin: 0 0 0 0;
-}
-
-a.added-line {
-    color: #00AA00;
-    float: left;
-}
-
-a.normal-line {
-    color: #000000;
-    float: left;
-}
-
-a.removed-line {
-    color: #CC0000;
-    float: left;
-    text-decoration: line-through;
-}
-
-a.removed-by {
-    clear: right;
-    color: #CC0000;
-    float: right;
-    font-size: 125%;
-}
rmfile ./tools/cgi/xslt/styles.css
rmdir ./tools/cgi/xslt
rmdir ./tools/cgi

Context:

[Rectify dist help
[EMAIL PROTECTED]
 Removed the "make dist" suggestion, the manual is a better place for that.
 Instead, make clear that it operates on a clean copy of the tree, and
 mention the "predist" functionality.
] 
[website: explain that darcs 2 is required to get the darcs source.
Simon Michael <[EMAIL PROTECTED]>**20080803181216] 
[Canonize Gaetan Lehmann and Daniel Buenzli.
Eric Kow <[EMAIL PROTECTED]>**20080730104357
 (for Daniel B, avoid an accent in his name)
] 
[fix type witness compile errors specific to ghc 6.8
Jason Dagit <[EMAIL PROTECTED]>**20080722182729] 
[configure: check for packages needed with split base.
Eric Kow <[EMAIL PROTECTED]>**20080730103840
 Now that all packages must be used explicitly.
] 
[avoid import of unused function fromMaybe.
David Roundy <[EMAIL PROTECTED]>**20080729172825] 
[configure: suggest regex-compat before text
Eric Kow <[EMAIL PROTECTED]>**20080725095336] 
[configure: mention Haskell in 'try installing' suggestion
Eric Kow <[EMAIL PROTECTED]>**20080725095015] 
[Typo (Text.Regex)
Eric Kow <[EMAIL PROTECTED]>**20080715121708] 
[Use haskeline to have a readline-like behavior when asking something to the user
[EMAIL PROTECTED]
 Unlike the implementations using readline or editline packages, this code
 code doesn't break the Ctrl-C behavior.
] 
[Improve generic rules for English plurals. 
Eric Kow <[EMAIL PROTECTED]>**20080604123728] 
[add configure check for Network.URI.
David Roundy <[EMAIL PROTECTED]>**20080711011914] 
[add -hide-all-packages to default GHCFLAGS.
David Roundy <[EMAIL PROTECTED]>**20080711010952] 
[add support for outputting patch numbers in darcs changes.
David Roundy <[EMAIL PROTECTED]>**20080710011211] 
[add support for matching single patches by index.
David Roundy <[EMAIL PROTECTED]>**20080710004512] 
[add support for matching ranges of patches (counting back from present).
David Roundy <[EMAIL PROTECTED]>**20080710003225] 
[Better avoid silly manpage error.
Trent W. Buck <[EMAIL PROTECTED]>**20080704024920
 
 It turned out only initialize's help string used 'quotes', so just
 remove them.  This makes init's docstring consistent with the others.
] 
[Missing period at end of sentence.
Trent W. Buck <[EMAIL PROTECTED]>**20080704024232] 
[darcs --overview no longer works, so don't document it.
Trent W. Buck <[EMAIL PROTECTED]>**20080704030804] 
[Avoid silly manpage error.
Trent W. Buck <[EMAIL PROTECTED]>**20080703010733
 man (nroff) treats an apostrophe in the first column specially,
 resulting in a syntax error without this patch.
 
 Ideally, all cases of 'foo' in the manpage (i.e. docstrings) should
 become `foo', since man -Tps turns ` and ' into left and right single
 quotes respectively.
] 
[obliterate whitespace in Darcs.Commands.Get
[EMAIL PROTECTED]
 'twas causing lhs/haddock difficulties where a \end{code} wasn't getting recognized.
] 
[rm haddock CPP business
[EMAIL PROTECTED]
 Try as I might, I can't see any reason to special-case some Haddock CPP logic to deal with some *commented-out guards*, unless CPP magically restores and uncomments the code if Haddock isn't being run.
] 
[make pull less verbose when --verbose flag is given.
David Roundy <[EMAIL PROTECTED]>**20080624170035] 
[fix makefile to remember to regenerate version information after running configure.
David Roundy <[EMAIL PROTECTED]>**20080624170001] 
[TAG 2.0.2
David Roundy <[EMAIL PROTECTED]>**20080624012041] 
Patch bundle hash:
a297f3f6674d9122df9c20661be82db854247460
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to