[chora] Status / Roadmap

Mathieu Arnold arn_mat@club-internet.fr
Thu, 05 Apr 2001 11:58:19 +0200


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


James Byers wrote:
> 
>         Hi Chora developers,
> 
>         I'm hoping you can answer a few questions about how far along
> Chora is compared to CVSweb / viewcvs.  I've read through everything I
> could find at cvsweb.horde.org and the list archives; if I'm asking
> something covered in the docs, by all means point me to the right
> place.
> 
> - Are there any features provided by stock CVSweb that aren't yet done
> by Chora?

the long unified diff stuff, which patch is included.

> - Any outstanding bugs (other than the one in BUGS)? :)

not outstanding, but the htmlspaces function in diff.php is not working
well (i've said it before, but my patch seemed not to have made it's way
into chora)

> - If one were to put Chora on a very large, high-traffic repository, how
> do you think it would scale?  Any bits that are due for optimization?

well, the bottleneck is all the forks, if cvs was implemented in php
directly, it would maybe scale better.

-- 
Mathieu Arnold
---------------------- multipart/mixed attachment
Index: common.php
===================================================================
RCS file: /home/cvs/cvs/dup/horde/chora/common.php,v
retrieving revision 1.32
diff -u -r1.32 common.php
--- common.php	2001/03/18 01:52:45	1.32
+++ common.php	2001/04/05 09:52:51
@@ -25,7 +25,7 @@
  * TODO: defaults of 1 will not get propagated correctly - avsm
  */
 
