Indefero

Indefero Commit Details


Date:2009-04-27 04:39:19 (15 years 7 months ago)
Author:Loic d'Anterroches
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, master, release-1.1, release-1.2, release-1.3
Commit:a3f40447c07ba12870fa6e315f021f4eb9942808
Parents: cf5acfb6693bb632545be6e644ab66d874dea3e0
Message:Continued the refactoring of the Subversion backend.

Changes:

File differences

src/IDF/Scm/Svn.php
2222
2323
2424
25
26
25
26
27
28
29
30
31
32
2733
2834
2935
......
4046
4147
4248
49
4350
4451
4552
......
163170
164171
165172
166
167
173
168174
169175
170176
......
175181
176182
177183
178
179
180
181
184
182185
183186
184187
......
192195
193196
194197
195
198
196199
197
198200
199
200201
201202
202
203
203204
204
205
206
207
205208
206209
207210
208
211
209212
210
211
212
213
213
214
215
214216
215217
216218
......
223225
224226
225227
226
227
228
228229
229230
230231
231232
232233
233234
234
235
235236
236237
237238
238239
239
240240
241241
242242
......
280280
281281
282282
283
283
284284
285285
286286
# ***** END LICENSE BLOCK ***** */
/**
* SVN utils.
*
* Subversion backend.
* When a branch is not a branch.
*
* Contrary to most other SCMs, Subversion is using folders to manage
* the branches and so what is either the commit or the branch in
* other SCMs is the revision number with Subversion. So, do not be
* surprised if you have the feeling that the methods are not really
* returning what could be expected from their names.
*/
class IDF_Scm_Svn extends IDF_Scm
{
$this->repo = $repo;
$this->username = $username;
$this->password = $password;
$this->cache['commitmess'] = array();
}
public function isAvailable()
escapeshellarg($this->password),
escapeshellarg($this->repo.'/'.$folder),
escapeshellarg($rev));
$xmlLs = shell_exec($cmd);
$xml = simplexml_load_string($xmlLs);
$xml = simplexml_load_string(shell_exec($cmd));
$res = array();
$folder = (strlen($folder)) ? $folder.'/' : '';
foreach ($xml->list->entry as $entry) {
$file['date'] = gmdate('Y-m-d H:i:s',
strtotime((string) $entry->commit->date));
$file['rev'] = (string) $entry->commit['revision'];
// Get commit message
$currentReposFile = $this->repo.'/'.$folder.$file['file'];
$file['log'] = $this->getCommitMessage($currentReposFile, $rev);
$file['log'] = $this->getCommitMessage($file['rev']);
// Get the size if the type is blob
if ($file['type'] == 'blob') {
$file['size'] = (string) $entry->size;
/**
* Get a commit message for given file and revision.
* Get the commit message of a revision revision.
*
* @param string File
* @param string Commit ('HEAD')
*
* @return String commit message
*/
private function getCommitMessage($file, $rev='HEAD')
private function getCommitMessage($rev='HEAD')
{
if (isset($commit[$rev])) return $commit[$rev];
if (isset($this->cache['commitmess'][$rev])) {
return $this->cache['commitmess'][$rev];
}
$cmd = sprintf(Pluf::f('svn_path', 'svn').' log --xml --limit 1 --username=%s --password=%s %s@%s',
escapeshellarg($this->username),
escapeshellarg($this->password),
escapeshellarg($file),
escapeshellarg($this->repo),
escapeshellarg($rev));
$xmlLog = shell_exec($cmd);
$xml = simplexml_load_string($xmlLog);
$commit[$rev]=(string) $xml->logentry->msg;
return (string) $xml->logentry->msg;
$xml = simplexml_load_string(shell_exec($cmd));
$this->cache['commitmess'][$rev] = (string) $xml->logentry->msg;
return $this->cache['commitmess'][$rev];
}
/**
escapeshellarg($this->password),
escapeshellarg($this->repo.'/'.$totest),
escapeshellarg($rev));
$xmlInfo = shell_exec($cmd);
$xml = simplexml_load_string($xmlInfo);
$xml = simplexml_load_string(shell_exec($cmd));
$entry = $xml->entry;
$file = array();
$file['fullpath'] = $totest;
$file['hash'] = (string) $entry->repository->uuid;
$file['type'] = $this->assoc[(string) $entry['kind']];
$file['file'] = $totest;
$file['rev'] = (string) $entry->commit['revision'];
$file['rev'] = $rev;
$file['author'] = (string) $entry->author;
$file['date'] = gmdate('Y-m-d H:i:s', strtotime((string) $entry->commit->date));
$file['size'] = (string) $entry->size;
$file['log'] = '';
return (object) $file;
}
escapeshellarg($this->repo.'/trunk'));
exec($cmd, $out, $ret);
if ($ret == 0) {
$res = array_merge(array('trunk' => 'trunk'), $res);
$res = array('trunk' => 'trunk') + $res;
}
$this->cache['branches'] = $res;
return $res;
src/IDF/Views/Source.php
150150
151151
152152
153
154
155
153156
154157
155158
156
157159
158160
159
160161
161
162
163162
164163
165164
......
170169
171170
172171
173
174172
175173
176174
177175
178
179176
180177
181178
182179
183180
184
185181
186182
187183
$title = sprintf(__('%1$s %2$s Source Tree'),
$request->project, $this->getScmType($request));
$scm = IDF_Scm::get($request->project);
$commit = $match[2];
$request_file = $match[3];
if (!$scm->isAvailable()) {
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::help',
array($request->project->shortname));
return new Pluf_HTTP_Response_Redirect($url);
}
$branches = $scm->getBranches();
$commit = $match[2];
$request_file = $match[3];
$fburl = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',
array($request->project->shortname,
$scm->getMainBranch()));
$request_file));
return new Pluf_HTTP_Response_Redirect($url, 301);
}
if (!$scm->isValidRevision($commit, $request_file)) {
// Redirect to the first branch
return new Pluf_HTTP_Response_Redirect($fburl);
}
$request_file_info = $scm->getPathInfo($request_file, $commit);
if (!$request_file_info) {
// Redirect to the first branch
return new Pluf_HTTP_Response_Redirect($fburl);
}
if ($request_file_info->type != 'tree') {
$info = self::getRequestedFileMimeType($request_file_info,
$commit, $scm);

Archive Download the corresponding diff file

Page rendered in 0.08710s using 13 queries.