1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +01:00

Provide api to get committed data in a hook

Summary:
We have a linter that needs to read data from the repo that isn't in the commit,
so that data isn't part of the svn transaction, thus not available in svnlook
cat --transaction. This change provides a method to get data from a committed
file.

Test Plan:
Successfully ran arc svn-hook-pre-commit with a linter that needs something
not in the transaction.

Reviewers: epriestley, jungejason, vrana

Reviewed By: epriestley

CC: aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2582
This commit is contained in:
Nick Harper 2012-05-25 15:28:45 -07:00
parent 051cbcb8e9
commit c51590dc1e
2 changed files with 9 additions and 0 deletions

View file

@ -21,4 +21,5 @@
*/
abstract class ArcanistHookAPI {
abstract public function getCurrentFileData($path);
abstract public function getUpstreamFileData($path);
}

View file

@ -40,4 +40,12 @@ final class ArcanistSubversionHookAPI extends ArcanistHookAPI {
return ($err? null : $file);
}
public function getUpstreamFileData($path) {
list($err, $file) = exec_manual(
'svnlook cat %s %s',
$this->repository,
$this->root."/$path");
return ($err ? null : $file);
}
}