From 3743cf39ecb8a2adb07d3138f146fb4a066d2bf6 Mon Sep 17 00:00:00 2001
From: Marco Villegas <marvil07@gmail.com>
Date: Wed, 19 Jan 2011 17:27:46 -0500
Subject: [PATCH] task #1030266 by mikey_p, marvil07: Single commit view should use revision in the title.

---
 commitlog/commitlog.module                         |   15 ++++++++++++++-
 .../commitlog_individual_commit.view.php           |    2 +-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git commitlog/commitlog.module commitlog/commitlog.module
index 4637fa6..b231e8f 100644
--- commitlog/commitlog.module
+++ commitlog/commitlog.module
@@ -125,7 +125,20 @@ function commitlog_operations_page($type = NULL, $argument = NULL, $argument2 =
   else if ($type == 'commit' && !is_null($argument) && !is_null($argument2)) {
     $set = versioncontrol_get_views_set('individual_commit_view');
     $view_name = $set->getViewName();
-    return views_embed_view($view_name, 'default', $argument, $argument2);
+    $view = views_get_view($view_name);
+
+    // Basic logic here borrowed from views_embed_view().
+    if (!$view || !$view->access('default')) {
+      return drupal_not_found();
+    }
+    $output = $view->preview('default', array($argument, $argument2));
+
+    $title = $view->get_title();
+    if (!empty($title)) {
+      drupal_set_title($title);
+    }
+
+    return $output;
   }
   else {
     $set = versioncontrol_get_views_set('global_commit_view');
diff --git commitlog/includes/views/default_views/commitlog_individual_commit.view.php commitlog/includes/views/default_views/commitlog_individual_commit.view.php
index ca2badf..4b12892 100644
--- commitlog/includes/views/default_views/commitlog_individual_commit.view.php
+++ commitlog/includes/views/default_views/commitlog_individual_commit.view.php
@@ -344,7 +344,7 @@ $handler->override_option('arguments', array(
     'style_options' => array(),
     'wildcard' => 'all',
     'wildcard_substitution' => 'All',
-    'title' => 'Revision %1',
+    'title' => 'Revision %2',
     'breadcrumb' => '',
     'default_argument_type' => 'fixed',
     'default_argument' => '',
-- 
1.7.2.3

