diff -Naurw CDash-1.8.2/cdash/common.php CDash-1.8.2-patched/cdash/common.php
--- CDash-1.8.2/cdash/common.php	2010-12-13 10:32:28.000000000 -0800
+++ CDash-1.8.2-patched/cdash/common.php	2011-01-03 12:25:12.000000000 -0800
@@ -1977,6 +1977,20 @@
   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='')
 {
@@ -2181,6 +2195,10 @@
     {
     return get_cgit_revision_url($projecturl,$revision);
     }
+  elseif($project_array["cvsviewertype"] == "hgweb")
+    {
+    return get_hgweb_diff_url($projecturl, $directory, $file, $revision);
+    }
   else // default is viewcvs
     {
     return get_viewcvs_revision_url($projecturl,$revision);
diff -Naurw CDash-1.8.2/createProject.php CDash-1.8.2-patched/createProject.php
--- CDash-1.8.2/createProject.php	2010-12-13 10:32:32.000000000 -0800
+++ CDash-1.8.2-patched/createProject.php	2011-01-03 12:11:01.000000000 -0800
@@ -511,6 +511,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
 
