[dev] [PATCH] adding foldmarkers in SVNLib
Roman Neuhauser
neuhauser at bellavista.cz
Sun Oct 12 04:15:41 PDT 2003
# neuhauser at bellavista.cz / 2003-10-11 21:22:11 +0200:
> The attached patch adds foldmarkers around methods of SVNlib* classes.
This is a similar patch for CVSLib*.
--
If you cc me or remove the list(s) completely I'll most likely ignore
your message. see http://www.eyrie.org./~eagle/faqs/questions.html
-------------- next part --------------
Index: lib/CVSLib.php
===================================================================
RCS file: /repository/chora/lib/CVSLib.php,v
retrieving revision 1.90
diff -u -r1.90 CVSLib.php
--- lib/CVSLib.php 29 Aug 2003 16:43:23 -0000 1.90
+++ lib/CVSLib.php 12 Oct 2003 11:07:19 -0000
@@ -18,7 +18,7 @@
var $cvsusers = null;
- /**
+ /** sourceroot() {{{
* Return the CVSROOT for this repository, with no trailing /
*
* @return string CVSROOT for this repository.
@@ -27,38 +27,57 @@
{
return $GLOBALS['conf']['paths']['sourceroot'];
}
+ /* }}} */
+ /* &isFile() {{{
+ */
function &isFile($where)
{
return @is_file($where . ',v');
}
+ /* }}} */
+ /* &queryDir() {{{
+ */
function &queryDir($where)
{
return new CVSLib_Directory($this, $where);
}
+ /* }}} */
+ /* &getCheckout() {{{
+ */
function &getCheckout($file, $rev)
{
return CVSLib_Checkout::get($file->queryFullPath(), $rev);
}
+ /* }}} */
+ /* &getDiff() {{{
+ */
function &getDiff(&$file, $rev1, $rev2, $type = CVSLIB_DIFF_CONTEXT, $num = 3, $ws = true)
{
return CVSLib_Diff::get($file, $rev1, $rev2, $type, $num, $ws);
}
+ /* }}} */
+ /* &getFileObject() {{{
+ */
function &getFileObject($filename, $flags = CVSLIB_LOG_FULL)
{
return CVSLib_File::getFileObject($this, $this->sourceroot() . '/' . $filename, $flags);
}
+ /* }}} */
+ /* &getPatchsetObject() {{{
+ */
function &getPatchsetObject($filename)
{
return CVSLib_Patchset::getPatchsetObject($this, $this->sourceroot() . '/' . $filename);
}
+ /* }}} */
- /**
+ /** parseCVSUsers() {{{
* Parse the 'cvsusers' file, if present in the CVSROOT, and
* return a hash containing the requisite information, keyed on
* the username, and with the 'desc','name', and 'mail' values
@@ -97,6 +116,7 @@
return true;
}
+ /* }}} */
}
Index: lib/CVSLib/Annotate.php
===================================================================
RCS file: /repository/chora/lib/CVSLib/Annotate.php,v
retrieving revision 1.20
diff -u -r1.20 Annotate.php
--- lib/CVSLib/Annotate.php 16 Sep 2003 23:04:06 -0000 1.20
+++ lib/CVSLib/Annotate.php 12 Oct 2003 11:07:19 -0000
@@ -20,12 +20,17 @@
var $rep;
var $tmpfile;
+ /* CVSLib_Annotate() {{{
+ */
function CVSLib_Annotate(&$rep, $file)
{
$this->rep = &$rep;
$this->file = &$file;
}
+ /* }}} */
+ /* doAnnotate() {{{
+ */
function doAnnotate($rev)
{
global $conf;
@@ -110,5 +115,6 @@
fclose($fl);
return $lines;
}
+ /* }}} */
}
Index: lib/CVSLib/Checkout.php
===================================================================
RCS file: /repository/chora/lib/CVSLib/Checkout.php,v
retrieving revision 1.23
diff -u -r1.23 Checkout.php
--- lib/CVSLib/Checkout.php 5 Sep 2003 01:09:35 -0000 1.23
+++ lib/CVSLib/Checkout.php 12 Oct 2003 11:07:19 -0000
@@ -16,7 +16,7 @@
*/
class CVSLib_Checkout {
- /**
+ /** get() {{{
* Static function which returns a file pointing to the head of the requested
* revision of an RCS file.
* @param fullname Fully qualified pathname of the desired RCS file to checkout
@@ -60,8 +60,9 @@
return $RCS;
}
+ /* }}} */
- /**
+ /** &pretty() {{{
* Pretty-print the checked out copy, using the
* Horde::Mime::Viewer package.
*
@@ -85,5 +86,6 @@
$mime = &new MIME_Part($mime_type, $lns);
return MIME_Viewer::factory($mime);
}
+ /* }}} */
}
Index: lib/CVSLib/Diff.php
===================================================================
RCS file: /repository/chora/lib/CVSLib/Diff.php,v
retrieving revision 1.29
diff -u -r1.29 Diff.php
--- lib/CVSLib/Diff.php 28 Aug 2003 04:04:27 -0000 1.29
+++ lib/CVSLib/Diff.php 12 Oct 2003 11:07:19 -0000
@@ -16,7 +16,7 @@
*/
class CVSLib_Diff {
- /**
+ /** get() {{{
* Obtain the differences between two revisions within a file.
*
* @param file CVSLib_File object for the desired file
@@ -73,8 +73,9 @@
exec($command, $diff, $retval);
return ($retval > 0) ? $diff : array();
}
+ /* }}} */
- /**
+ /** humanReadable() {{{
* Obtain a tree containing information about the changes between two
* revisions.
*
@@ -172,5 +173,6 @@
return $ret;
}
+ /* }}} */
}
Index: lib/CVSLib/Directory.php
===================================================================
RCS file: /repository/chora/lib/CVSLib/Directory.php,v
retrieving revision 1.26
diff -u -r1.26 Directory.php
--- lib/CVSLib/Directory.php 29 Aug 2003 16:43:24 -0000 1.26
+++ lib/CVSLib/Directory.php 12 Oct 2003 11:07:19 -0000
@@ -25,7 +25,7 @@
var $parent;
var $moduleName;
- /**
+ /** CVSLib_Directory() {{{
* Create a CVS Directory object to store information
* about the files in a single directory in the repository
*
@@ -41,8 +41,9 @@
$this->files = array();
$this->dirs = array();
}
+ /* }}} */
- /**
+ /** queryDir() {{{
* Return fully qualified pathname to this directory with no
* trailing /.
*
@@ -52,13 +53,19 @@
{
return $this->dirName;
}
+ /* }}} */
+ /* &queryDirList() {{{
+ */
function &queryDirList()
{
reset($this->dirs);
return $this->dirs;
}
+ /* }}} */
+ /* &queryFileList() {{{
+ */
function &queryFileList($flags = CVSLIB_ATTIC_HIDE)
{
if ($flags == CVSLIB_ATTIC_SHOW && isset($this->mergedFiles)) {
@@ -67,8 +74,9 @@
return $this->files;
}
}
+ /* }}} */
- /**
+ /** browseDir() {{{
* Tell the object to open and browse its current directory, and
* retrieve a list of all the objects in there. It then populates
* the file/directory stack and makes it available for retrieval.
@@ -126,8 +134,9 @@
return true;
}
+ /* }}} */
- /**
+ /** applySort() {{{
* Sort the contents of the directory in a given fashion and
* order.
*
@@ -156,7 +165,10 @@
}
}
}
+ /* }}} */
+ /* doFileSort() {{{
+ */
function doFileSort(&$fileList, $how = CVSLIB_SORT_NONE, $dir = CVSLIB_SORT_ASCENDING)
{
switch ($how) {
@@ -181,8 +193,9 @@
break;
}
}
+ /* }}} */
- /**
+ /** fileAgeSort() {{{
* Sort function for ascending age.
*/
function fileAgeSort($a, $b)
@@ -195,8 +208,9 @@
return ($aa->queryDate() < $bb->queryDate()) ? 1 : -1;
}
}
+ /* }}} */
- /**
+ /** fileAuthorSort() {{{
* Sort function by author name.
*/
function fileAuthorSort($a, $b)
@@ -209,21 +223,24 @@
return ($aa->queryAuthor() > $bb->queryAuthor()) ? 1 : -1;
}
}
+ /* }}} */
- /**
+ /** fileNameSort() {{{
* Sort function for ascending filename.
*/
function fileNameSort($a, $b)
{
return strcasecmp($a->name, $b->name);
}
+ /* }}} */
- /**
+ /** fileRevSort() {{{
* Sort function for ascending revision.
*/
function fileRevSort($a, $b)
{
return CVSLib_Rev::cmp($a->queryHead(), $b->queryHead());
}
+ /* }}} */
}
Index: lib/CVSLib/File.php
===================================================================
RCS file: /repository/chora/lib/CVSLib/File.php,v
retrieving revision 1.44
diff -u -r1.44 File.php
--- lib/CVSLib/File.php 25 Sep 2003 22:11:41 -0000 1.44
+++ lib/CVSLib/File.php 12 Oct 2003 11:07:20 -0000
@@ -27,7 +27,7 @@
var $revsym;
var $branches;
- /**
+ /** CVSLib_File() {{{
* Create a repository file object, and give it information about
* what its parent directory and repository objects are.
*
@@ -44,7 +44,10 @@
$this->revs = array();
$this->branches = array();
}
+ /* }}} */
+ /* &getFileObject() {{{
+ */
function &getFileObject(&$rep, $filename, $flags = CVSLIB_LOG_FULL)
{
/**
@@ -70,7 +73,10 @@
$fileOb->rep = &$rep;
return $fileOb;
}
+ /* }}} */
+ /* &_getFileObject() {{{
+ */
function &_getFileObject($filename, $flags = CVSLIB_LOG_FULL)
{
$fileOb = &new CVSLib_File($filename, $flags);
@@ -78,8 +84,9 @@
$fileOb->applySort(CVSLIB_SORT_AGE);
return $fileOb;
}
+ /* }}} */
- /**
+ /** isAtticFile() {{{
* If this file is present in an Attic directory, this indicates
* it.
*
@@ -89,8 +96,9 @@
{
return substr($this->dir, -5) == 'Attic';
}
+ /* }}} */
- /**
+ /** queryRepositoryName() {{{
* Returns the name of the current file as in the repository
*
* @return Filename (without the path)
@@ -99,8 +107,9 @@
{
return $this->name;
}
+ /* }}} */
- /**
+ /** queryName() {{{
* Returns name of the current file without the repository
* extensions (usually ,v)
*
@@ -110,8 +119,9 @@
{
return preg_replace('/,v$/', '', $this->name);
}
+ /* }}} */
- /**
+ /** queryRevision() {{{
* Return the last revision of the current file on the HEAD branch
*
* @return Last revision of the current file
@@ -123,13 +133,17 @@
}
return $this->revs[0];
}
+ /* }}} */
+ /* queryPreviousRevision() {{{
+ */
function queryPreviousRevision($rev)
{
return CVSLib_Rev::prev($rev);
}
+ /* }}} */
- /**
+ /** queryHead() {{{
* Return the HEAD (most recent) revision number for this file.
*
* @return HEAD revision number
@@ -138,8 +152,9 @@
{
return $this->head;
}
+ /* }}} */
- /**
+ /** queryLastLog() {{{
* Return the last CVSLib_Log object in the file.
*
* @return CVSLib_Log of the last entry in the file
@@ -151,8 +166,9 @@
}
return $this->logs[$this->revs[0]];
}
+ /* }}} */
- /**
+ /** applySort() {{{
* Sort the list of CVSLib_Log objects that this file contains.
*
* @param how CVSLIB_SORT_REV (sort by revision),
@@ -177,26 +193,34 @@
uasort($this->logs, array($this, "sortBy$func"));
return true;
}
+ /* }}} */
- /**
+ /** sortByRevision() {{{
* The sortBy*() functions are internally used by applySort.
*/
function sortByRevision($a, $b)
{
return CVSLib_Rev::cmp($b->rev, $a->rev);
}
+ /* }}} */
+ /* sortByAge() {{{
+ */
function sortByAge($a, $b)
{
return $b->date - $a->date;
}
+ /* }}} */
+ /* sortByName() {{{
+ */
function sortByName($a, $b)
{
return strcmp($a->author, $b->author);
}
+ /* }}} */
- /**
+ /** getBrowseInfo() {{{
* Populate the object with information about the revisions logs
* and dates of the file.
*
@@ -273,8 +297,9 @@
return true;
}
+ /* }}} */
- /**
+ /** readableTime() {{{
* Return a text description of how long its been since the file
* has been last modified.
*
@@ -325,8 +350,9 @@
return $retval;
}
+ /* }}} */
- /**
+ /** queryFullPath() {{{
* Return the fully qualified filename of this object.
*
* @return Fully qualified filename of this object
@@ -335,8 +361,9 @@
{
return $this->dir . DIRECTORY_SEPARATOR . $this->name;
}
+ /* }}} */
- /**
+ /** queryModulePath() {{{
* Return the name of this file relative to its sourceroot.
*
* @return string Pathname relative to the sourceroot.
@@ -345,8 +372,9 @@
{
return preg_replace('|^'. $this->rep->sourceroot() . '/?(.*),v$|', '\1', $this->queryFullPath());
}
+ /* }}} */
- /**
+ /** getExtension() {{{
* Static utility function to return the extension of a filename.
*
* @param string $fullname Fully qualified path of file
@@ -361,5 +389,6 @@
$filename = basename($fullname);
return ($pos = strrpos($filename, '.')) ? substr($filename, ++$pos) : '';
}
+ /* }}} */
}
Index: lib/CVSLib/Log.php
===================================================================
RCS file: /repository/chora/lib/CVSLib/Log.php,v
retrieving revision 1.15
diff -u -r1.15 Log.php
--- lib/CVSLib/Log.php 11 Feb 2003 20:58:06 -0000 1.15
+++ lib/CVSLib/Log.php 12 Oct 2003 11:07:20 -0000
@@ -17,7 +17,7 @@
var $rep, $file, $tags, $rev, $date, $log, $author, $state, $lines, $branches;
- /**
+ /** CVSLib_Log() {{{
*
*/
function CVSLib_Log(&$fl)
@@ -25,7 +25,10 @@
$this->file = &$fl;
$this->branches = array();
}
+ /* }}} */
+ /* processLog() {{{
+ */
function processLog($raw)
{
/* Initialise a simple state machine to parse the output of rlog */
@@ -88,33 +91,49 @@
$this->tags = array();
}
}
+ /* }}} */
+ /* queryDate() {{{
+ */
function queryDate()
{
return $this->date;
}
+ /* }}} */
+ /* queryRevision() {{{
+ */
function queryRevision()
{
return $this->rev;
}
+ /* }}} */
+ /* queryAuthor() {{{
+ */
function queryAuthor()
{
return $this->author;
}
+ /* }}} */
+ /* queryLog() {{{
+ */
function queryLog()
{
return $this->log;
}
+ /* }}} */
+ /* queryChangedLines() {{{
+ */
function queryChangedLines()
{
return isset($this->lines) ? ($this->lines) : '';
}
+ /* }}} */
- /**
+ /** querySymbolicBranches() {{{
* Given a branch revision number, this function remaps it
* accordingly, and performs a lookup on the file object to
* return the symbolic name(s) of that branch in the tree.
@@ -136,5 +155,6 @@
}
return $symBranches;
}
+ /* }}} */
}
Index: lib/CVSLib/Patchset.php
===================================================================
RCS file: /repository/chora/lib/CVSLib/Patchset.php,v
retrieving revision 1.7
diff -u -r1.7 Patchset.php
--- lib/CVSLib/Patchset.php 25 Sep 2003 22:11:41 -0000 1.7
+++ lib/CVSLib/Patchset.php 12 Oct 2003 11:07:20 -0000
@@ -20,7 +20,7 @@
var $_name;
var $_patchsets = array();
- /**
+ /** CVSLib_Patchset() {{{
* Create a patchset object.
*
* @param string $file The filename to get patchsets for.
@@ -30,7 +30,10 @@
$this->_name = basename($file);
$this->_dir = dirname($file);
}
+ /* }}} */
+ /* &getPatchsetObject() {{{
+ */
function &getPatchsetObject(&$rep, $filename)
{
/**
@@ -55,15 +58,19 @@
time() - @filemtime($filename . ',v')));
return $psOb;
}
+ /* }}} */
+ /* &_getPatchsetObject() {{{
+ */
function &_getPatchsetObject($filename, $repository)
{
$psOb = &new CVSLib_Patchset($filename);
Chora::checkError($psOb->getPatchsets($repository));
return $psOb;
}
+ /* }}} */
- /**
+ /** getPatchsets() {{{
* Populate the object with information about the patchsets that
* this file is involved in.
*
@@ -159,8 +166,9 @@
return true;
}
+ /* }}} */
- /**
+ /** getFullPath() {{{
* Return the fully qualified filename of this object.
*
* @return Fully qualified filename of this object
@@ -169,5 +177,6 @@
{
return $this->_dir . DIRECTORY_SEPARATOR . $this->_name;
}
+ /* }}} */
}
Index: lib/CVSLib/Rev.php
===================================================================
RCS file: /repository/chora/lib/CVSLib/Rev.php,v
retrieving revision 1.10
diff -u -r1.10 Rev.php
--- lib/CVSLib/Rev.php 15 Sep 2002 04:22:31 -0000 1.10
+++ lib/CVSLib/Rev.php 12 Oct 2003 11:07:20 -0000
@@ -16,7 +16,7 @@
*/
class CVSLib_Rev {
- /**
+ /** valid() {{{
* Validation function to ensure that a revision number is of the
* right form.
*
@@ -28,8 +28,9 @@
{
return $val && preg_match('/^[\d\.]+$/' , $val);
}
+ /* }}} */
- /**
+ /** strip() {{{
* Given a revision number, remove a given number of portions from
* it. For example, if we remove 2 portions of 1.2.3.4, we are
* left with 1.2.
@@ -50,8 +51,9 @@
}
return $pos !== false ? $val : false;
}
+ /* }}} */
- /**
+ /** sizeof() {{{
* The size of a revision number is the number of portions it has.
* For example, 1,2.3.4 is of size 4.
*
@@ -66,8 +68,9 @@
return (substr_count($val, '.') + 1);
}
+ /* }}} */
- /**
+ /** branchPoint() {{{
* Given a valid revision number, this will return the revision
* number from which it branched. If it cannot be determined, then
* false is returned.
@@ -91,8 +94,9 @@
/* Strip off two revision portions, and return it */
return CVSLib_Rev::strip($val, 2);
}
+ /* }}} */
- /**
+ /** cmp() {{{
* Given two CVS revision numbers, this figures out which one is
* greater than the other by stepping along the decimal points
* until a difference is found, at which point a sign comparison
@@ -108,8 +112,9 @@
{
return version_compare($rev1, $rev2);
}
+ /* }}} */
- /**
+ /** prev() {{{
* Return the logical revision before this one. Normally, this
* will be the revision minus one, but in the case of a new
* branch, we strip off the last two decimal places to return the
@@ -137,8 +142,9 @@
}
}
}
+ /* }}} */
- /**
+ /** toBranch() {{{
* Given a revision number of the form x.y.0.z, this remaps it
* into the appropriate branch number, which is x.y.z
*
@@ -164,5 +170,6 @@
return substr_replace($rev, '.', $end2, ($end-$end2+1));
}
+ /* }}} */
}
More information about the dev
mailing list