Class VersionControl_Hg

Description

Assumes to be working on a local filesystem repository

PHP version 5

Located in /Hg.php (line 43)


	
			
Class Constant Summary
 CUSTOM_EXECUTABLE = "custom"
 DEFAULT_EXECUTABLE = "default"
 ERROR_HG_NOT_FOUND = 'notFound'
Variable Summary
mixed $hg
array $messages
float $_version
Method Summary
void __construct ([string $path = null])
string getHgExecutable ()
string getVersion ()
string setHgExecutable (string $path)
array setVersion ()
string version ( $options)
mixed __call (string $method, array $arguments)
Variables
mixed $hg = null (line 70)

The Mercurial binary being used

There may well be multiple versions in use; lets track which one I am using so the user knows which one is being used.

It is labeled as $hg because this is the symbology adopted by the Mercurial project, since HG is the chemical symbol of the element: Mercury.

  • access: protected
array $messages = array(
'notFound' => 'Mercurial could not be found on this system',
)
(line 86)

Error messages for humans

  • access: protected
float $_version = null (line 77)

The version of the Mercurial executable.

  • access: protected
Methods
Constructor __construct (line 97)

Constructor

  • access: public
void __construct ([string $path = null])
  • string $path: is the path to a mercurial repo (optional)
getHgExecutable (line 248)

Get the full path of the currently used Mercurial executable

  • access: public
string getHgExecutable ()
getVersion (line 145)

Get the version of Mercurial we are currently using

  • access: public
string getVersion ()
setHgExecutable (line 181)

Set the Hg executable's path manually

If you need to specifiy a particular Hg executable to use, then pass in the full path to Mercurial as a paramter of this function.

It could have been passed into VersionControl_Hg's constructor, but I feel it is uncommon enough to pass in a custom Hg path that it could be relegated to a separate function call.

Usage:

  1.  $hg new VersionControl_Hg();
  2.  $hg->setHgExecutable('/path/to/your/mercurial/binary');

  • access: public
string setHgExecutable (string $path)
  • string $path: is the full path of the mercurial executable
setVersion (line 134)

Returns the version of the Mercurial executable.

Implements the version command of the command-line client. Possible values are: (version 1.1), (version 1.1+20081220), (version 1.1+e54ac289bed), (unknown)

array setVersion ()
version (line 118)

Proxy to setVersion; distinguish between accessor getVersion() and command 'version'

  • access: public
string version ( $options)
  • array $options: are the runtime switches for this command
__call (line 272)

Proxy down to the repository class

  • access: public
mixed __call (string $method, array $arguments)
  • string $method: is the function being called
  • array $arguments: are the parameters passed to that function
Class Constants
CUSTOM_EXECUTABLE = "custom" (line 53)

Use the executable specified by the user

DEFAULT_EXECUTABLE = "default" (line 48)

Use the executable found in the default installation location

ERROR_HG_NOT_FOUND = 'notFound' (line 58)

error constant for when the mercurial executable cannot be found

Documentation generated on Tue, 18 Aug 2009 23:53:18 -0600 by phpDocumentor 1.4.2