From b02615bd5027ee51ac68d48a0a64306b75285789 Mon Sep 17 00:00:00 2001 From: Valerio Bozzolan Date: Sat, 24 Aug 2024 15:34:06 +0200 Subject: [PATCH] Subversion: fix empty "Authored on" date on commit pages Summary: Subversion does not allow to have local commits. So, manage this case. Closes T15612 Test Plan: Surf a git commit: nothing changed. Surf a svn commit: the "Authored on" date is not empty anymore. Reviewers: O1 Blessed Committers, aklapper Reviewed By: O1 Blessed Committers, aklapper Subscribers: aklapper, tobiaswiese, Matthew, Cigaryno Maniphest Tasks: T15612 Differential Revision: https://we.phorge.it/D25796 --- .../diffusion/controller/DiffusionCommitController.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php index ce3ef41c9e..1e2ec10847 100644 --- a/src/applications/diffusion/controller/DiffusionCommitController.php +++ b/src/applications/diffusion/controller/DiffusionCommitController.php @@ -624,6 +624,13 @@ final class DiffusionCommitController extends DiffusionController { $author_view = $commit->newCommitAuthorView($viewer); if ($author_view) { $author_date = $data->getAuthorEpoch(); + + // Add support to Subversion commits that only have one date, + // since in SVN you cannot prepare local commits to push them later. + if ($author_date === null) { + $author_date = $commit->getEpoch(); + } + $author_date = phabricator_datetime($author_date, $viewer); $provenance_list->addItem(