? versioncontrol_hg.module.works
Index: versioncontrol_hg.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/versioncontrol_hg/versioncontrol_hg.module,v
retrieving revision 1.12
diff -u -r1.12 versioncontrol_hg.module
--- versioncontrol_hg.module	3 Feb 2008 04:05:20 -0000	1.12
+++ versioncontrol_hg.module	17 Feb 2008 16:00:59 -0000
@@ -378,6 +378,18 @@
 }
 
 /**
+ * Implementation of [versioncontrol_backend]_get_short_revision_identifier():
+ * Return a shortened version of the revision identifier, as plaintext.
+ * This is used by versioncontrol_format_commit_identifier()
+ * and versioncontrol_format_item_revision().
+ */
+function versioncontrol_hg_format_short_revision_identifier($revision) {
+  // Let's return only the first 12 characters of the commit identifier,
+  // like Mercurial (including hgweb) does by default.
+  return substr($revision, 0, 12);
+}
+
+/**
  * Implementation of [versioncontrol_backend]_get_current_item_branch().
  */
 function versioncontrol_hg_get_current_item_branch($repository, $item) {