-$defaultActs = array ( "sbt"=>CVSLIB_SORT_NONE, "sa"=>0, 
+$defaultActs = array ( "sbt"=>$conf['options']['defaultsort'], "sa"=>0, 
                        "ord"=>CVSLIB_SORT_ASCENDING );
 
 foreach ($cvsroots as $key=>$val) {
Index: cvs.php
===================================================================
RCS file: /home/cvs/cvs/dup/horde/chora/cvs.php,v
retrieving revision 1.82
diff -u -r1.82 cvs.php
--- cvs.php	2001/02/27 07:05:59	1.82
+++ cvs.php	2001/04/05 09:52:51
@@ -168,6 +168,7 @@
         if ($prevRevision = $lg->queryPreviousRevision()) {
             $changedLines = $lg->lines;
             $diffURL = url('diff',$where,array('r1'=>$prevRevision,'r2'=>$rev, 'f'=>'h'));
+            $LongDiffURL = url('diff',$where,array('r1'=>$prevRevision,'r2'=>$rev, 'f'=>'h', 'num'=>10));
             $uniDiffURL = url('diff',$where,array('r1'=>$prevRevision,'r2'=>$rev,'f'=>'u'));
         }
 
Index: diff.php
===================================================================
RCS file: /home/cvs/cvs/dup/horde/chora/diff.php,v
retrieving revision 1.25
diff -u -r1.25 diff.php
--- diff.php	2001/03/01 01:26:29	1.25
+++ diff.php	2001/04/05 09:52:51
@@ -48,6 +49,11 @@
     $r2 = $tr2;
 }
 
+/* If no line numbers has been specified, then default to 3 */
+
+if (!isset($num)) {
+    $num = 3;
+}
 /* If no type has been specified, then default to unified */
 
 if (!isset($f)) {
@@ -86,7 +92,7 @@
 /* A plain-text diff */
 else if ($f != 'h') {
     header("Content-Type: text/plain\n\n");
-    echo implode("\n",CVSLib_Diff::get($CVS, $fl, $r1, $r2, $type));
+    echo implode("\n",CVSLib_Diff::get($CVS, $fl, $r1, $r2, $type, $num));
 
 /* Human-Readable diff */
 } else {
@@ -101,7 +107,7 @@
 
     /* Retrieve the tree of changes from CVSLib */
     $lns = CVSLib_Diff::humanReadable(
-           CVSLib_Diff::get($CVS, $fl, $r1, $r2, CVSLIB_DIFF_UNIFIED));
+           CVSLib_Diff::get($CVS, $fl, $r1, $r2, CVSLIB_DIFF_UNIFIED, $num));
     /* TODO: check for errors here (CVSLib_Error returned) - avsm */
     /* Is the diff empty? */
     if (!sizeof($lns)) {
Index: lib/CVSLib.php
===================================================================
RCS file: /home/cvs/cvs/dup/horde/chora/lib/CVSLib.php,v
retrieving revision 1.67
diff -u -r1.67 CVSLib.php
--- lib/CVSLib.php	2001/03/18 03:09:00	1.67
+++ lib/CVSLib.php	2001/04/05 09:52:51
@@ -169,7 +169,7 @@
 	/* Parse the rest of the lines into a hash, keyed on username */
 	while ($line = fgets($fl, 4096)) {
             if (preg_match('/^\s*$/',$line)) continue; 
-            if (!preg_match('/^(\w+)\s+(.+)\s+(\w+@[\w\.]+)\s+(.*)$/', $line, $regs)) continue;
+            if (!preg_match('/^(\w+)\s+(.+)\s+([\w.]+@[\w\.]+)\s+(.*)$/', $line, $regs)) continue;
             $users[$regs[1]]['name'] = trim($regs[2]);
             $users[$regs[1]]['mail'] = trim($regs[3]);
             $users[$regs[1]]['desc'] = trim($regs[4]);
Index: lib/CVSLib/Diff.php
===================================================================
RCS file: /home/cvs/cvs/dup/horde/chora/lib/CVSLib/Diff.php,v
retrieving revision 1.13
diff -u -r1.13 Diff.php
--- lib/CVSLib/Diff.php	2001/02/22 21:14:31	1.13
+++ lib/CVSLib/Diff.php	2001/04/05 09:52:51
@@ -24,10 +24,11 @@
      * @param rev1 Original revision number to compare from
      * @param rev2 New revision number to compare against
      * @param type Constant which indicates the type of diff (e.g. unified)
+     * @param num Number of lines to be used in context and unified diff
      * @return false on failure, or a string containing the diff on success
      */
 
-    function get($cvsrep, $file, $rev1, $rev2, $type = CVSLIB_DIFF_CONTEXT) {
+    function get($cvsrep, $file, $rev1, $rev2, $type = CVSLIB_DIFF_CONTEXT, $num = 3) {
 
         /* Make sure that the file parameter is valid */
         if (!is_object($file) || $file->id() != CVSLIB_FILE) {
@@ -48,10 +49,10 @@
         $options = '-kk ';
         switch ($type) {
         case CVSLIB_DIFF_CONTEXT:
-            $options = '-p -c';
+            $options = '-p --context='.$num;
             break;
         case CVSLIB_DIFF_UNIFIED:
-            $options = '-p -u';
+            $options = '-p --unified='.$num;
             break;
         case CVSLIB_DIFF_COLUMN:
             $options = '--side-by-side --width=120';
Index: templates/diff_rev.inc
===================================================================
RCS file: /home/cvs/cvs/dup/horde/chora/templates/diff_rev.inc,v
retrieving revision 1.13
diff -u -r1.13 diff_rev.inc
--- templates/diff_rev.inc	2001/01/20 00:14:24	1.13
+++ templates/diff_rev.inc	2001/04/05 09:52:51
@@ -21,6 +21,7 @@
 Changed since <b><?= $prevRevision ?></b>: <?= $changedLines ?>
 <br />
 <a href="<?= $diffURL ?>">Diffs to version <?= $prevRevision ?></a>
+(<a href="<?= $LongDiffURL ?>">long</a>)
 (<a href="<?= $uniDiffURL ?>">unified</a>)
 <br />
 <?php endif; ?>

---------------------- multipart/mixed attachment
Index: diff.php
===================================================================
RCS file: /home/cvs/cvs/dup/horde/chora/diff.php,v
retrieving revision 1.25
diff -u -r1.25 diff.php
--- diff.php	2001/03/01 01:26:29	1.25
+++ diff.php	2001/04/05 09:52:51
@@ -17,7 +17,8 @@
   */
 function htmlspaces($text='') {
     $text = htmlspecialchars($text);
-    $text = str_replace("\t", '        ', $text);
+    $text = str_replace("\t", '&nbsp; &nbsp; &nbsp; &nbsp; ', $text);
+    $text = str_replace('  ', '&nbsp; ', $text);
     $text = str_replace('  ', ' &nbsp;', $text);
     return empty($text)?'&nbsp;':$text;
 }


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