phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: chora annotate.php,1.4,1.5 checkout.php,1.5,1.6


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: chora annotate.php,1.4,1.5 checkout.php,1.5,1.6 cvs.php,1.12,1.13 diff.php,1.7,1.8 history.php,1.4,1.5
Date: Sun, 28 Apr 2002 15:26:43 -0400

Update of /cvsroot/phpgroupware/chora
In directory subversions:/tmp/cvs-serv25993

Modified Files:
        annotate.php checkout.php cvs.php diff.php history.php 
Log Message:
Convert to phpgw object creation methods; remove old files



Index: annotate.php
===================================================================
RCS file: /cvsroot/phpgroupware/chora/annotate.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** annotate.php        20 Sep 2001 21:50:06 -0000      1.4
--- annotate.php        28 Apr 2002 19:26:40 -0000      1.5
***************
*** 17,30 ****
        include('./config/conf.php');
  
        /* Spawn the file object */
!       $fl = new CVSLib_File($CVS, $CVS->cvsRoot().'/'.$where);
        checkError($fl->getBrowseInfo());
  
!       if (!isset($rev))
        {
                $rev='1.1';
        }
  
!       if (!CVSLib_Rev::valid($rev))
        {
                //fatal('404 Not Found',"Revision $rev not found");
--- 17,33 ----
        include('./config/conf.php');
  
+       $_rev = CreateObject('chora.cvslib_rev');
+ 
        /* Spawn the file object */
!       $fl = CreateObject('chora.cvslib_file', $CVS, $CVS->cvsRoot() . '/' . 
$where);
! 
        checkError($fl->getBrowseInfo());
  
!       if(!isset($rev))
        {
                $rev='1.1';
        }
  
!       if(!$_rev->valid($rev))
        {
                //fatal('404 Not Found',"Revision $rev not found");
***************
*** 34,38 ****
        }
  
!       $ann = new CVSLib_Annotate($CVS, $fl);
        checkError($lines = $ann->doAnnotate($rev));
  
--- 37,41 ----
        }
  
!       $ann = CreateObject('chora.cvslib_annotate', $CVS, $fl);
        checkError($lines = $ann->doAnnotate($rev));
  

Index: checkout.php
===================================================================
RCS file: /cvsroot/phpgroupware/chora/checkout.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** checkout.php        20 Sep 2001 21:50:06 -0000      1.5
--- checkout.php        28 Apr 2002 19:26:40 -0000      1.6
***************
*** 20,24 ****
        include('./config/conf.php');
  
