Fix call to Horde_Vcs_Revision; nits.
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 23 Dec 2008 06:29:25 +0000 (23:29 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 23 Dec 2008 06:30:33 +0000 (23:30 -0700)
chora/annotate.php
chora/browse.php
chora/lib/Chora.php

index 8b4cd5c..f7c6500 100644 (file)
@@ -29,13 +29,9 @@ $title = sprintf(_("Source Annotation of %s (revision %s)"), Text::htmlAllSpaces
 $extraLink = sprintf('<a href="%s">%s</a> | <a href="%s">%s</a>',
                      Chora::url('co', $where, array('r' => $rev)), _("View"),
                      Chora::url('co', $where, array('r' => $rev, 'p' => 1)), _("Download"));
-require CHORA_TEMPLATES . '/common-header.inc';
-require CHORA_TEMPLATES . '/menu.inc';
-require CHORA_TEMPLATES . '/headerbar.inc';
-require CHORA_TEMPLATES . '/annotate/header.inc';
 
 $author = '';
-$style = 0;
+$i = $style = 0;
 
 /* Map of revisions for finding the previous revision to a change. */
 $revMap = $fl->revs;
@@ -45,9 +41,13 @@ $rrevMap = array_flip($revMap);
 /* Keep track of any revision we encounter in the following loop. */
 $revList = array();
 
+require CHORA_TEMPLATES . '/common-header.inc';
+require CHORA_TEMPLATES . '/menu.inc';
+require CHORA_TEMPLATES . '/headerbar.inc';
+require CHORA_TEMPLATES . '/annotate/header.inc';
+
 /* Use this counter so that we can give each tooltip object a unique
  * id attribute (which we use to set the tooltip text later). */
-$i = 0;
 foreach ($lines as $line) {
     $lineno = $line['lineno'];
     $prevAuthor = $author;
index b097df7..4e67d20 100644 (file)
@@ -26,11 +26,9 @@ if ($atdir) {
     Chora::checkError($fileList = $dir->queryFileList($atticFlags));
 
     /* Decide what title to display. */
-    if ($where == '') {
-        $title = $conf['options']['introTitle'];
-    } else {
-        $title = sprintf(_("Source Directory of /%s"), $where);
-    }
+    $title = ($where == '')
+        ? $conf['options']['introTitle']
+        : sprintf(_("Source Directory of /%s"), $where);
 
     $extraLink = '';
     if (is_a($VC, 'VC_cvs')) {
@@ -132,16 +130,17 @@ if ($atdir) {
 
 /* Showing a file. */
 $fl = $VC->getFileObject($where, $cache);
+$rev_ob = $VC->getRevisionObject();
 Chora::checkError($fl);
 $title = sprintf(_("Revisions for %s"), $where);
 $onb = Util::getFormData('onb', 0);
 if ($VC->isValidRevision($onb)) {
     $onb_len = strlen($onb);
-    $onb_base = Horde_Vcs_Revision::strip($onb, 1);
+    $onb_base = $rev_ob->strip($onb, 1);
     $onb_parents = array();
     while (substr_count($onb_base, '.')) {
         $onb_parents[$onb_base] = true;
-        $onb_base = Horde_Vcs_Revision::strip($onb_base, 1);
+        $onb_base = $rev_ob->strip($onb_base, 1);
     }
 } else {
     $onb = null;
@@ -183,7 +182,7 @@ foreach ($fl->logs as $lg) {
             /* If the revision is on one of the parent branches, and
              * is before the branch was made, let it through. */
             if ((!isset($onb_parents[$branchRev]) && substr_count($rev, '.') > 1) ||
-                Horde_Vcs_Revision::cmp($rev, $onb) > 0) {
+                $rev_ob->cmp($rev, $onb) > 0) {
                 continue;
             }
         }
index 087a27d..454702d 100644 (file)
@@ -565,14 +565,15 @@ class Chora {
      * Return branch information for a given revision.
      *
      * @param Horde_Vcs_File $fl  The Horde_Vcs_File object.
-     * @param string $rev        The filename.
+     * @param string $rev         The filename.
      *
      * @return array  An 2-member array - branch name and branch revision.
      */
     function getBranch($fl, $rev)
     {
         $branchName = '';
-        $branchRev = Horde_Vcs_Revision::strip($rev, 1);
+        $rev_ob = $fl->rev->getRevisionObject();
+        $branchRev = $rev_ob->strip($rev, 1);
         if (isset($fl->branches[$rev])) {
             $branchName = $fl->branches[$rev];
         } elseif (isset($fl->branches[$branchRev])) {