You are here

function hacked_cvs_checkout in Hacked! 7.2

Same name and namespace in other branches
  1. 6.2 hacked.module \hacked_cvs_checkout()
  2. 6 hacked.module \hacked_cvs_checkout()

Checks out a folder from CVS to a temporary directory.

Parameters

$cvsroot: The CVSROOT of the folder to check out.

$folder: The module to check out from CVS.

$checkout_location: The location in which to place the checkout.

$tag: The tag to checkout, defaults to 'HEAD'.

Return value

Either FALSE on failure or the location of the checked out files.

File

./hacked.module, line 323
The Hacked! module, shows which project have been changed since download.

Code

function hacked_cvs_checkout($cvsroot, $folder, $checkout_location, $checkout_folder, $tag = 'HEAD') {
  $cvs_cmd = hacked_cvs_get_command();
  $t = $checkout_location . '/' . $checkout_folder;
  file_prepare_directory($checkout_location, FILE_CREATE_DIRECTORY);
  file_prepare_directory($t, FILE_CREATE_DIRECTORY);
  exec("cd {$checkout_location}; {$cvs_cmd} -z6 -d{$cvsroot} -q checkout -d {$checkout_folder} -r {$tag} {$folder}", $output_lines, $return_value);
  if ($return_value == 0) {
    return $t;
  }
  return FALSE;
}