Indefero

Indefero Commit Details


Date:2011-02-24 08:21:51 (13 years 9 months ago)
Author:William MARTIN
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, release-1.1, release-1.2, release-1.3
Commit:f0ac256ff619df7b94198a91a6da5c3e9fc2a42d
Parents: 6e5c3a551df82c3bef281d40f696616c313a50cd
Message:Implementation of IDF_Scm_Git::getChanges()

Changes:

File differences

src/IDF/Scm/Git.php
4141
4242
4343
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
4495
4596
4697
$this->project = $project;
}
/**
* @see IDF_Scm::getChanges()
*
* Git command output is like :
* M doc/Guide utilisateur/Manuel_distrib.tex
* M doc/Guide utilisateur/Manuel_intro.tex
* M doc/Guide utilisateur/Manuel_libpegase_exemples.tex
* M doc/Guide utilisateur/Manuel_page1_version.tex
* A doc/Guide utilisateur/images/ftp-nautilus.png
* M doc/Guide utilisateur/textes/log_boot_PEGASE.txt
*
* Status letters mean : Added (A), Deleted (D), Modified (M), Renamed (R)
*/
public function getChanges($commit)
{
$cmd = sprintf('GIT_DIR=%s '.Pluf::f('git_path', 'git').' show %s --name-status --pretty="format:" --diff-filter="[A|D|M|R]"',
escapeshellarg($this->repo),
escapeshellarg($commit));
$out = array();
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
self::exec('IDF_Scm_Git::getChanges', $cmd, $out);
$return = (object) array(
'additions' => array(),
'deletions' => array(),
'renames' => array(),
'patches' => array(),
'properties' => array(),
);
foreach ($out as $line) {
$line = trim($line);
if ($line != '') {
$action = $line[0];
$filename = trim(substr($line, 1));
if ($action == 'A') {
$return->additions[] = $filename;
} else if ($action == 'D') {
$return->deletions[] = $filename;
} else if ($action == 'M') {
$return->patches[] = $filename;
} else if ($action == 'R') {
$return->renames[] = $filename;
}
}
}
return $return;
}
public function getRepositorySize()
{
if (!file_exists($this->repo)) {

Archive Download the corresponding diff file

Page rendered in 0.08036s using 13 queries.