@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.

Support content pre-commit hooks in Mercurial

Summary: Ref T4195. Add Mercurial support to the content hook phase.

Test Plan:
Here are some `commit` push logs for a Mercurial repo:

{F90689}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4195

Differential Revision: https://secure.phabricator.com/D7792

+12 -2
+12 -2
src/applications/diffusion/engine/DiffusionCommitHookEngine.php
··· 25 25 private $remoteProtocol; 26 26 private $transactionKey; 27 27 private $mercurialHook; 28 + private $mercurialCommits = array(); 28 29 29 30 private $heraldViewerProjects; 30 31 ··· 578 579 579 580 list($commit_raw) = $futures['commits']->resolvex(); 580 581 $commit_map = $this->parseMercurialCommits($commit_raw); 582 + $this->mercurialCommits = $commit_map; 581 583 582 584 list($old_raw) = $futures['old']->resolvex(); 583 585 $old_refs = $this->parseMercurialHeads($old_raw); ··· 797 799 } 798 800 799 801 private function findMercurialContentUpdates(array $ref_updates) { 800 - // TODO: Implement. 801 - return array(); 802 + $content_updates = array(); 803 + 804 + foreach ($this->mercurialCommits as $commit => $branches) { 805 + $content_updates[$commit] = $this->newPushLog() 806 + ->setRefType(PhabricatorRepositoryPushLog::REFTYPE_COMMIT) 807 + ->setRefNew($commit) 808 + ->setChangeFlags(PhabricatorRepositoryPushLog::CHANGEFLAG_ADD); 809 + } 810 + 811 + return $content_updates; 802 812 } 803 813 804 814 private function parseMercurialCommits($raw) {