diff to some version

Mathieu Arnold arn_mat@club-internet.fr
Sun, 19 Aug 2001 19:53:40 +0200


---------------------- multipart/mixed attachment
Hi

here is a patch that allows you to select a version, and request diffs
directly from that version.

ps: there are some part of CVSLib that needs l10n (the one that talks
about time, with worlds like second, minute, hour...)
-- 
Mathieu Arnold
---------------------- multipart/mixed attachment
Index: cvs.php
===================================================================
RCS file: /home/cvs/cvs/dup/horde/chora/cvs.php,v
retrieving revision 1.108
diff -u -r1.108 cvs.php
--- cvs.php	2001/08/12 12:05:59	1.108
+++ cvs.php	2001/08/19 15:11:18
@@ -200,6 +200,15 @@
             $uniDiffURL = url('diff', $where, array('r1'=>$prevRevision,'r2'=>$rev,'f'=>'u'));
         }
 
+        if ($manyRevisions = ($fl->queryRevision() != 1.1)) {
+            $selCvsURL = url('cvs', $where, array('r1'=>$rev));
+            if (!empty($r1)) {
+                $selDiffURL = url('diff', $where, array('r1'=>$r1, 'r2'=>$rev, 'f'=>'h'));
+                $selLongDiffURL = url('diff', $where, array('r1'=>$r1, 'r2'=>$rev, 'f'=>'h', 'num'=>10));
+                $selUniDiffURL = url('diff', $where, array('r1'=>$r1, 'r2'=>$rev,'f'=>'u'));
+            }
+        }
+
         $logMessage = htmlify($lg->log);
         include($registry->getTemplatePath() . '/log/rev.inc');
     }
Index: templates/log/rev.inc
===================================================================
RCS file: /home/cvs/cvs/dup/horde/chora/templates/log/rev.inc,v
retrieving revision 1.6
diff -u -r1.6 rev.inc
--- templates/log/rev.inc	2001/08/03 20:36:51	1.6
+++ templates/log/rev.inc	2001/08/19 15:11:18
@@ -25,10 +26,25 @@
 <?php endif; ?>
 <?php if (!empty($prevRevision)): ?>
 <?= sprintf(_("Changed since <b>%s</b>"), $prevRevision) ?></b>: <?= $changedLines ?>
+<?php endif; ?>
+<?php if ($manyRevisions): ?>
+<?php if (!empty($r1) and ($r1 == $rev)): ?>
+<b>[<?= _("Selected") ?>]</b>
+<?php else: ?>
+[<a href="<?= $selCvsURL ?>"><?= _("Select for Diff")?></a>]
+<?php endif; ?>
+<?php endif; ?>
 <br />
+<?php if (!empty($prevRevision)): ?>
 <a href="<?= $diffURL ?>"><?= sprintf(_("Diffs to version %s"), $prevRevision) ?></a>
 (<a href="<?= $longDiffURL ?>"><?= _("long") ?></a>)
 (<a href="<?= $uniDiffURL ?>"><?= _("unified") ?></a>)
+<br />
+<?php endif; ?>
+<?php if ($manyRevisions and !empty($r1) and ($r1 != $prevRevision) and ($r1 != $rev)): ?>
+<a href="<?= $selDiffURL ?>"><?= sprintf(_("Diffs to version %s"), $r1) ?></a>
+(<a href="<?= $selLongDiffURL ?>"><?= _("long") ?></a>)
+(<a href="<?= $selUniDiffURL ?>"><?= _("unified") ?></a>)
 <br />
 <?php endif; ?>
 </td><td class="diff-log" width="65%">

---------------------- multipart/mixed attachment--