Indefero

Indefero Commit Details


Date:2011-03-17 20:47:08 (13 years 9 months ago)
Author:Matías Halles
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:5fc3a987def871a246d42affdaa30aefeb321e07
Parents: be39d72d3c2823d9696561d1f3eef8cc13276fa6
Message:Mercurial log template and parseLog pattern modification.

Added a template for getting a controlled log; in parseLog, changed the regular
expression to match the pattern used in the template (fixes issues 507 and 508).
Changes:

File differences

AUTHORS
1414
1515
1616
17
1718
1819
1920
David Feeney
Patrick Georgi <patrick.georgi@coresystems.de>
Ciaran Gultnieks
Matías Halles <matias@halles.cl>
Julien Issler
Jerry <lxb429@gmail.com> - Chinese translation
Benjamin Jorand <benjamin.jorand@gmail.com> - Mercurial support
NEWS.mdtext
3535
3636
3737
38
3839
3940
4041
- Sort the project list by the display name of the project (issue 477)
- Project creation form now has a short description field as well (issue 479)
- Add more file extensions supported by our in-tree prettify version (issues 490 and 567)
- Improve the parsing of hg's log output (issues 507 and 508)
- Do not clean `<ins>` and `<del>` HTML markup from user input (issue 509)
- Improve HTML validation by switching from `strict` to `transitional` DOCTYPE (issue 511)
- Ignore XML parsing problems when trying to retrieve commit messages for svn (issue 518)
src/IDF/Scm/Mercurial.php
2727
2828
2929
30
31
3032
3133
3234
3335
36
3437
3538
3639
......
336339
337340
338341
339
340
342
343
344
341345
342
346
347
348
349
343350
344351
345352
......
356363
357364
358365
359
366
360367
361368
362369
......
381388
382389
383390
384
391
385392
386393
387394
388
395
389396
390397
391398
......
421428
422429
423430
424
431
425432
426433
427434
*/
class IDF_Scm_Mercurial extends IDF_Scm
{
protected $hg_log_template;
public function __construct($repo, $project=null)
{
$this->repo = $repo;
$this->project = $project;
$this->hg_log_template = "'".'changeset: {rev}:{node|short}\nauthor: {author}\ndate: {date|isodate}\nfiles: {files}\n{desc}\n'."'";
}
public function getRepositorySize()
if (!$this->isValidRevision($commit)) {
return false;
}
$tmpl = ($getdiff) ?
Pluf::f('hg_path', 'hg').' log -p -r %s -R %s' : Pluf::f('hg_path', 'hg').' log -r %s -R %s';
$tmpl = ($getdiff)
? Pluf::f('hg_path', 'hg').' log -p -r %s -R %s --template %s'
: Pluf::f('hg_path', 'hg').' log -r %s -R %s --template %s';
$cmd = sprintf($tmpl,
escapeshellarg($commit), escapeshellarg($this->repo));
escapeshellarg($commit),
escapeshellarg($this->repo),
$this->hg_log_template);
$out = array();
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
self::exec('IDF_Scm_Mercurial::getCommit', $cmd, $out);
$log[] = $line;
}
}
$out = self::parseLog($log, 6);
$out = self::parseLog($log, 4);
$out[0]->diff = implode("\n", $change);
return $out[0];
}
*/
public function getChangeLog($commit='tip', $n=10)
{
$cmd = sprintf(Pluf::f('hg_path', 'hg').' log -R %s -l%s ', escapeshellarg($this->repo), $n, $commit);
$cmd = sprintf(Pluf::f('hg_path', 'hg').' log -R %s -l%s --template %s', escapeshellarg($this->repo), $n, $this->hg_log_template, $commit);
$out = array();
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
self::exec('IDF_Scm_Mercurial::getChangeLog', $cmd, $out);
return self::parseLog($out, 6);
return self::parseLog($out, 4);
}
/**
continue;
}
$match = array();
if (preg_match('/(\S+)\s*:\s*(.*)/', $line, $match)) {
if (preg_match('/^(\S+):\s*(.*)/', $line, $match)) {
$match[1] = strtolower($match[1]);
if ($match[1] == 'user') {
$c['author'] = $match[2];

Archive Download the corresponding diff file

Page rendered in 0.08430s using 15 queries.