mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-10 23:01:04 +01:00
Allow diffusion to load initial commits in Mercurial repositories
Summary: no parents - no problem - just diff that ish against "null" Test Plan: initial commits were viewable in my test repos Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T1689 Differential Revision: https://secure.phabricator.com/D3660
This commit is contained in:
parent
cbde56cdce
commit
6bbdd2609a
1 changed files with 21 additions and 0 deletions
|
@ -19,6 +19,27 @@
|
|||
final class DiffusionMercurialRawDiffQuery extends DiffusionRawDiffQuery {
|
||||
|
||||
protected function executeQuery() {
|
||||
$raw_diff = $this->executeRawDiffCommand();
|
||||
|
||||
// the only legitimate case here is if we are looking at the first commit
|
||||
// in the repository. no parents means first commit.
|
||||
if (!$raw_diff) {
|
||||
$drequest = $this->getRequest();
|
||||
$parent_query =
|
||||
DiffusionCommitParentsQuery::newFromDiffusionRequest($drequest);
|
||||
$parents = $parent_query->loadParents();
|
||||
if ($parents === array()) {
|
||||
// mercurial likes the string null here
|
||||
$this->setAgainstCommit('null');
|
||||
$raw_diff = $this->executeRawDiffCommand();
|
||||
}
|
||||
}
|
||||
|
||||
return $raw_diff;
|
||||
}
|
||||
|
||||
|
||||
protected function executeRawDiffCommand() {
|
||||
$drequest = $this->getRequest();
|
||||
$repository = $drequest->getRepository();
|
||||
|
||||
|
|
Loading…
Reference in a new issue