Class VC_Revision

Description

VC revisions class.

Copyright Anil Madhavapeddy, <anil@recoil.org>

Located in /VC/VC.php (line 338)


	
			
Method Summary
 integer cmp (string $rev1, string $rev2)
 string|boolean prev (string $rev)
 integer sizeof (string $val)
 string strip (string $val, [integer $amount = 1])
 boolean valid (string $val)
Methods
cmp (line 404)

Given two 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 of the two is returned.

  • return: 1 if the first is greater, -1 if the second if greater, and 0 if they are equal
integer cmp (string $rev1, string $rev2)
  • string $rev1: Period delimited revision number
  • string $rev2: Second period delimited revision number
prev (line 420)

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 original branch point.

  • return: Revision number, or false if none could be determined.
string|boolean prev (string $rev)
  • string $rev: Revision number to decrement.
sizeof (line 383)

The size of a revision number is the number of portions it has.

For example, 1,2.3.4 is of size 4.

  • return: Size of revision number
integer sizeof (string $val)
  • string $val: Revision number to determine size of
strip (line 363)

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.

  • return: Stripped revision number
string strip (string $val, [integer $amount = 1])
  • string $val: Input revision
  • integer $amount: Number of portions to strip
valid (line 348)

Validation function to ensure that a revision number is of the right form.

  • return: True if it is a revision number
boolean valid (string $val)
  • string $val: Value to check.

Documentation generated on Sun, 30 Jan 2011 05:23:09 +0000 by phpDocumentor 1.4.3