You are here

function _hacked_cvs_deploy_version_alter in Hacked! 6

1 call to _hacked_cvs_deploy_version_alter()
hacked_cvs_checkout_release in ./hacked.module

File

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

Code

function _hacked_cvs_deploy_version_alter(&$version, $file) {
  static $available = array();
  $match = array();
  if (empty($version)) {

    // The .info file contains no version data. Find the version based
    // on the sticky tag in the local workspace (the CVS/Tag file).
    $cvs_dir = dirname($file->filename) . '/CVS';
    if (is_dir($cvs_dir)) {
      $tag = '';

      // If there's no Tag file, there's no tag, a.k.a. HEAD.
      if (file_exists($cvs_dir . '/Tag')) {
        $tag_file = trim(file_get_contents($cvs_dir . '/Tag'));
        if ($tag_file) {

          // Get the sticky tag for this workspace: strip off the leading 'T'.
          $tag = preg_replace('@^(T|N)@', '', $tag_file);
        }
      }
      $version = $tag;
    }
  }
  elseif (preg_match('/\\$' . 'Name: (.*?)\\$/', $version, $match)) {
    $version = trim($match[1]);
  }
}