Indefero

Indefero Commit Details


Date:2011-10-04 19:42:51 (13 years 2 months ago)
Author:Thomas Keller
Branch:develop, feature.diff-whitespace, feature.wiki-default-page, release-1.2, release-1.3
Commit:1be91e5a2aefe59dfe4726bbc7d21d2383e640ce
Parents: ef2d3a9af9af8d194eb6cc4d6a02652664234018
Message:Do not split Hg's and git's log output into lines - this will make it impossible for us to detect proper line endings later on.

Changes:

File differences

src/IDF/Scm/Git.php
507507
508508
509509
510
511510
512
513
511
512
514513
515514
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
515
516
517
518
519
520
532521
533
534
522
535523
536524
525
526
537527
538528
539529
"'".$this->mediumtree_fmt."'",
escapeshellarg($commit));
}
$out = array();
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
self::exec('IDF_Scm_Git::getCommit', $cmd, $out, $ret);
if ($ret != 0 or count($out) == 0) {
$out = self::shell_exec('IDF_Scm_Git::getCommit', $cmd);
if (strlen($out) == 0) {
return false;
}
if ($getdiff) {
$log = array();
$change = array();
$inchange = false;
foreach ($out as $line) {
if (!$inchange and 0 === strpos($line, 'diff --git a')) {
$inchange = true;
}
if ($inchange) {
$change[] = $line;
} else {
$log[] = $line;
}
}
$out = self::parseLog($log);
$out[0]->diff = implode("\n", $change);
$diffStart = strpos($out, 'diff --git a');
$diff = '';
if ($diffStart !== false) {
$log = substr($out, 0, $diffStart);
$diff = substr($out, $diffStart);
} else {
$out = self::parseLog($out);
$out[0]->diff = '';
$log = $out;
}
$out = self::parseLog(preg_split('/\r\n|\n/', $log));
$out[0]->diff = $diff;
$out[0]->branch = implode(', ', $this->inBranches($out[0]->commit, null));
return $out[0];
}
src/IDF/Scm/Mercurial.php
408408
409409
410410
411
412411
413
414
415
416
417
418
419
420
421
422
423
424
425
412
413
414
426415
427
428
416
417
418
419
420
421
422
423
424
425
426
427
429428
430429
431430
escapeshellarg($commit),
escapeshellarg($this->repo),
escapeshellarg($logStyle->get()));
$out = array();
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
self::exec('IDF_Scm_Mercurial::getCommit', $cmd, $out);
$log = array();
$change = array();
$inchange = false;
foreach ($out as $line) {
if (!$inchange and 0 === strpos($line, 'diff -r')) {
$inchange = true;
}
if ($inchange) {
$change[] = $line;
} else {
$log[] = $line;
}
$out = self::shell_exec('IDF_Scm_Mercurial::getCommit', $cmd);
if (strlen($out) == 0) {
return false;
}
$out = self::parseLog($log);
$out[0]->diff = implode("\n", $change);
$diffStart = strpos($out, 'diff -r');
$diff = '';
if ($diffStart !== false) {
$log = substr($out, 0, $diffStart);
$diff = substr($out, $diffStart);
} else {
$log = $out;
}
$out = self::parseLog(preg_split('/\r\n|\n/', $log));
$out[0]->diff = $diff;
return $out[0];
}

Archive Download the corresponding diff file

Page rendered in 0.08135s using 13 queries.