? .DS_Store
? 619650-2.drupalorg.patch-link-for-n00bs.patch
? 619650.drupalorg.patch-link-for-n00bs.patch
? project_issue.patch-help.patch
Index: drupalorg.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drupalorg/Attic/drupalorg.module,v
retrieving revision 1.66.2.27
diff -u -p -r1.66.2.27 drupalorg.module
--- drupalorg.module	15 Jan 2010 00:04:59 -0000	1.66.2.27
+++ drupalorg.module	17 Jan 2010 00:01:01 -0000
@@ -39,6 +39,11 @@ define('DRUPALORG_SECURITY_CONTACT_URL',
 define('DRUPALORG_RELEASE_TYPE_HANDBOOK_URL', 'http://drupal.org/handbook/cvs/releases/types#type');
 
 /**
+ * URL for the handbook page that provides help on applying patches.
+ */
+define('DRUPALORG_PATCH_HANDBOOK_URL', 'http://drupal.org/patch/apply');
+
+/**
  * URL specifically to describe the "Security update" term.
  * For now, the general page for release types is the best we've got.
  */
@@ -699,3 +704,17 @@ function _drupalorg_node_add_project_iss
   return t('The creation of issues in this project is prohibited.');
 }
 
+/**
+ * Implementation of theme preprocessor for comment_upload_attachments.
+ *
+ * Adds a link to documentation to a patch file on a comment.
+ */
+function drupalorg_preprocess_comment_upload_attachments(&$variables) {
+  foreach ($variables['attachments'] as $id => $attachment) {
+    // If one attachment is a patch, show the patch help link.
+    if (in_array(end(explode(".", $attachment['text'])), array('patch', 'diff'))) {
+      $variables['attachments_description'] = l('Get help with patches', DRUPALORG_PATCH_HANDBOOK_URL, array('class' => 'patch-help'));
+      break;
+    }
+  }
+}
