mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-26 00:32:41 +01:00
Correctly implement getFileDataAtRevision()
Summary: Apparently I just never tested this or something. Make it work correctly. Test Plan: Ran "arc diff" in a Mercurial working copy with a binary file in outgoing. Reviewers: Makinde Reviewed By: Makinde CC: aran, Makinde Differential Revision: 1074
This commit is contained in:
parent
c53a43f54d
commit
59cd94d8eb
1 changed files with 8 additions and 2 deletions
|
@ -269,12 +269,18 @@ class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
|
|||
}
|
||||
|
||||
private function getFileDataAtRevision($path, $revision) {
|
||||
list($stdout) = execx(
|
||||
list($err, $stdout) = exec_manual(
|
||||
'(cd %s && hg cat --rev %s -- %s)',
|
||||
$this->getPath(),
|
||||
$revision,
|
||||
$path);
|
||||
if ($err) {
|
||||
// Assume this is "no file at revision", i.e. a deleted or added file.
|
||||
return null;
|
||||
} else {
|
||||
return $stdout;
|
||||
}
|
||||
}
|
||||
|
||||
private function getWorkingCopyRevision() {
|
||||
// In Mercurial, "tip" means the tip of the current branch, not what's in
|
||||
|
|
Loading…
Reference in a new issue