diff -Naur CDash-1.6.2/cdash/common.php CDash-1.6.2-patched/cdash/common.php
--- CDash-1.6.2/cdash/common.php	2010-02-05 15:07:00.000000000 +0800
+++ CDash-1.6.2-patched/cdash/common.php	2010-02-13 15:49:33.000000000 +0800
@@ -2183,6 +2183,21 @@
   return make_cdash_url($diff_url);
 }
 
+/** Return the hgweb URL */
+function get_hgweb_diff_url($projecturl, $directory, $file, $revision)
+{
+  if($revision != '')
+  {
+    $diff_url = $projecturl."/diff/".$revision."/".($directory ? ("/".$directory) : "")."/".$file;
+  }
+  else
+  {
+    $diff_url = $projecturl."/file/tip/".($directory ? ("/".$directory) : "")."/".$file;
+  }
+  return make_cdash_url($diff_url);
+}
+
+
 /** Get the diff url based on the type of viewer */
 function get_diff_url($projectid, $projecturl, $directory, $file, $revision='')
 {
@@ -2239,6 +2254,10 @@
     {
     return get_cgit_diff_url($projecturl, $directory, $file, $revision);
     }
+  elseif($project_array["cvsviewertype"] == "hgweb")
+    {
+    return get_hgweb_diff_url($projecturl, $directory, $file, $revision);
+    }
   else // default is viewcvs
     {
     return get_viewcvs_diff_url($projecturl, $directory, $file, $revision);
diff -Naur CDash-1.6.2/createProject.php CDash-1.6.2-patched/createProject.php
--- CDash-1.6.2/createProject.php	2010-02-05 15:07:04.000000000 +0800
+++ CDash-1.6.2-patched/createProject.php	2010-02-13 15:50:30.000000000 +0800
@@ -482,6 +482,7 @@
 $xml .= AddCVSViewer("gitorious","Gitorious",$Project->CvsViewerType);
 $xml .= AddCVSViewer("github","GitHub",$Project->CvsViewerType);
 $xml .= AddCVSViewer("cgit","cgit",$Project->CvsViewerType);
+$xml .= AddCVSViewer("hgweb","hgweb",$Project->CvsViewerType);
 
 $xml .= add_XML_value("nrepositories",$nRepositories); // should be at the end
 
