InDefero

Sign in or create your account | Project List | Help

InDefero Commit Details

Date:2009-07-02 13:05:43 (1 year 2 months ago)
Author:Loïc d'Anterroches
Commit:2b1a7419461adcc9bbb9ac885b6697c7260947ae
Message:Fixed issue 245, ['idf_exec_cmd_prefix'] configuration variable is not available anymore.

Files: src/IDF/Scm/Git.php (6 diffs)
src/IDF/Scm/Mercurial.php (8 diffs)
src/IDF/Scm/Svn.php (15 diffs)

Change Details

src/IDF/Scm/Git.php
2828class IDF_Scm_Git extends IDF_Scm
2929{
3030    public $mediumtree_fmt = 'commit %H%nAuthor: %an <%ae>%nTree: %T%nDate: %ai%n%n%s%n%n%b';
31    public $date_fmt =
3132
3233    /* ============================================== *
3334     * *
...... 
228229                       escapeshellarg($this->repo),
229230                       escapeshellarg($hash));
230231        $ret = 0; $out = array();
232        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
231233        exec($cmd, $out, $ret);
232234        if ($ret != 0) return false;
233235        return trim($out[0]);
...... 
277279                       escapeshellarg($this->repo),
278280                       escapeshellarg($commit));
279281        $out = array();
282        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
280283        exec($cmd, $out);
281284        foreach ($out as $line) {
282285            list($perm, $type, $hash, $size, $file) = preg_split('/ |\t/', $line, 5, PREG_SPLIT_NO_EMPTY);
...... 
322325                           escapeshellarg($commit));
323326        }
324327        $out = array();
328        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
325329        exec($cmd, $out, $ret);
326330        if ($ret != 0 or count($out) == 0) {
327331            return false;
...... 
357361                       "'commit %H%n'",
358362                       escapeshellarg($commit));
359363        $out = array();
364        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
360365        exec($cmd, $out);
361366        $affected = count($out) - 2;
362367        $added = 0;
...... 
389394                       escapeshellarg($this->repo), $n, $this->mediumtree_fmt,
390395                       escapeshellarg($commit));
391396        $out = array();
397        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
392398        exec($cmd, $out);
393399        return self::parseLog($out, 4);
394400    }
src/IDF/Scm/Mercurial.php
8484        $cmd = sprintf(Pluf::f('hg_path', 'hg').' log -R %s -r %s',
8585                       escapeshellarg($this->repo),
8686                       escapeshellarg($rev));
87        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
8788        exec($cmd, $out, $ret);
8889        return ($ret == 0);
8990    }
...... 
102103                       escapeshellarg($hash));
103104        $ret = 0;
104105        $out = array();
106        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
105107        exec($cmd, $out, $ret);
106108        return ($ret != 0) ? false : 'commit';
107109    }
...... 
145147        $cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo), $tree, ($recurse) ? '' : '');
146148        $out = array();
147149        $res = array();
150        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
148151        exec($cmd, $out);
149152        $tmp_hack = array();
150153        while (null !== ($line = array_pop($out))) {
...... 
191194        $cmd_tmpl = Pluf::f('hg_path', 'hg').' manifest -R %s --debug -r %s';
192195        $cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo), $commit);
193196        $out = array();
197        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
194198        exec($cmd, $out);
195199        $tmp_hack = array();
196200        while (null !== ($line = array_pop($out))) {
...... 
242246                       escapeshellarg($this->repo),
243247                       escapeshellarg($def->commit),
244248                       escapeshellarg($this->repo.'/'.$def->file));
249        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
245250        return ($cmd_only) ? $cmd : shell_exec($cmd);
246251    }
247252
...... 
256261            return $this->cache['branches'];
257262        }
258263        $out = array();
264        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
259265        exec(sprintf(Pluf::f('hg_path', 'hg').' branches -R %s',
260266                              escapeshellarg($this->repo)), $out);
261267        $res = array();
...... 
287293        $cmd = sprintf($tmpl,
288294                       escapeshellarg($commit), escapeshellarg($this->repo));
289295        $out = array();
296        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
290297        exec($cmd, $out);
291298        $log = array();
292299        $change = array();
...... 
328335    {
329336        $cmd = sprintf(Pluf::f('hg_path', 'hg').' log -R %s -l%s ', escapeshellarg($this->repo), $n, $commit);
330337        $out = array();
338        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
331339        exec($cmd, $out);
332340        return self::parseLog($out, 6);
333341    }
src/IDF/Scm/Svn.php
146146                       escapeshellarg($this->password),
147147                       escapeshellarg($this->repo),
148148                       escapeshellarg($rev));
149        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
149150        exec($cmd, $out, $ret);
150151        return (0 == $ret);
151152    }
...... 
170171                       escapeshellarg($this->password),
171172                       escapeshellarg($this->repo.'/'.$path),
172173                       escapeshellarg($rev));
174        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
173175        $xmlInfo = shell_exec($cmd);
174176
175177        // If exception is thrown, return false
...... 
196198                       escapeshellarg($this->password),
197199                       escapeshellarg($this->repo.'/'.$folder),
198200                       escapeshellarg($commit));
201        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
199202        $xml = simplexml_load_string(shell_exec($cmd));
200203        $res = array();
201204        $folder = (strlen($folder) and ($folder != '/')) ? $folder.'/' : '';
...... 
236239                       escapeshellarg($this->password),
237240                       escapeshellarg($this->repo),
238241                       escapeshellarg($rev));
242        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
239243        $xml = simplexml_load_string(shell_exec($cmd));
240244        $this->cache['commitmess'][$rev] = (string) $xml->logentry->msg;
241245        return $this->cache['commitmess'][$rev];
...... 
251255                       escapeshellarg($this->password),
252256                       escapeshellarg($this->repo.'/'.$filename),
253257                       escapeshellarg($rev));
258        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
254259        $xml = simplexml_load_string(shell_exec($cmd));
255260        if (!isset($xml->entry)) {
256261            return false;
...... 
277282                       escapeshellarg($this->password),
278283                       escapeshellarg($this->repo.'/'.$def->fullpath),
279284                       escapeshellarg($def->rev));
285        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
280286        return ($cmd_only) ? $cmd : shell_exec($cmd);
281287    }
282288
...... 
295301                       escapeshellarg($this->username),
296302                       escapeshellarg($this->password),
297303                       escapeshellarg($this->repo.'/branches'));
304        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
298305        exec($cmd, $out, $ret);
299306        if ($ret == 0) {
300307            foreach ($out as $entry) {
...... 
309316                       escapeshellarg($this->username),
310317                       escapeshellarg($this->password),
311318                       escapeshellarg($this->repo.'/trunk'));
319        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
312320        exec($cmd, $out, $ret);
313321        if ($ret == 0) {
314322            $res = array('trunk' => 'trunk') + $res;
...... 
348356                       escapeshellarg($this->password),
349357                       escapeshellarg($this->repo),
350358                       escapeshellarg($commit));
359        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
351360        $xmlRes = shell_exec($cmd);
352361        $xml = simplexml_load_string($xmlRes);
353362        $res['author'] = (string) $xml->logentry->author;
...... 
376385        $cmd = sprintf(Pluf::f('svnlook_path', 'svnlook').' changed -r %s %s',
377386                       escapeshellarg($commit),
378387                       escapeshellarg($repo));
388        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
379389        $out = shell_exec($cmd);
380390        $lines = preg_split("/\015\012|\015|\012/", $out);
381391        return (count($lines) > 100);
...... 
389399                       escapeshellarg($this->username),
390400                       escapeshellarg($this->password),
391401                       escapeshellarg($this->repo));
402        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
392403        return shell_exec($cmd);
393404    }
394405
...... 
414425                       escapeshellarg($this->password),
415426                       escapeshellarg($this->repo),
416427                       escapeshellarg($branch));
428        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
417429        $xmlRes = shell_exec($cmd);
418430        $xml = simplexml_load_string($xmlRes);
419431        foreach ($xml->logentry as $entry) {
...... 
445457                       escapeshellarg($this->password),
446458                       escapeshellarg($this->repo.'/'.$path),
447459                       escapeshellarg($rev));
460        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
448461        $xmlProps = shell_exec($cmd);
449462        $props = simplexml_load_string($xmlProps);
450463
...... 
480493                       escapeshellarg($this->password),
481494                       escapeshellarg($this->repo.'/'.$path),
482495                       escapeshellarg($rev));
496        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
483497        $xmlProp = shell_exec($cmd);
484498        $prop = simplexml_load_string($xmlProp);
485499
...... 
502516                       escapeshellarg($this->password),
503517                       escapeshellarg($this->repo),
504518                       escapeshellarg($rev));
519        $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
505520        $xmlInfo = shell_exec($cmd);
506521
507522        $xml = simplexml_load_string($xmlInfo);

Archive Download the corresponding diff file

Branches:
dev
develop
master
newdiff
svn

Tags:
v1.0