Indefero

Indefero Commit Details


Date:2010-05-01 17:56:04 (14 years 7 months ago)
Author:Thomas Keller
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:59ad0f5b1183b9f48cb7a307044708b69b323c6d
Parents: 3b53ceedcd60fe116e3f2844b0b5b7fd3b0eaa60
Message:* idf.php-dist: improve the document of the various mtn-related configure options; introduce an option to configure the protocole - separate from the url option, which we now name mtn_remote_host * IDF_Project: optionally give getSourceAccessUrl() a commit argument, so a particular VCS module can determine a subset of revisions to pull for the specific revision which is browsed * IDF_Scm_*: add the argument null'd for all VCS; implement a branch lookup for monotone * tree.html: display the correct branch to clone under each revision tree

Changes:

File differences

src/IDF/Project.php
381381
382382
383383
384
384385
385
386
386387
387388
388389
389390
390
391
391392
392
393
393394
394395
395396
......
397398
398399
399400
401
402
400403
401
404
402405
403406
404407
405408
406409
407410
408
411
409412
410413
411414
......
414417
415418
416419
420
421
417422
418
423
419424
420425
421426
422427
423428
424
429
425430
426431
427432
* This will return the right url based on the user.
*
* @param Pluf_User The user (null)
* @param string A specific commit to access
*/
public function getSourceAccessUrl($user=null)
public function getSourceAccessUrl($user=null, $commit=null)
{
$right = $this->getConf()->getVal('source_access_rights', 'all');
if (($user == null or $user->isAnonymous())
and $right == 'all' and !$this->private) {
return $this->getRemoteAccessUrl();
return $this->getRemoteAccessUrl($commit);
}
return $this->getWriteRemoteAccessUrl($user);
return $this->getWriteRemoteAccessUrl($user, $commit);
}
* Get the remote access url to the repository.
*
* This will always return the anonymous access url.
*
* @param string A specific commit to access
*/
public function getRemoteAccessUrl()
public function getRemoteAccessUrl($commit=null)
{
$conf = $this->getConf();
$scm = $conf->getVal('scm', 'git');
$scms = Pluf::f('allowed_scm');
Pluf::loadClass($scms[$scm]);
return call_user_func(array($scms[$scm], 'getAnonymousAccessUrl'),
$this);
$this, $commit);
}
/**
* Some SCM have a remote access URL to write which is not the
* same as the one to read. For example, you do a checkout with
* git-daemon and push with SSH.
*
* @param string A specific commit to access
*/
public function getWriteRemoteAccessUrl($user)
public function getWriteRemoteAccessUrl($user,$commit=null)
{
$conf = $this->getConf();
$scm = $conf->getVal('scm', 'git');
$scms = Pluf::f('allowed_scm');
return call_user_func(array($scms[$scm], 'getAuthAccessUrl'),
$this, $user);
$this, $user, $commit);
}
/**
src/IDF/Scm/Git.php
2828
2929
3030
31
31
3232
3333
3434
3535
36
36
3737
3838
3939
......
4848
4949
5050
51
51
5252
5353
5454
......
7070
7171
7272
73
73
7474
75
75
7676
7777
7878
79
79
8080
8181
8282
......
216216
217217
218218
219
219
220220
221221
222222
......
231231
232232
233233
234
234
235235
236236
237237
......
270270
271271
272272
273
273
274274
275275
276276
277277
278
278
279279
280280
281281
......
320320
321321
322322
323
323
324324
325325
326326
......
332332
333333
334334
335
335
336336
337337
338338
339339
340340
341341
342
343
342
343
344344
345345
346346
......
356356
357357
358358
359
360
359
360
361361
362362
363363
......
366366
367367
368368
369
370
369
370
371371
372372
373373
......
379379
380380
381381
382
382
383383
384
384
385385
386386
387387
......
396396
397397
398398
399
400
399
400
401401
402402
403403
404
405
404
405
406406
407407
408408
......
443443
444444
445445
446
447
446
447
448448
449449
450450
......
477477
478478
479479
480
480
481481
482482
483483
......
683683
684684
685685
686
686
687687
688688
689689
......
737737
738738
739739
740
740
741741
742742
743743
......
765765
766766
767767
768
768
769769
770770
771771
......
777777
778778
779779
780
780
781781
782782
783783
......
792792
793793
794794
795
795
796796
797
797
798798
799799
800800
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';
/* ============================================== *
* *
* Common Methods Implemented By All The SCMs *
* *
* ============================================== */
* ============================================== */
public function __construct($repo, $project=null)
{
}
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -sk '
.escapeshellarg($this->repo);
$out = explode(' ',
$out = explode(' ',
self::shell_exec('IDF_Scm_Git::getRepositorySize', $cmd),
2);
return (int) $out[0]*1024;
return $this->cache['branches'];
}
$cmd = Pluf::f('idf_exec_cmd_prefix', '')
.sprintf('GIT_DIR=%s '.Pluf::f('git_path', 'git').' branch',
.sprintf('GIT_DIR=%s '.Pluf::f('git_path', 'git').' branch',
escapeshellarg($this->repo));
self::exec('IDF_Scm_Git::getBranches',
self::exec('IDF_Scm_Git::getBranches',
$cmd, $out, $return);
if ($return != 0) {
throw new IDF_Scm_Exception(sprintf($this->error_tpl,
$cmd, $return,
$cmd, $return,
implode("\n", $out)));
}
$res = array();
if ($folder) {
// As we are limiting to a given folder, we need to find
// the tree corresponding to this folder.
$tinfo = $this->getTreeInfo($commit, $folder);
$tinfo = $this->getTreeInfo($commit, $folder);
if (isset($tinfo[0]) and $tinfo[0]->type == 'tree') {
$tree = $tinfo[0]->hash;
} else {
// information as possible.
if ($file->type == 'blob') {
$file->date = $co->date;
$file->log = '----';
$file->log = '----';
$file->author = 'Unknown';
}
$file->fullpath = ($folder) ? $folder.'/'.$file->file : $file->file;
return null;
}
public static function getAnonymousAccessUrl($project)
public static function getAnonymousAccessUrl($project, $commit=null)
{
return sprintf(Pluf::f('git_remote_url'), $project->shortname);
}
public static function getAuthAccessUrl($project, $user)
public static function getAuthAccessUrl($project, $user, $commit=null)
{
return sprintf(Pluf::f('git_write_remote_url'), $project->shortname);
}
/**
* Get the tree info.
*
* @param string Tree hash
* @param string Tree hash
* @param bool Do we recurse in subtrees (true)
* @param string Folder in which we want to get the info ('')
* @return array Array of file information.
}
$cmd_tmpl = 'GIT_DIR=%s '.Pluf::f('git_path', 'git').' ls-tree -l %s %s';
$cmd = Pluf::f('idf_exec_cmd_prefix', '')
.sprintf($cmd_tmpl, escapeshellarg($this->repo),
.sprintf($cmd_tmpl, escapeshellarg($this->repo),
escapeshellarg($tree), escapeshellarg($folder));
$out = array();
$res = array();
self::exec('IDF_Scm_Git::getTreeInfo', $cmd, $out);
foreach ($out as $line) {
list($perm, $type, $hash, $size, $file) = preg_split('/ |\t/', $line, 5, PREG_SPLIT_NO_EMPTY);
$res[] = (object) array('perm' => $perm, 'type' => $type,
'size' => $size, 'hash' => $hash,
$res[] = (object) array('perm' => $perm, 'type' => $type,
'size' => $size, 'hash' => $hash,
'file' => $file);
}
return $res;
public function getPathInfo($totest, $commit='HEAD')
{
$cmd_tmpl = 'GIT_DIR=%s '.Pluf::f('git_path', 'git').' ls-tree -r -t -l %s';
$cmd = sprintf($cmd_tmpl,
escapeshellarg($this->repo),
$cmd = sprintf($cmd_tmpl,
escapeshellarg($this->repo),
escapeshellarg($commit));
$out = array();
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
list($perm, $type, $hash, $size, $file) = preg_split('/ |\t/', $line, 5, PREG_SPLIT_NO_EMPTY);
if ($totest == $file) {
$pathinfo = pathinfo($file);
return (object) array('perm' => $perm, 'type' => $type,
'size' => $size, 'hash' => $hash,
return (object) array('perm' => $perm, 'type' => $type,
'size' => $size, 'hash' => $hash,
'fullpath' => $file,
'file' => $pathinfo['basename']);
}
{
$cmd = sprintf(Pluf::f('idf_exec_cmd_prefix', '').
'GIT_DIR=%s '.Pluf::f('git_path', 'git').' cat-file blob %s',
escapeshellarg($this->repo),
escapeshellarg($this->repo),
escapeshellarg($def->hash));
return ($cmd_only)
return ($cmd_only)
? $cmd : self::shell_exec('IDF_Scm_Git::getFile', $cmd);
}
{
if ($getdiff) {
$cmd = sprintf('GIT_DIR=%s '.Pluf::f('git_path', 'git').' show --date=iso --pretty=format:%s %s',
escapeshellarg($this->repo),
"'".$this->mediumtree_fmt."'",
escapeshellarg($this->repo),
"'".$this->mediumtree_fmt."'",
escapeshellarg($commit));
} else {
$cmd = sprintf('GIT_DIR=%s '.Pluf::f('git_path', 'git').' log -1 --date=iso --pretty=format:%s %s',
escapeshellarg($this->repo),
"'".$this->mediumtree_fmt."'",
escapeshellarg($this->repo),
"'".$this->mediumtree_fmt."'",
escapeshellarg($commit));
}
$out = array();
public function isCommitLarge($commit='HEAD')
{
$cmd = sprintf('GIT_DIR=%s '.Pluf::f('git_path', 'git').' log --numstat -1 --pretty=format:%s %s',
escapeshellarg($this->repo),
"'commit %H%n'",
escapeshellarg($this->repo),
"'commit %H%n'",
escapeshellarg($commit));
$out = array();
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
if ($n === null) $n = '';
else $n = ' -'.$n;
$cmd = sprintf('GIT_DIR=%s '.Pluf::f('git_path', 'git').' log%s --date=iso --pretty=format:\'%s\' %s',
escapeshellarg($this->repo), $n, $this->mediumtree_fmt,
escapeshellarg($this->repo), $n, $this->mediumtree_fmt,
escapeshellarg($commit));
$out = array();
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
/**
* Build the blob info cache.
*
* We build the blob info cache 500 commits at a time.
* We build the blob info cache 500 commits at a time.
*/
public function buildBlobInfoCache()
{
/**
* Cache blob info.
*
*
* Given a series of blob info, cache them.
*
* @param array Blob info
foreach ($data as $rec) {
if (isset($hashes[substr($rec, 0, 40)])) {
$tmp = explode(chr(31), substr($rec, 40), 3);
$res[substr($rec, 0, 40)] =
$res[substr($rec, 0, 40)] =
(object) array('hash' => substr($rec, 0, 40),
'date' => $tmp[0],
'title' => $tmp[2],
/**
* File cache blob info.
*
*
* Given a series of blob info, cache them.
*
* @param array Blob info
}
$data = implode(chr(30), $data).chr(30);
$cache = Pluf::f('tmp_folder').'/IDF_Scm_Git-'.md5($this->repo).'.cache.db';
$fp = fopen($cache, 'ab');
$fp = fopen($cache, 'ab');
if ($fp) {
flock($fp, LOCK_EX);
flock($fp, LOCK_EX);
fwrite($fp, $data, strlen($data));
fclose($fp); // releases the lock too
return true;
src/IDF/Scm/Mercurial.php
3737
3838
3939
40
40
4141
42
42
4343
4444
4545
......
7777
7878
7979
80
80
8181
8282
8383
8484
85
85
8686
8787
8888
......
109109
110110
111111
112
112
113113
114114
115115
116
116
117117
118118
119119
......
130130
131131
132132
133
133
134134
135135
136136
......
142142
143143
144144
145
145
146146
147147
148148
......
152152
153153
154154
155
155
156156
157157
158158
......
192192
193193
194194
195
195
196196
197197
198198
......
202202
203203
204204
205
205
206206
207207
208208
......
219219
220220
221221
222
223
222
223
224224
225225
226226
......
239239
240240
241241
242
243
242
243
244244
245245
246246
......
249249
250250
251251
252
252
253253
254254
255255
256
257
256
257
258258
259259
260
260
261261
262262
263263
......
272272
273273
274274
275
275
276276
277277
278278
......
296296
297297
298298
299
299
300300
301301
302302
......
311311
312312
313313
314
314
315315
316316
317317
318318
319319
320
320
321321
322322
323323
......
333333
334334
335335
336
336
337337
338
338
339339
340340
341341
......
411411
412412
413413
414
414
415415
416416
417417
{
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -sk '
.escapeshellarg($this->repo);
$out = explode(' ',
$out = explode(' ',
self::shell_exec('IDF_Scm_Mercurial::getRepositorySize',
$cmd),
$cmd),
2);
return (int) $out[0]*1024;
}
return 'tip';
}
public static function getAnonymousAccessUrl($project)
public static function getAnonymousAccessUrl($project, $commit=null)
{
return sprintf(Pluf::f('mercurial_remote_url'), $project->shortname);
}
public static function getAuthAccessUrl($project, $user)
public static function getAuthAccessUrl($project, $user, $commit=null)
{
return sprintf(Pluf::f('mercurial_remote_url'), $project->shortname);
}
$cmd = sprintf(Pluf::f('hg_path', 'hg').' log -R %s -r %s',
escapeshellarg($this->repo),
escapeshellarg($hash));
$ret = 0;
$ret = 0;
$out = array();
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
self::exec('IDF_Scm_Mercurial::testHash', $cmd, $out, $ret);
return ($ret != 0) ? false : 'commit';
return ($ret != 0) ? false : 'commit';
}
public function getTree($commit, $folder='/', $branch=null)
$found = true;
break;
}
}
}
if (!$found) {
throw new Exception(sprintf(__('Folder %1$s not found in commit %2$s.'), $folder, $commit));
}
/**
* Get the tree info.
*
* @param string Tree hash
* @param string Tree hash
* @param bool Do we recurse in subtrees (true)
* @return array Array of file information.
*/
throw new Exception(sprintf(__('Not a valid tree: %s.'), $tree));
}
$cmd_tmpl = Pluf::f('hg_path', 'hg').' manifest -R %s --debug -r %s';
$cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo), $tree, ($recurse) ? '' : '');
$cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo), $tree, ($recurse) ? '' : '');
$out = array();
$res = array();
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
}
$fullpath = ($folder) ? $folder.'/'.$file : $file;
$efullpath = self::smartEncode($fullpath);
$res[] = (object) array('perm' => $perm, 'type' => $type,
$res[] = (object) array('perm' => $perm, 'type' => $type,
'hash' => $hash, 'fullpath' => $fullpath,
'efullpath' => $efullpath, 'file' => $file);
}
public function getPathInfo($totest, $commit='tip')
{
$cmd_tmpl = Pluf::f('hg_path', 'hg').' manifest -R %s --debug -r %s';
$cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo), $commit);
$cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo), $commit);
$out = array();
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
self::exec('IDF_Scm_Mercurial::getPathInfo', $cmd, $out);
$tmp .= $dir[$i];
if ($tmp == $totest) {
$pathinfo = pathinfo($totest);
return (object) array('perm' => '000', 'type' => 'tree',
'hash' => $hash,
return (object) array('perm' => '000', 'type' => 'tree',
'hash' => $hash,
'fullpath' => $totest,
'file' => $pathinfo['basename'],
'commit' => $commit
}
if ($totest == $file) {
$pathinfo = pathinfo($totest);
return (object) array('perm' => $perm, 'type' => $type,
'hash' => $hash,
return (object) array('perm' => $perm, 'type' => $type,
'hash' => $hash,
'fullpath' => $totest,
'file' => $pathinfo['basename'],
'commit' => $commit
}
return false;
}
public function getFile($def, $cmd_only=false)
{
$cmd = sprintf(Pluf::f('hg_path', 'hg').' cat -R %s -r %s %s',
escapeshellarg($this->repo),
escapeshellarg($def->commit),
escapeshellarg($this->repo),
escapeshellarg($def->commit),
escapeshellarg($this->repo.'/'.$def->fullpath));
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
return ($cmd_only) ?
return ($cmd_only) ?
$cmd : self::shell_exec('IDF_Scm_Mercurial::getFile', $cmd);
}
return $this->cache['branches'];
}
$out = array();
$cmd = sprintf(Pluf::f('hg_path', 'hg').' branches -R %s',
$cmd = sprintf(Pluf::f('hg_path', 'hg').' branches -R %s',
escapeshellarg($this->repo));
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
self::exec('IDF_Scm_Mercurial::getBranches', $cmd, $out);
return $this->cache['tags'];
}
$out = array();
$cmd = sprintf(Pluf::f('hg_path', 'hg').' tags -R %s',
$cmd = sprintf(Pluf::f('hg_path', 'hg').' tags -R %s',
escapeshellarg($this->repo));
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
self::exec('IDF_Scm_Mercurial::getTags', $cmd, $out);
public function inBranches($commit, $path)
{
return (in_array($commit, array_keys($this->getBranches())))
return (in_array($commit, array_keys($this->getBranches())))
? array($commit) : array();
}
public function inTags($commit, $path)
{
return (in_array($commit, array_keys($this->getTags())))
return (in_array($commit, array_keys($this->getTags())))
? array($commit) : array();
}
if (!$this->isValidRevision($commit)) {
return false;
}
$tmpl = ($getdiff) ?
$tmpl = ($getdiff) ?
Pluf::f('hg_path', 'hg').' log -p -r %s -R %s' : Pluf::f('hg_path', 'hg').' log -r %s -R %s';
$cmd = sprintf($tmpl,
$cmd = sprintf($tmpl,
escapeshellarg($commit), escapeshellarg($this->repo));
$out = array();
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
$c['full_message'] = '';
$i=1;
continue;
}
if ($i == $hdrs) {
$c['title'] = trim($line);
src/IDF/Scm/Monotone.php
6161
6262
6363
64
6564
6665
6766
......
8382
8483
8584
86
8785
8886
8987
9088
9189
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
92118
93119
120
121
94122
95123
96124
......
100128
101129
102130
131
103132
104133
105134
......
151180
152181
153182
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
183
171184
172
173185
174186
175187
......
669681
670682
671683
672
684
673685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
674719
675
676
677
678
720
721
722
679723
680724
681
725
682726
683
727
684728
685729
686730
$descriptors = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("pipe", "r")
);
$this->proc = proc_open($cmd, $descriptors, $this->pipes);
fclose($this->pipes[0]);
fclose($this->pipes[1]);
fclose($this->pipes[2]);
proc_close($this->proc);
$this->proc = null;
}
private function _waitForReadyRead()
{
if (!is_resource($this->pipes[1]))
return false;
$read = array($this->pipes[1]);
$write = null;
$except = null;
$streamsChanged = stream_select(
$read, $write, $except, 0, 20000
);
if ($streamsChanged === false)
{
throw new IDF_Scm_Exception(
"Could not select() on read pipe"
);
}
if ($streamsChanged == 0)
{
return false;
}
return true;
}
private function _checkVersion()
{
$this->_waitForReadyRead();
$version = fgets($this->pipes[1]);
if (!preg_match('/^format-version: (\d+)$/', $version, $m) ||
$m[1] != self::$SUPPORTED_STDIO_VERSION)
self::$SUPPORTED_STDIO_VERSION."', got '".@$m[1]."'"
);
}
fgets($this->pipes[1]);
}
while (true)
{
$read = array($this->pipes[1]);
$write = null;
$except = null;
$streamsChanged = stream_select(
$read, $write, $except, 0, 20000
);
if ($streamsChanged === false)
{
throw new IDF_Scm_Exception(
"Could not select() on read pipe"
);
}
if ($streamsChanged == 0)
{
if (!$this->_waitForReadyRead())
continue;
}
$data = array(0,"",0);
$idx = 0;
return $branch;
}
public static function getAnonymousAccessUrl($project)
public static function getAnonymousAccessUrl($project, $commit = null)
{
$branch = self::_getMasterBranch($project);
if (!empty($commit))
{
$scm = IDF_Scm::get($project);
$revs = $scm->_resolveSelector($commit);
if (count($revs) > 0)
{
$certs = $scm->_getCerts($revs[0]);
// for the very seldom case that a revision
// has no branch certificate
if (count($certs['branch']) == 0)
{
$branch = "*";
}
else
{
$branch = $certs['branch'][0];
}
}
}
$protocol = Pluf::f('mtn_remote_protocol', 'netsync');
if ($protocol == "ssh")
{
// ssh is protocol + host + db-path + branch
return "ssh://" .
sprintf(Pluf::f('mtn_remote_host'), $project->shortname) .
sprintf(Pluf::f('mtn_repositories'), $project->shortname) .
" " . $branch;
}
// netsync is the default
return sprintf(
Pluf::f('mtn_remote_url'),
$project->shortname,
self::_getMasterBranch($project)
);
Pluf::f('mtn_remote_host'),
$project->shortname
)." ".$branch;
}
public static function getAuthAccessUrl($project, $user)
public static function getAuthAccessUrl($project, $user, $commit = null)
{
return self::getAnonymousAccessUrl($project);
return self::getAnonymousAccessUrl($project, $commit);
}
/**
src/IDF/Scm/Svn.php
2424
2525
2626
27
27
2828
2929
3030
......
8080
8181
8282
83
8384
8485
85
86
8687
8788
88
89
8990
9091
9192
......
9798
9899
99100
101
100102
101103
102
104
103105
104106
105
107
106108
107109
108110
......
120122
121123
122124
123
125
124126
125127
126128
......
268270
269271
270272
271
273
272274
273275
274276
......
284286
285287
286288
287
289
288290
289291
290292
291293
292
294
293295
294296
295297
......
328330
329331
330332
331
333
332334
333335
334336
/**
* 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
* Returns the URL of the subversion repository.
*
* @param IDF_Project
* @param string
* @return string URL
*/
public static function getAnonymousAccessUrl($project)
public static function getAnonymousAccessUrl($project,$commit=null)
{
$conf = $project->getConf();
if (false !== ($url=$conf->getVal('svn_remote_url', false))
if (false !== ($url=$conf->getVal('svn_remote_url', false))
&& !empty($url)) {
// Remote repository
return $url;
* Returns the URL of the subversion repository.
*
* @param IDF_Project
* @param string
* @return string URL
*/
public static function getAuthAccessUrl($project, $user)
public static function getAuthAccessUrl($project, $user, $commit=null)
{
$conf = $project->getConf();
if (false !== ($url=$conf->getVal('svn_remote_url', false))
if (false !== ($url=$conf->getVal('svn_remote_url', false))
&& !empty($url)) {
// Remote repository
return $url;
{
$conf = $project->getConf();
// Find the repository
if (false !== ($rep=$conf->getVal('svn_remote_url', false))
if (false !== ($rep=$conf->getVal('svn_remote_url', false))
&& !empty($rep)) {
// Remote repository
$scm = new IDF_Scm_Svn($rep, $project);
$file['type'] = $this->assoc[(string) $entry['kind']];
$pathinfo = pathinfo($filename);
$file['file'] = $pathinfo['basename'];
$file['rev'] = $rev;
$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;
escapeshellarg($this->repo.'/'.self::smartEncode($def->fullpath)),
escapeshellarg($def->rev));
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
return ($cmd_only) ?
return ($cmd_only) ?
$cmd : self::shell_exec('IDF_Scm_Svn::getFile', $cmd);
}
/**
* Subversion branches are folder based.
* Subversion branches are folder based.
*
* One need to list the folder to know them.
*/
}
/**
* Subversion tags are folder based.
* Subversion tags are folder based.
*
* One need to list the folder to know them.
*/
src/IDF/conf/idf.php-dist
7373
7474
7575
76
77
76
7877
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
7993
80
94
95
96
97
98
8199
82100
83101
$cfg['svn_repositories'] = 'file:///home/svn/repositories/%s';
$cfg['svn_remote_url'] = 'http://localhost/svn/%s';
# Same as for git, you can have multiple repositories, one for each
# project or a single one for all the projects.
# Path to the monotone binary
$cfg['mtn_path'] = 'mtn';
# Same as for git, you can have multiple repositories, one for each
# project or a single one for all the projects. Beware though that
# if you want to setup separate write access for the projects, you
# you have to setup different databases for each one.
#
# To access an mtn repository remotely you have two possibilities,
# via ssh and monotone's own netsync protocol. Usually each repository
# has to serve its contents in a separate process, but there exists a tool,
# called "usher", which acts as single entry point and distributes incoming
# requests further, based either on a particular branch pattern or configured
# host name (similar to SNI, the Server Name Indication, of TLS).
#
# A full HOWTO set this up is beyond this scope, please refer to the
# documentation of monotone and / or ask on their mailing list / IRC channel
# (irc.oftc.net/#monotone)
$cfg['mtn_repositories'] = '/home/mtn/repositories/%s.mtn';
$cfg['mtn_remote_url'] = 'mtn://localhost/~%s/%s';
# The preferred URL with which people can access this service. The placeholder
# denotes the unique project name which could be used as distinguishable SNI.
$cfg['mtn_remote_host'] = '%s.my.host.com';
# Possible values 'ssh' and 'netsync'
$cfg['mtn_remote_protocol'] = 'netsync';
# Mercurial repositories path
#$cfg['mercurial_repositories'] = '/home/mercurial/repositories/%s';
src/IDF/templates/idf/source/mtn/tree.html
4949
5050
5151
52
52
5353
5454
5555
{aurl 'url', 'IDF_Views_Source::download', array($project.shortname, $commit)}
<p class="right soft">
{* <a href="{$url}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/package-grey.png'}" alt="{trans 'Archive'}" align="bottom" /></a> <a href="{$url}">{trans 'Download this version'}</a> {trans 'or'} *}
<kbd>mtn clone {$project.getSourceAccessUrl($user)}</kbd> <a href="{url 'IDF_Views_Source::help', array($project.shortname)}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/help.png'}" alt="{trans 'Help'}" /></a>
<kbd>mtn clone {$project.getSourceAccessUrl($user, $commit)}</kbd> <a href="{url 'IDF_Views_Source::help', array($project.shortname)}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/help.png'}" alt="{trans 'Help'}" /></a>
</p>

Archive Download the corresponding diff file

Page rendered in 0.11465s using 13 queries.