@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+21
+21
src/applications/diffusion/query/rawdiff/DiffusionMercurialRawDiffQuery.php
··· 19 19 final class DiffusionMercurialRawDiffQuery extends DiffusionRawDiffQuery { 20 20 21 21 protected function executeQuery() { 22 + $raw_diff = $this->executeRawDiffCommand(); 23 + 24 + // the only legitimate case here is if we are looking at the first commit 25 + // in the repository. no parents means first commit. 26 + if (!$raw_diff) { 27 + $drequest = $this->getRequest(); 28 + $parent_query = 29 + DiffusionCommitParentsQuery::newFromDiffusionRequest($drequest); 30 + $parents = $parent_query->loadParents(); 31 + if ($parents === array()) { 32 + // mercurial likes the string null here 33 + $this->setAgainstCommit('null'); 34 + $raw_diff = $this->executeRawDiffCommand(); 35 + } 36 + } 37 + 38 + return $raw_diff; 39 + } 40 + 41 + 42 + protected function executeRawDiffCommand() { 22 43 $drequest = $this->getRequest(); 23 44 $repository = $drequest->getRepository(); 24 45