From 2b1a7419461adcc9bbb9ac885b6697c7260947ae Mon Sep 17 00:00:00 2001 From: Loic d'Anterroches Date: Thu, 2 Jul 2009 13:05:43 +0200 Subject: [PATCH] Fixed issue 245, ['idf_exec_cmd_prefix'] configuration variable is not available anymore. --- src/IDF/Scm/Git.php | 6 ++++++ src/IDF/Scm/Mercurial.php | 8 ++++++++ src/IDF/Scm/Svn.php | 15 +++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/src/IDF/Scm/Git.php b/src/IDF/Scm/Git.php index 4aed840..3442123 100644 --- a/src/IDF/Scm/Git.php +++ b/src/IDF/Scm/Git.php @@ -28,6 +28,7 @@ class IDF_Scm_Git extends IDF_Scm { public $mediumtree_fmt = 'commit %H%nAuthor: %an <%ae>%nTree: %T%nDate: %ai%n%n%s%n%n%b'; + public $date_fmt = /* ============================================== * * * @@ -228,6 +229,7 @@ class IDF_Scm_Git extends IDF_Scm escapeshellarg($this->repo), escapeshellarg($hash)); $ret = 0; $out = array(); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; exec($cmd, $out, $ret); if ($ret != 0) return false; return trim($out[0]); @@ -277,6 +279,7 @@ class IDF_Scm_Git extends IDF_Scm escapeshellarg($this->repo), escapeshellarg($commit)); $out = array(); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; exec($cmd, $out); foreach ($out as $line) { list($perm, $type, $hash, $size, $file) = preg_split('/ |\t/', $line, 5, PREG_SPLIT_NO_EMPTY); @@ -322,6 +325,7 @@ class IDF_Scm_Git extends IDF_Scm escapeshellarg($commit)); } $out = array(); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; exec($cmd, $out, $ret); if ($ret != 0 or count($out) == 0) { return false; @@ -357,6 +361,7 @@ class IDF_Scm_Git extends IDF_Scm "'commit %H%n'", escapeshellarg($commit)); $out = array(); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; exec($cmd, $out); $affected = count($out) - 2; $added = 0; @@ -389,6 +394,7 @@ class IDF_Scm_Git extends IDF_Scm escapeshellarg($this->repo), $n, $this->mediumtree_fmt, escapeshellarg($commit)); $out = array(); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; exec($cmd, $out); return self::parseLog($out, 4); } diff --git a/src/IDF/Scm/Mercurial.php b/src/IDF/Scm/Mercurial.php index e8c8da7..c371844 100644 --- a/src/IDF/Scm/Mercurial.php +++ b/src/IDF/Scm/Mercurial.php @@ -84,6 +84,7 @@ class IDF_Scm_Mercurial extends IDF_Scm $cmd = sprintf(Pluf::f('hg_path', 'hg').' log -R %s -r %s', escapeshellarg($this->repo), escapeshellarg($rev)); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; exec($cmd, $out, $ret); return ($ret == 0); } @@ -102,6 +103,7 @@ class IDF_Scm_Mercurial extends IDF_Scm escapeshellarg($hash)); $ret = 0; $out = array(); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; exec($cmd, $out, $ret); return ($ret != 0) ? false : 'commit'; } @@ -145,6 +147,7 @@ class IDF_Scm_Mercurial extends IDF_Scm $cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo), $tree, ($recurse) ? '' : ''); $out = array(); $res = array(); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; exec($cmd, $out); $tmp_hack = array(); while (null !== ($line = array_pop($out))) { @@ -191,6 +194,7 @@ class IDF_Scm_Mercurial extends IDF_Scm $cmd_tmpl = Pluf::f('hg_path', 'hg').' manifest -R %s --debug -r %s'; $cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo), $commit); $out = array(); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; exec($cmd, $out); $tmp_hack = array(); while (null !== ($line = array_pop($out))) { @@ -242,6 +246,7 @@ class IDF_Scm_Mercurial extends IDF_Scm escapeshellarg($this->repo), escapeshellarg($def->commit), escapeshellarg($this->repo.'/'.$def->file)); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; return ($cmd_only) ? $cmd : shell_exec($cmd); } @@ -256,6 +261,7 @@ class IDF_Scm_Mercurial extends IDF_Scm return $this->cache['branches']; } $out = array(); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; exec(sprintf(Pluf::f('hg_path', 'hg').' branches -R %s', escapeshellarg($this->repo)), $out); $res = array(); @@ -287,6 +293,7 @@ class IDF_Scm_Mercurial extends IDF_Scm $cmd = sprintf($tmpl, escapeshellarg($commit), escapeshellarg($this->repo)); $out = array(); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; exec($cmd, $out); $log = array(); $change = array(); @@ -328,6 +335,7 @@ class IDF_Scm_Mercurial extends IDF_Scm { $cmd = sprintf(Pluf::f('hg_path', 'hg').' log -R %s -l%s ', escapeshellarg($this->repo), $n, $commit); $out = array(); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; exec($cmd, $out); return self::parseLog($out, 6); } diff --git a/src/IDF/Scm/Svn.php b/src/IDF/Scm/Svn.php index 1d905b3..6766186 100644 --- a/src/IDF/Scm/Svn.php +++ b/src/IDF/Scm/Svn.php @@ -146,6 +146,7 @@ class IDF_Scm_Svn extends IDF_Scm escapeshellarg($this->password), escapeshellarg($this->repo), escapeshellarg($rev)); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; exec($cmd, $out, $ret); return (0 == $ret); } @@ -170,6 +171,7 @@ class IDF_Scm_Svn extends IDF_Scm escapeshellarg($this->password), escapeshellarg($this->repo.'/'.$path), escapeshellarg($rev)); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; $xmlInfo = shell_exec($cmd); // If exception is thrown, return false @@ -196,6 +198,7 @@ class IDF_Scm_Svn extends IDF_Scm escapeshellarg($this->password), escapeshellarg($this->repo.'/'.$folder), escapeshellarg($commit)); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; $xml = simplexml_load_string(shell_exec($cmd)); $res = array(); $folder = (strlen($folder) and ($folder != '/')) ? $folder.'/' : ''; @@ -236,6 +239,7 @@ class IDF_Scm_Svn extends IDF_Scm escapeshellarg($this->password), escapeshellarg($this->repo), escapeshellarg($rev)); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; $xml = simplexml_load_string(shell_exec($cmd)); $this->cache['commitmess'][$rev] = (string) $xml->logentry->msg; return $this->cache['commitmess'][$rev]; @@ -251,6 +255,7 @@ class IDF_Scm_Svn extends IDF_Scm escapeshellarg($this->password), escapeshellarg($this->repo.'/'.$filename), escapeshellarg($rev)); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; $xml = simplexml_load_string(shell_exec($cmd)); if (!isset($xml->entry)) { return false; @@ -277,6 +282,7 @@ class IDF_Scm_Svn extends IDF_Scm escapeshellarg($this->password), escapeshellarg($this->repo.'/'.$def->fullpath), escapeshellarg($def->rev)); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; return ($cmd_only) ? $cmd : shell_exec($cmd); } @@ -295,6 +301,7 @@ class IDF_Scm_Svn extends IDF_Scm escapeshellarg($this->username), escapeshellarg($this->password), escapeshellarg($this->repo.'/branches')); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; exec($cmd, $out, $ret); if ($ret == 0) { foreach ($out as $entry) { @@ -309,6 +316,7 @@ class IDF_Scm_Svn extends IDF_Scm escapeshellarg($this->username), escapeshellarg($this->password), escapeshellarg($this->repo.'/trunk')); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; exec($cmd, $out, $ret); if ($ret == 0) { $res = array('trunk' => 'trunk') + $res; @@ -348,6 +356,7 @@ class IDF_Scm_Svn extends IDF_Scm escapeshellarg($this->password), escapeshellarg($this->repo), escapeshellarg($commit)); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; $xmlRes = shell_exec($cmd); $xml = simplexml_load_string($xmlRes); $res['author'] = (string) $xml->logentry->author; @@ -376,6 +385,7 @@ class IDF_Scm_Svn extends IDF_Scm $cmd = sprintf(Pluf::f('svnlook_path', 'svnlook').' changed -r %s %s', escapeshellarg($commit), escapeshellarg($repo)); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; $out = shell_exec($cmd); $lines = preg_split("/\015\012|\015|\012/", $out); return (count($lines) > 100); @@ -389,6 +399,7 @@ class IDF_Scm_Svn extends IDF_Scm escapeshellarg($this->username), escapeshellarg($this->password), escapeshellarg($this->repo)); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; return shell_exec($cmd); } @@ -414,6 +425,7 @@ class IDF_Scm_Svn extends IDF_Scm escapeshellarg($this->password), escapeshellarg($this->repo), escapeshellarg($branch)); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; $xmlRes = shell_exec($cmd); $xml = simplexml_load_string($xmlRes); foreach ($xml->logentry as $entry) { @@ -445,6 +457,7 @@ class IDF_Scm_Svn extends IDF_Scm escapeshellarg($this->password), escapeshellarg($this->repo.'/'.$path), escapeshellarg($rev)); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; $xmlProps = shell_exec($cmd); $props = simplexml_load_string($xmlProps); @@ -480,6 +493,7 @@ class IDF_Scm_Svn extends IDF_Scm escapeshellarg($this->password), escapeshellarg($this->repo.'/'.$path), escapeshellarg($rev)); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; $xmlProp = shell_exec($cmd); $prop = simplexml_load_string($xmlProp); @@ -502,6 +516,7 @@ class IDF_Scm_Svn extends IDF_Scm escapeshellarg($this->password), escapeshellarg($this->repo), escapeshellarg($rev)); + $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; $xmlInfo = shell_exec($cmd); $xml = simplexml_load_string($xmlInfo);