!       if (!isset($r))
        {
                $r = 0;
--- 20,24 ----
        include('./config/conf.php');
  
!       if(!isset($r))
        {
                $r = 0;
***************
*** 34,38 ****
        /* Is this a valid revision being requested? */
  
!       if (!CVSLib_rev::valid($r))
        {
                fatal('404 Not Found', "Revision Not Found: $r is not a valid 
RCS revision number");
--- 34,39 ----
        /* Is this a valid revision being requested? */
  
!       $_rev = CreateObject('chora.cvslib_rev');
!       if(!$_rev->valid($r))
        {
                fatal('404 Not Found', "Revision Not Found: $r is not a valid 
RCS revision number");
***************
*** 41,45 ****
        /* Retrieve the actual checkout */
  
!       $checkOut = CVSLib_Checkout::get($CVS, $fullname, $r);
  
        /* Check error status, and either show error page, or the checkout 
contents */
--- 42,47 ----
        /* Retrieve the actual checkout */
  
!       $co = CreateObject('chora.cvslib_checkout');
!       $checkOut = $co->get($CVS, $fullname, $r);
  
        /* Check error status, and either show error page, or the checkout 
contents */

Index: cvs.php
===================================================================
RCS file: /cvsroot/phpgroupware/chora/cvs.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** cvs.php     20 Jan 2002 22:10:44 -0000      1.12
--- cvs.php     28 Apr 2002 19:26:40 -0000      1.13
***************
*** 135,139 ****
        elseif (@is_file($fullname . ',v'))
        {
!               $fl = new CVSLib_File($CVS, $fullname, CVSLIB_LOG_FULL);
                checkError($fl->getBrowseInfo());
  
--- 135,139 ----
        elseif (@is_file($fullname . ',v'))
        {
!               $fl = CreateObject('chora.cvslib_file', $CVS, $fullname, 
CVSLIB_LOG_FULL);
                checkError($fl->getBrowseInfo());
  

Index: diff.php
===================================================================
RCS file: /cvsroot/phpgroupware/chora/diff.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** diff.php    20 Jan 2002 22:16:40 -0000      1.7
--- diff.php    28 Apr 2002 19:26:40 -0000      1.8
***************
*** 38,42 ****
  
        /* Spawn the repository and file objects */
!       $fl = new CVSLib_File($CVS, $CVS->cvsRoot().'/'.$where);
        checkError($fl->getBrowseInfo());
  
--- 38,46 ----
  
        /* Spawn the repository and file objects */
!       $fl = CreateObject(
!               'chora.cvslib_file',
!               $CVS,
!               $CVS->cvsRoot() . '/' . $where
!       );
        checkError($fl->getBrowseInfo());
  
***************
*** 90,109 ****
  
        /* Ensure that we have valid revision numbers */
!       if (!CVSLib_Rev::valid($r1) || !CVSLib_Rev::valid($r2))
        {
!               checkError(new CVSLib_Error(CVSLIB_NOT_FOUND, 'Malformed 
Query'));
        }
- 
        /* All is ok, proceed with the diff */
-       /* A plain-text diff */
        elseif ($f != 'h')
        {
                header("Content-Type: text/plain\n\n");
!               echo implode("\n",CVSLib_Diff::get($CVS, $fl, $r1, $r2, $type));
! 
!               /* Human-Readable diff */
        }
        else
        {
                /* Output standard header information for the page */
                $filename = preg_replace('/^.*\//', '', $where);
--- 94,113 ----
  
        /* Ensure that we have valid revision numbers */
!       $_rev = CreateObject('chora.cvslib_rev');
!       if (!$_rev->valid($r1) || !$_rev->valid($r2))
        {
!               checkError(CreateObject('chora.cvslib_error',CVSLIB_NOT_FOUND, 
'Malformed Query'));
        }
        /* All is ok, proceed with the diff */
        elseif ($f != 'h')
        {
+               /* A plain-text diff */
                header("Content-Type: text/plain\n\n");
!               $diffa = CreateObject('chora.cvslib_diff');
!               echo implode("\n",$diffa->get($CVS, $fl, $r1, $r2, $type));
        }
        else
        {
+               /* Human-Readable diff */
                /* Output standard header information for the page */
                $filename = preg_replace('/^.*\//', '', $where);
***************
*** 115,120 ****
  
                /* Retrieve the tree of changes from CVSLib */
!               $lns = CVSLib_Diff::humanReadable(
!               CVSLib_Diff::get($CVS, $fl, $r1, $r2, CVSLIB_DIFF_UNIFIED));
                /* TODO: check for errors here (CVSLib_Error returned) - avsm */
                /* Is the diff empty? */
--- 119,128 ----
  
                /* Retrieve the tree of changes from CVSLib */
!               $diffa = CreateObject('chora.cvslib_diff');
!               $lns = $diffa->humanReadable(
!                       $diffa->get(
!                               $CVS, $fl, $r1, $r2, CVSLIB_DIFF_UNIFIED
!                       )
!               );
                /* TODO: check for errors here (CVSLib_Error returned) - avsm */
                /* Is the diff empty? */

Index: history.php
===================================================================
RCS file: /cvsroot/phpgroupware/chora/history.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** history.php 20 Sep 2001 21:50:06 -0000      1.4
--- history.php 28 Apr 2002 19:26:40 -0000      1.5
***************
*** 1,4 ****
  <?php
- 
  /*
   * $Horde: chora/history.php,v 1.7 2001/02/27 07:06:00 avsm Exp $
--- 1,3 ----
***************
*** 19,27 ****
        include('./config/conf.php');
  
! //    require_once dirname(__FILE__).'/common.php';
  
        /* Spawn the file object */
! 
!       $fl = new CVSLib_File($CVS, $CVS->cvsRoot().'/'.$where);
        checkError($fl->getBrowseInfo());
  
--- 18,25 ----
        include('./config/conf.php');
  
!       $_rev = CreateObject('chora.cvslib_rev');
  
        /* Spawn the file object */
!       $fl = CreateObject('chora.cvslib_file', $CVS, $CVS->cvsRoot() . '/' . 
$where);
        checkError($fl->getBrowseInfo());
  
***************
*** 50,59 ****
        {
                $rev = $log->queryRevision();
!               $baseRev = CVSLib_Rev::strip($rev, 1);
                $branchFound = false;
                @reset($fl->branches);
                while(list($branch,$name) = @each($fl->branches))
                {
!                       if ($branch == $baseRev)
                        {
                                array_unshift($branches[$branch], $rev);
--- 48,57 ----
        {
                $rev = $log->queryRevision();
!               $baseRev = $_rev->strip($rev, 1);
                $branchFound = false;
                @reset($fl->branches);
                while(list($branch,$name) = @each($fl->branches))
                {
!                       if($branch == $baseRev)
                        {
                                array_unshift($branches[$branch], $rev);
***************
*** 63,67 ****
                /* If its not a branch, then add it to the trunk */
                /* TODO: this silently drops vendor branches atm! - avsm */
!               if (!$branchFound && CVSLib_Rev::sizeof($rev) == 2)
                {
                        array_unshift($trunk, $rev);
--- 61,65 ----
                /* If its not a branch, then add it to the trunk */
                /* TODO: this silently drops vendor branches atm! - avsm */
!               if (!$branchFound && $_rev->sizeof($rev) == 2)
                {
                        array_unshift($trunk, $rev);
***************
*** 86,90 ****
        while(list($brrev,$brcont) = @each($branches))
        {
!               if (!sizeof($colStack))
                {
                        $colStack = $colset;
--- 84,88 ----
        while(list($brrev,$brcont) = @each($branches))
        {
!               if(!sizeof($colStack))
                {
                        $colStack = $colset;
***************
*** 102,172 ****
        function populateGrid($row, $col)
        {
!       global $grid, $branches;
  
!           /* Figure out the starting revision this function uses */
!           $rev = $grid[$row][$col];
  
!           /* For every branch that is known, try to see if it forks here */
!           $brkeys = array_keys($branches);
  
!           /* NOTE: do not optimise to use foreach() or each() here, as
!            * that really screws up the $branches pointer array due to the
!            * recursion, and parallel branches fail - avsm */
! 
!           for ($a=0; $a<sizeof($brkeys); $a++)
!               {
!              $brrev = $brkeys[$a];
!              $brcont = $branches[$brrev]; 
!               /* Check to see if current point matches a branch point */
!               if (!strcmp($rev, CVSLib_Rev::strip($brrev,1)))
!                       {
!                   /* If it does, figure out how many rows we have to add */
!                   $numRows = sizeof($brcont);
!                   /* Check rows in columns to the right, until one is free */
!                   $insCol = $col+1;
!                   while (1)
                                {
!                       /* Look in the current column for a set value */
!                       $inc = false;
!                       for ($i=$row; $i <=($row + $numRows); $i++)
                                        {
!                           if (isset($grid[$i][$insCol]))
                                                {
!                               $inc = true;
!                           }
!                       }
!                       /* If a set value was found, shift to the right and 
!                        * try again.  Otherwise, break out of the loop */
!             
!                       if ($inc)
                                        {
!                           if (!isset($grid[$row][$insCol]))
                                                {
!                               $grid[$row][$insCol] = ':'.$brcont[0];
!                           }
!                           $insCol++; 
!                       }
                                        else
                                        {
                                                break;
                                        }
!                   }
  
!                   /* Put a fork marker in the top of the branch */
!               $grid[$row][$insCol] = $brrev;
  
!                   /* Populate the grid with the branch values at this point */
!                   for ($i=0; $i < $numRows; $i++)
                                {
!                      $grid[1+$i+$row][$insCol] = $brcont[$i];
!                   }
!                   /* For each value just set, check for sub-branches,
!                    * - but in reverse (VERY IMPORTANT!) */
!                   for ($i=$numRows-1; $i >= 0 ; $i--)
                                {
!                      populateGrid(1+$i+$row, $insCol);
!                   }
!               }
!           }
        }
  
--- 100,170 ----
        function populateGrid($row, $col)
        {
!               global $grid, $branches;
  
!               /* Figure out the starting revision this function uses */
!               $rev = $grid[$row][$col];
  
!               /* For every branch that is known, try to see if it forks here 
*/
!               $brkeys = array_keys($branches);
  
!               /* NOTE: do not optimise to use foreach() or each() here, as
!               * that really screws up the $branches pointer array due to the
!               * recursion, and parallel branches fail - avsm */
! 
!               for($a=0; $a<sizeof($brkeys); $a++)
!               {
!                       $brrev = $brkeys[$a];
!                       $brcont = $branches[$brrev]; 
!                       /* Check to see if current point matches a branch point 
*/
!                       if(!strcmp($rev, $_rev->strip($brrev,1)))
!                       {
!                               /* If it does, figure out how many rows we have 
to add */
!                               $numRows = sizeof($brcont);
!                               /* Check rows in columns to the right, until 
one is free */
!                               $insCol = $col+1;
!                               while(1)
                                {
!                                       /* Look in the current column for a set 
value */
!                                       $inc = False;
!                                       for($i=$row; $i <=($row + $numRows); 
$i++)
                                        {
!                                               if(isset($grid[$i][$insCol]))
                                                {
!                                                       $inc = true;
!                                               }
!                                       }
!                                       /* If a set value was found, shift to 
the right and 
!                                       * try again.  Otherwise, break out of 
the loop */
! 
!                                       if ($inc)
                                        {
!                                               if 
(!isset($grid[$row][$insCol]))
                                                {
!                                                       $grid[$row][$insCol] = 
':'.$brcont[0];
!                                               }
!                                               $insCol++; 
!                                       }
                                        else
                                        {
                                                break;
                                        }
!                               }
  
!                               /* Put a fork marker in the top of the branch */
!                               $grid[$row][$insCol] = $brrev;
  
!                               /* Populate the grid with the branch values at 
this point */
!                               for ($i=0; $i < $numRows; $i++)
                                {
!                                       $grid[1+$i+$row][$insCol] = $brcont[$i];
!                               }
!                               /* For each value just set, check for 
sub-branches,
!                               * - but in reverse (VERY IMPORTANT!) */
!                               for ($i=$numRows-1; $i >= 0 ; $i--)
                                {
!                                       populateGrid(1+$i+$row, $insCol);
!                               }
!                       }
!               }
        }
  
***************
*** 174,180 ****
         * go down, there can never be one above 1.1, and so this is a
         * safe location to start.  We will then work our way up,
!        * recursively populating the grid with branch revisions */
! 
!       for ($row = sizeof($trunk)-1; $row >= 0; $row--)
        {
                $grid[$row][0] = $trunk[$row];
--- 172,178 ----
         * go down, there can never be one above 1.1, and so this is a
         * safe location to start.  We will then work our way up,
!        * recursively populating the grid with branch revisions
!        */
!       for($row = sizeof($trunk)-1; $row >= 0; $row--)
        {
                $grid[$row][0] = $trunk[$row];
***************
*** 219,223 ****
                        $rev = $row[$i];
  
!                       if (CVSLib_Rev::valid($rev) && 
(CVSlib_Rev::sizeof($rev) % 2))
                        {
                                /* This is a branch point, so put the info out 
*/
--- 217,221 ----
                        $rev = $row[$i];
  
!                       if($_rev->valid($rev) && ($_rev->sizeof($rev) % 2))
                        {
                                /* This is a branch point, so put the info out 
*/
***************
*** 226,240 ****
                                include 
$conf['paths']['templates'].'/history_branch_cell.inc';
                        }
!                       elseif (preg_match('|^:|',$rev))
                        {
                                /* This is a continuation cell, so render it 
with the branch colour */
!                               $bgbr = 
CVSLib_Rev::strip(preg_replace('|^\:|','',$rev),1);
                                $bg = 
isset($branchColours[$bgbr])?$branchColours[$bgbr]:'white';
                                include 
$conf['paths']['templates'].'/history_blank.inc';
                        }
!                       elseif (CVSLib_Rev::valid($rev))
                        {
                                /* This cell contains a revision, so render it 
*/
!                               $bgbr = CVSLib_Rev::strip($rev,1);
                                $bg = 
isset($branchColours[$bgbr])?$branchColours[$bgbr]:'white';
                                $log = $fl->logs[$rev]; 
--- 224,238 ----
                                include 
$conf['paths']['templates'].'/history_branch_cell.inc';
                        }
!                       elseif(preg_match('|^:|',$rev))
                        {
                                /* This is a continuation cell, so render it 
with the branch colour */
!                               $bgbr = 
$_rev->strip(preg_replace('|^\:|','',$rev),1);
                                $bg = 
isset($branchColours[$bgbr])?$branchColours[$bgbr]:'white';
                                include 
$conf['paths']['templates'].'/history_blank.inc';
                        }
!                       elseif($_rev->valid($rev))
                        {
                                /* This cell contains a revision, so render it 
*/
!                               $bgbr = $_rev->strip($rev,1);
                                $bg = 
isset($branchColours[$bgbr])?$branchColours[$bgbr]:'white';
                                $log = $fl->logs[$rev]; 
***************
*** 256,258 ****
        //include $conf['paths']['templates'].'/page_footer.inc';
        $GLOBALS['phpgw']->common->phpgw_footer();
! 
--- 254,256 ----
        //include $conf['paths']['templates'].'/page_footer.inc';
        $GLOBALS['phpgw']->common->phpgw_footer();
! ?>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]