mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-25 14:08:19 +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 {
|
final class DiffusionMercurialRawDiffQuery extends DiffusionRawDiffQuery {
|
||||||
|
|
||||||
protected function executeQuery() {
|
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();
|
$drequest = $this->getRequest();
|
||||||
$repository = $drequest->getRepository();
|
$repository = $drequest->getRepository();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue