From 8b304870c4421e9dedcca58e39ffed478964ecf5 Mon Sep 17 00:00:00 2001 From: vrana Date: Wed, 7 Mar 2012 11:52:56 -0800 Subject: [PATCH] Use only the first line of update comment in revision history description Summary: More complicated updates deserves title and explanation. This diff uses only the first line from comment in diff's description. It also removes the truncating at 80 chars which looks as an error. Test Plan: var_dump(preg_replace('/\n.*/s', '', "abc")); var_dump(preg_replace('/\n.*/s', '', "abc\ndef")); var_dump(preg_replace('/\n.*/s', '', "abc\ndef")); var_dump(preg_replace('/\n.*/s', '', "abc\ndef\nghi")); var_dump(preg_replace('/\n.*/s', '', "\nabc")); // empty string Display revision with 255 chars description in update history - it looks OK. Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1812 --- .../differential/editor/revision/DifferentialRevisionEditor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/differential/editor/revision/DifferentialRevisionEditor.php b/src/applications/differential/editor/revision/DifferentialRevisionEditor.php index d1b7920e5b..93e1f40f70 100644 --- a/src/applications/differential/editor/revision/DifferentialRevisionEditor.php +++ b/src/applications/differential/editor/revision/DifferentialRevisionEditor.php @@ -373,7 +373,7 @@ class DifferentialRevisionEditor { // Save the changes we made above. - $diff->setDescription(substr($this->getComments(), 0, 80)); + $diff->setDescription(preg_replace('/\n.*/s', '', $this->getComments())); $diff->save(); $this->updateAffectedPathTable($revision, $diff, $changesets);