#
# Patch for CVSweb to allow the magic identifiers in CVSweb interface.
#

To enable these add the following lines to your cvsweb.conf:

# VCS linking.
#
$vcsurl = "/cgi-bin/cvsweb.cgi/";

# Wiki linking.
#     
$wikiurl = "/wiki/index.php/";


--- cvsweb-3.0.6-orig/cvsweb.cgi
+++ cvsweb-3.0.6/cvsweb.cgi
@@ -68,7 +68,7 @@
   %symrev %revsym @allrevisions %date %author @revdisplayorder
   @revisions %state %difflines %log %branchpoint @revorder $keywordsubstitution
   $prcgi @prcategories $re_prcategories $prkeyword $re_prkeyword $mancgi
-  $doCheckout $scriptname $scriptwhere
+  $doCheckout $scriptname $scriptwhere $vcsurl $wikiurl
   $where $Browser $nofilelinks $maycompress @stickyvars %funcline_regexp
   $is_links $is_lynx $is_w3m $is_msie $is_mozilla3 $is_textbased
   %input $query $barequery $sortby $bydate $byrev $byauthor
@@ -1568,6 +1568,30 @@
          }egx;
       } $_;
     }
+ 
+    # get vcs references as link: "VCS: dir/file"
+    if (defined($vcsurl)) {
+      $_ = htmlify_sub {
+        s{
+           \b (VCS:)\s?([0-9A-Za-z_/\-.]*) \b
+         }{
+            my($text, $name) = ($1, $2);
+            $text . " " . &link($name, $vcsurl . $name);
+         }egx;
+      } $_;
+    }
+
+    # get wiki references as link: "Wiki: article"
+    if (defined($wikiurl)) {
+      $_ = htmlify_sub {
+        s{
+           \b (Wiki:)\s?([A-Za-z_\-:]*) \b
+         }{
+            my($text, $name) = ($1, $2);
+            $text . " " . &link($name, $wikiurl . $name);
+         }egx;
+      } $_;
+    }
   }
 
   return $_;

