[ class tree: VersionControl_SVN ] [ index: VersionControl_SVN ] [ all elements ]

Class: VersionControl_SVN_Command_Status

Source Location: /VersionControl_SVN-0.5.2/VersionControl/SVN/Command/Status.php

Class Overview


Subversion Status command manager class



  • 0.5.2


  • 2004-2007 Clay Loveless



Inherited Variables

Inherited Methods

Class: VersionControl_SVN_Command

Constructor. Can't be called directly as class is abstract.
Standardized validation of requirements for a command class.
Fills the switches array on given name with value if not already set and value is not null.
Handles output parsing of standard and verbose output of command.
Called after handling switches.
Prepare the command switches.
Called before handling switches.
Run the command with the defined switches.
Allow for overriding of previously declared options.

Class Details

[line 188]
Subversion Status command manager class

Print the status of working copy files and directories.

There are many possible output values from this command. The following is from 'svn help status':

With no args, print only locally modified items (no network access). With -u, add working revision and server out-of-date information. With -v, print full revision information on every item.

The first five columns in the output are each one character wide: First column: Says if item was added, deleted, or otherwise changed ' ' no modifications 'A' Added 'C' Conflicted 'D' Deleted 'G' Merged 'I' Ignored 'M' Modified 'R' Replaced 'X' item is unversioned, but is used by an externals definition '?' item is not under version control '!' item is missing (removed by non-svn command) or incomplete '~' versioned item obstructed by some item of a different kind Second column: Modifications of a file's or directory's properties ' ' no modifications 'C' Conflicted 'M' Modified Third column: Whether the working copy directory is locked ' ' not locked 'L' locked Fourth column: Scheduled commit will contain addition-with-history ' ' no history scheduled with commit '+' history scheduled with commit Fifth column: Whether the item is switched relative to its parent ' ' normal 'S' switched

The out-of-date information appears in the eighth column (with -u): '*' a newer revision exists on the server ' ' the working copy is up to date

Remaining fields are variable width and delimited by spaces: The working revision (with -u or -v) The last committed revision and last committed author (with -v) The working copy path is always the final field, so it can include spaces.

Example output: svn status wc M wc/bar.c A + wc/qax.c

svn status -u wc M 965 wc/bar.c * 965 wc/foo.c A + 965 wc/qax.c Head revision: 981

svn status --show-updates --verbose wc M 965 938 kfogel wc/bar.c * 965 922 sussman wc/foo.c A + 965 687 joe wc/qax.c 965 687 joe wc/zig.c Head revision: 981

$switches is an array containing one or more command line options defined by the following associative keys:

  1.  $switches = array(
  2.   'u'             =>  true|false,
  3.                       // display update information
  4.   'show-updates'  =>  true|false,
  5.                       // display update information
  6.   'v [verbose]'   =>  true|false,
  7.                       // prints extra information
  8.   'N'             =>  true|false,
  9.                       // operate on a single directory only
  10.   'non-recursive' =>  true|false,
  11.                       // operate on a single directory only
  12.   'q [quiet]'     =>  true|false,
  13.                       // prints as little as possible
  14.   'no-ignore'     =>  true|false,
  15.                       // disregard default and svn:ignore property ignores
  16.   'username'      =>  'Subversion repository login',
  17.   'password'      =>  'Subversion repository password',
  18.   'no-auth-cache' =>  true|false,
  19.                       // Do not cache authentication tokens
  20.   'config-dir'    =>  'Path to a Subversion configuration directory',
  21.   'changelist     =>  'Changelist to operate on'
  22.  );

Note: Subversion does not offer an XML output option for this subcommand

The non-interactive option available on the command-line svn client may also be set (true|false), but it is set to true by default.

Usage example:

  1.  <?php
  2.  require_once 'VersionControl/SVN.php';
  4.  // Set up runtime options. Will be passed to all
  5.  // subclasses.
  6.  $options = array('fetchmode' => VERSIONCONTROL_SVN_FETCHMODE_RAW);
  8.  // Pass array of subcommands we need to factory
  9.  $svn VersionControl_SVN::factory(array('status')$options);
  11.  // Define any switches and aguments we may need
  12.  $switches = array('u' => true'v' => true);
  13.  $args = array('/path/to/working/copy/TestProj/trunk');
  15.  // Run command
  16.  try {
  17.      print_r($svn->status->run($args$switches));
  18.  catch (VersionControl_SVN_Exception $e{
  19.      print_r($e->getMessage());
  20.  }
  21.  ?>

[ Top ]

Class Variables

$xmlAvail =  true

[line 195]

Keep track of whether XML output is available for a command
  • Access: protected

Type:   boolean
Overrides:   Array

[ Top ]

Method Detail

__construct (Constructor)   [line 200]

VersionControl_SVN_Command_Status __construct( )

Constuctor of command. Adds available switches.
  • Access: public

Overrides VersionControl_SVN_Command::__construct() (Constructor. Can't be called directly as class is abstract.)
[ Top ]

Documentation generated on Mon, 11 Mar 2019 15:58:57 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.