diff --git a/src/applications/differential/mail/reviewrequest/DifferentialReviewRequestMail.php b/src/applications/differential/mail/reviewrequest/DifferentialReviewRequestMail.php index fac9fc6f79..3431d7dab4 100644 --- a/src/applications/differential/mail/reviewrequest/DifferentialReviewRequestMail.php +++ b/src/applications/differential/mail/reviewrequest/DifferentialReviewRequestMail.php @@ -112,6 +112,16 @@ abstract class DifferentialReviewRequestMail extends DifferentialMail { return $attachments; } + public function loadFileByPHID($phid) { + $file = id(new PhabricatorFile())->loadOneWhere( + 'phid = %s', + $phid); + if (!$file) { + return null; + } + return $file->loadFileData(); + } + private function buildPatch() { $revision = $this->getRevision(); $revision_id = $revision->getID(); @@ -133,6 +143,8 @@ abstract class DifferentialReviewRequestMail extends DifferentialMail { } $bundle = ArcanistBundle::newFromChanges($changes); + $bundle->setLoadFileDataCallback(array($this, 'loadFileByPHID')); + $format = PhabricatorEnv::getEnvConfig('metamta.differential.patch-format'); switch ($format) { case 'git': diff --git a/src/applications/differential/mail/reviewrequest/__init__.php b/src/applications/differential/mail/reviewrequest/__init__.php index 0c4c47cb38..708b7363e8 100644 --- a/src/applications/differential/mail/reviewrequest/__init__.php +++ b/src/applications/differential/mail/reviewrequest/__init__.php @@ -10,6 +10,7 @@ phutil_require_module('arcanist', 'parser/bundle'); phutil_require_module('arcanist', 'parser/diff/change'); phutil_require_module('phabricator', 'applications/differential/mail/base'); +phutil_require_module('phabricator', 'applications/files/storage/file'); phutil_require_module('phabricator', 'applications/metamta/storage/mail'); phutil_require_module('phabricator', 'applications/phid/handle/data'); phutil_require_module('phabricator', 'infrastructure/env');