mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 05:50:55 +01:00
Add Subversion ref and content logs to pre-commit hooks
Summary: Ref T4195. SVN has no such thing as refs (I was thinking about writing a quasi-ref anyway like `HEAD: r23 -> r24`, but I'm not sure it would actually be useful). And content is very easy to build. Test Plan: Pushed some stuff to SVN, got logs from it. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T4195 Differential Revision: https://secure.phabricator.com/D7766
This commit is contained in:
parent
11b8e57ae0
commit
2216a5e6ef
2 changed files with 16 additions and 4 deletions
|
@ -733,13 +733,26 @@ final class DiffusionCommitHookEngine extends Phobject {
|
|||
|
||||
|
||||
private function findSubversionRefUpdates() {
|
||||
// TODO: Implement.
|
||||
// Subversion doesn't have any kind of mutable ref metadata.
|
||||
return array();
|
||||
}
|
||||
|
||||
private function findSubversionContentUpdates(array $ref_updates) {
|
||||
// TODO: Implement.
|
||||
return array();
|
||||
list($youngest) = execx(
|
||||
'svnlook youngest %s',
|
||||
$this->subversionRepository);
|
||||
$ref_new = (int)$youngest + 1;
|
||||
|
||||
$ref_flags = 0;
|
||||
$ref_flags |= PhabricatorRepositoryPushLog::CHANGEFLAG_ADD;
|
||||
$ref_flags |= PhabricatorRepositoryPushLog::CHANGEFLAG_APPEND;
|
||||
|
||||
$ref_content = $this->newPushLog()
|
||||
->setRefType(PhabricatorRepositoryPushLog::REFTYPE_COMMIT)
|
||||
->setRefNew($ref_new)
|
||||
->setChangeFlags($ref_flags);
|
||||
|
||||
return array($ref_content);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ final class PhabricatorRepositoryPushLog
|
|||
const REFTYPE_BRANCH = 'branch';
|
||||
const REFTYPE_TAG = 'tag';
|
||||
const REFTYPE_BOOKMARK = 'bookmark';
|
||||
const REFTYPE_SVN = 'svn';
|
||||
const REFTYPE_COMMIT = 'commit';
|
||||
|
||||
const CHANGEFLAG_ADD = 1;
|
||||
|
|
Loading…
Reference in a new issue