Show refs and break paths into tree links on history page
Show refs and break paths into tree links on history page

--- a/include/display.git_history.php
+++ b/include/display.git_history.php
@@ -12,6 +12,7 @@
  require_once('gitutil.git_read_commit.php');
  require_once('gitutil.read_info_ref.php');
  require_once('gitutil.git_history_list.php');
+ require_once('gitutil.git_path_trees.php');
 
 function git_history($projectroot,$project,$hash,$file)
 {
@@ -23,10 +24,13 @@
 	$tpl->clear_all_assign();
 	$tpl->assign("project",$project);
 	$tpl->assign("hash",$hash);
+	if (isset($refs[$hash]))
+		$tpl->assign("hashbaseref",$refs[$hash]);
 	$tpl->assign("tree",$co['tree']);
 	$tpl->display("history_nav.tpl");
 	$tpl->assign("title",$co['title']);
-	$tpl->assign("file",$file);
+	$paths = git_path_trees($projectroot . $project, $hash, $file);
+	$tpl->assign("paths",$paths);
 	$tpl->display("history_header.tpl");
 	$cmdout = git_history_list($projectroot . $project, $hash, $file);
 	$alternate = FALSE;

--- a/templates/history_header.tpl
+++ b/templates/history_header.tpl
@@ -5,8 +5,12 @@
  *
  *  Copyright (C) 2006 Christopher Han <xiphux@gmail.com>
  *}
- <div><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}" class="title">{$title}</a>
+ <div><a href="{$SCRIPT_NAME}?p={$project}&a=commit&h={$hash}" class="title">{$title}
+ {if $hashbaseref}
+ <span class="tag">{$hashbaseref}</span>
+ {/if}
+ </a>
  </div>
- <div class="page_path"><b>/{$file}</b><br /></div>
+ <div class="page_path"><b><a href="{$SCRIPT_NAME}?p={$project}&a=tree&hb={$hash}&h={$hash}">[{$project}]</a> / {foreach from=$paths item=path name=paths}{if $smarty.foreach.paths.last}<a href="{$SCRIPT_NAME}?p={$project}&a=blob&h={$path.tree}&f={$path.full}">{$path.short}</a>{else}<a href="{$SCRIPT_NAME}?p={$project}&a=tree&hb={$hash}&h={$path.tree}&f={$path.full}">{$path.short}</a> / {/if}{/foreach}</b></div>
  <table cellspacing="0">
 

comments