From 68b8b8f312d60bff2f85b89ad4fabc5542689714 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Mon, 8 Nov 2010 23:29:46 -0500 Subject: [PATCH] Two small changes: don't sort File objects automatically, and implement single-revision log fetching (in Horde_Vcs_File_Git) These changes speed of display of diffs in chora immensely for me. --- framework/Vcs/lib/Horde/Vcs.php | 1 - framework/Vcs/lib/Horde/Vcs/File/Git.php | 19 ++++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/framework/Vcs/lib/Horde/Vcs.php b/framework/Vcs/lib/Horde/Vcs.php index de63c3a4c..3ade2d59b 100644 --- a/framework/Vcs/lib/Horde/Vcs.php +++ b/framework/Vcs/lib/Horde/Vcs.php @@ -533,7 +533,6 @@ class Horde_Vcs } $ob->setRepository($this); - $ob->applySort(self::SORT_AGE); if (!empty($this->_cache) && !$fetchedFromCache) { $this->_cache->set($cacheId, serialize($ob)); diff --git a/framework/Vcs/lib/Horde/Vcs/File/Git.php b/framework/Vcs/lib/Horde/Vcs/File/Git.php index 9eb46c0cb..de17a75ac 100644 --- a/framework/Vcs/lib/Horde/Vcs/File/Git.php +++ b/framework/Vcs/lib/Horde/Vcs/File/Git.php @@ -198,7 +198,24 @@ class Horde_Vcs_File_Git extends Horde_Vcs_File return $revlist; } - /** + /** + * TODO + */ + public function queryLogs($rev = null) + { + if (is_null($rev)) { + $this->_ensureLogsInitialized(); + return $this->logs; + } else { + if (!isset($this->logs[$rev])) { + $this->logs[$rev] = $this->_rep->getLogObject($this, $rev); + } + + return isset($this->logs[$rev]) ? $this->logs[$rev] : null; + } + } + + /** * Return the last Horde_Vcs_Log object in the file. * * @return Horde_Vcs_Log Log object of the last entry in the file. -- 2.11.0