Indefero

Indefero Commit Details


Date:2011-03-16 17:03:36 (13 years 9 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, release-1.1, release-1.2, release-1.3
Commit:6fb9b72e22e3d14b3eb4364ee857b42d905c97c9
Parents: b75884c57e654a5057470e7a8141d78e55103941
Message:Use git tag --contains REV for the IDF_Scm::inTags() implementation.

This works similar to git branch --contains REV; additionally give the
revision id and not some possibly symbolic name to the inBranches()
call when we determine the branches a commit is in.
Changes:

File differences

NEWS.mdtext
5252
5353
5454
55
5556
5657
5758
- Disable browser autocomplete of password fields in the account settings (issue 616)
- Improvements in the automatic linker parser (issue 618)
- The `createIssue` API method did not check the API authentication (issue 619)
- Print active git branch heads and tags in bold
## Documentation
src/IDF/Scm/Git.php
6262
6363
6464
65
65
6666
6767
6868
6969
7070
7171
72
73
72
73
7474
7575
7676
7777
78
78
7979
8080
8181
......
8888
8989
9090
91
91
9292
9393
94
94
9595
9696
9797
......
170170
171171
172172
173
173
174174
175175
176176
......
187187
188188
189189
190
190
191191
192
192
193193
194194
195195
......
238238
239239
240240
241
242
241
242
243
243244
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
245
246
247
248
249
250
251
252
253
254
263255
264
265
266
267
256
257
258
259
268260
269
261
262
263
270264
271265
272266
......
368362
369363
370364
371
372
365
366
373367
374368
375369
......
527521
528522
529523
530
524
531525
532526
533527
$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];
if ($action == 'A') {
$filename = trim(substr($line, 1));
$return->additions[] = $filename;
} else if ($action == 'R') {
$matches = split ("\t", $line);
$return->renames[$matches[1]] = $matches[2];
}
}
}
}
return $return;
}
if (isset($this->cache['inBranches'][$commit])) {
return $this->cache['inBranches'][$commit];
}
$cmd = Pluf::f('idf_exec_cmd_prefix', '')
.sprintf('GIT_DIR=%s %s branch --contains %s',
escapeshellarg($this->repo),
foreach ($out as $line) {
$res[] = substr($line, 2);
}
$this->cache['inBranches'][$commit] = $res;
return $res;
return $res;
}
/**
**/
public function inTags($commit, $path)
{
return $this->_inObject($commit, 'tag');
}
if (isset($this->cache['inTags'][$commit])) {
return $this->cache['inTags'][$commit];
}
/**
* Returns in which branches or tags a commit is.
*
* @param string Commit
* @param string Object's type: 'branch' or 'tag'.
* @return array
*/
private function _inObject($commit, $object)
{
$object = strtolower($object);
if ('branch' === $object) {
$objects = $this->getBranches();
} else if ('tag' === $object) {
$objects = $this->getTags();
} else {
throw new InvalidArgumentException(sprintf(__('Invalid value for the parameter %1$s: %2$s. Use %3$s.'),
'$object',
$object,
'\'branch\' or \'tag\''));
$cmd = Pluf::f('idf_exec_cmd_prefix', '')
.sprintf('GIT_DIR=%s %s tag --contains %s',
escapeshellarg($this->repo),
Pluf::f('git_path', 'git'),
escapeshellarg($commit));
self::exec('IDF_Scm_Git::inTags', $cmd, $out, $return);
if (0 != $return) {
throw new IDF_Scm_Exception(sprintf($this->error_tpl,
$cmd, $return,
implode("\n", $out)));
}
unset($object);
$result = array();
if (array_key_exists($commit, $objects)) {
$result[] = $commit;
$res = array();
foreach ($out as $line) {
$res[] = $line;
}
return $result;
$this->cache['inTags'][$commit] = $res;
return $res;
}
/**
$keys = $user->get_idf_key_list();
if (count ($keys) == 0)
return self::getAnonymousAccessUrl($project);
}
}
return sprintf(Pluf::f('git_write_remote_url'), $project->shortname);
}
$out[0]->diff = '';
}
$out[0]->branch = implode(', ', $this->inBranches($commit, null));
$out[0]->branch = implode(', ', $this->inBranches($out[0]->commit, null));
return $out[0];
}

Archive Download the corresponding diff file

Page rendered in 0.08906s using 13 queries.