diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 30c04ffc92..78ae8bd461 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -13,7 +13,7 @@ return array( 'core.pkg.js' => '4c79d74f', 'darkconsole.pkg.js' => '1f9a31bc', 'differential.pkg.css' => '45951e9e', - 'differential.pkg.js' => 'ae6460e0', + 'differential.pkg.js' => '500a75c5', 'diffusion.pkg.css' => 'a2d17c7d', 'diffusion.pkg.js' => '6134c5a1', 'favicon.ico' => '30672e08', @@ -396,7 +396,7 @@ return array( 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 'rsrc/js/application/diff/DiffChangeset.js' => '99abf4cd', - 'rsrc/js/application/diff/DiffChangesetList.js' => '8f1cd52c', + 'rsrc/js/application/diff/DiffChangesetList.js' => '3b77efdd', 'rsrc/js/application/diff/DiffInline.js' => 'e83d28f3', 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07', @@ -775,7 +775,7 @@ return array( 'phabricator-darkmessage' => 'c48cccdd', 'phabricator-dashboard-css' => 'fe5b1869', 'phabricator-diff-changeset' => '99abf4cd', - 'phabricator-diff-changeset-list' => '8f1cd52c', + 'phabricator-diff-changeset-list' => '3b77efdd', 'phabricator-diff-inline' => 'e83d28f3', 'phabricator-drag-and-drop-file-upload' => '58dea2fa', 'phabricator-draggable-list' => 'bea6e7f4', @@ -1137,6 +1137,10 @@ return array( 'javelin-dom', 'javelin-magical-init', ), + '3b77efdd' => array( + 'javelin-install', + 'phuix-button-view', + ), '3cb0b2fc' => array( 'javelin-behavior', 'javelin-dom', @@ -1610,10 +1614,6 @@ return array( '8e1baf68' => array( 'phui-button-css', ), - '8f1cd52c' => array( - 'javelin-install', - 'phuix-button-view', - ), '8f29b364' => array( 'javelin-behavior', 'javelin-stratcom', diff --git a/scripts/mail/mail_handler.php b/scripts/mail/mail_handler.php index 2ff23adb0f..b76b3910df 100755 --- a/scripts/mail/mail_handler.php +++ b/scripts/mail/mail_handler.php @@ -35,16 +35,19 @@ $args->parse( $parser = new MimeMailParser(); $parser->setText(file_get_contents('php://stdin')); -$text_body = $parser->getMessageBody('text'); - -$text_body_headers = $parser->getMessageBodyHeaders('text'); -$content_type = idx($text_body_headers, 'content-type'); -if ( - !phutil_is_utf8($text_body) && - (preg_match('/charset="(.*?)"/', $content_type, $matches) || - preg_match('/charset=(\S+)/', $content_type, $matches)) -) { - $text_body = phutil_utf8_convert($text_body, 'UTF-8', $matches[1]); +$content = array(); +foreach (array('text', 'html') as $part) { + $part_body = $parser->getMessageBody($part); + $part_headers = $parser->getMessageBodyHeaders($part); + $content_type = idx($part_headers, 'content-type'); + if ( + !phutil_is_utf8($part_body) && + (preg_match('/charset="(.*?)"/', $content_type, $matches) || + preg_match('/charset=(\S+)/', $content_type, $matches)) + ) { + $part_body = phutil_utf8_convert($part_body, 'UTF-8', $matches[1]); + } + $content[$part] = $part_body; } $headers = $parser->getHeaders(); @@ -57,10 +60,7 @@ if ($args->getArg('process-duplicates')) { $received = new PhabricatorMetaMTAReceivedMail(); $received->setHeaders($headers); -$received->setBodies(array( - 'text' => $text_body, - 'html' => $parser->getMessageBody('html'), -)); +$received->setBodies($content); $attachments = array(); foreach ($parser->getAttachments() as $attachment) { diff --git a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php index 7ff886664f..0d00207b43 100644 --- a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php +++ b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php @@ -86,6 +86,7 @@ EOHELP array( '/\.py$/', '/\.l?hs$/', + '/\.ya?ml$/', )) ->setDescription( pht( diff --git a/src/applications/differential/view/DifferentialChangesetListView.php b/src/applications/differential/view/DifferentialChangesetListView.php index 307d424b0e..59f73b5465 100644 --- a/src/applications/differential/view/DifferentialChangesetListView.php +++ b/src/applications/differential/view/DifferentialChangesetListView.php @@ -301,6 +301,9 @@ final class DifferentialChangesetListView extends AphrontView { 'Hide or show all inline comments.' => pht('Hide or show all inline comments.'), + + 'Finish editing inline comments before changing display modes.' => + pht('Finish editing inline comments before changing display modes.'), ), )); diff --git a/src/applications/differential/xaction/DifferentialRevisionHoldDraftTransaction.php b/src/applications/differential/xaction/DifferentialRevisionHoldDraftTransaction.php index 5bc257ab62..2562f18209 100644 --- a/src/applications/differential/xaction/DifferentialRevisionHoldDraftTransaction.php +++ b/src/applications/differential/xaction/DifferentialRevisionHoldDraftTransaction.php @@ -16,6 +16,15 @@ final class DifferentialRevisionHoldDraftTransaction public function applyInternalEffects($object, $value) { $object->setHoldAsDraft($value); + + // If draft isn't the default state but we're creating a new revision + // and holding it as a draft, put it in draft mode. See PHI206. + // TODO: This can probably be removed once Draft is the universal default. + if ($this->isNewObject()) { + if ($object->isNeedsReview()) { + $object->setModernRevisionStatus(DifferentialRevisionStatus::DRAFT); + } + } } public function getTitle() { diff --git a/src/applications/repository/query/PhabricatorRepositoryQuery.php b/src/applications/repository/query/PhabricatorRepositoryQuery.php index ffa9fa1b59..035693ff75 100644 --- a/src/applications/repository/query/PhabricatorRepositoryQuery.php +++ b/src/applications/repository/query/PhabricatorRepositoryQuery.php @@ -425,6 +425,7 @@ final class PhabricatorRepositoryQuery 'type' => 'string', 'unique' => true, 'reverse' => true, + 'null' => 'tail', ), 'name' => array( 'table' => 'r', diff --git a/webroot/rsrc/js/application/diff/DiffChangesetList.js b/webroot/rsrc/js/application/diff/DiffChangesetList.js index 3f47f1ed35..ec0270ac12 100644 --- a/webroot/rsrc/js/application/diff/DiffChangesetList.js +++ b/webroot/rsrc/js/application/diff/DiffChangesetList.js @@ -465,7 +465,7 @@ JX.install('DiffChangesetList', { new JX.Notification() .setContent(message) .alterClassName('jx-notification-alert', true) - .setDuration(1000) + .setDuration(3000) .show(); }, @@ -691,6 +691,7 @@ JX.install('DiffChangesetList', { 'div', 'differential-changeset'); + var changeset_list = this; var changeset = this.getChangesetForNode(node); var menu = new JX.PHUIXDropdownMenu(button); @@ -738,6 +739,22 @@ JX.install('DiffChangesetList', { var up_item = new JX.PHUIXActionView() .setHandler(function(e) { if (changeset.isLoaded()) { + + // Don't let the user swap display modes if a comment is being + // edited, since they might lose their work. See PHI180. + var inlines = changeset.getInlines(); + for (var ii = 0; ii < inlines.length; ii++) { + if (inlines[ii].isEditing()) { + changeset_list._warnUser( + pht( + 'Finish editing inline comments before changing display ' + + 'modes.')); + e.prevent(); + menu.close(); + return; + } + } + var renderer = changeset.getRenderer(); if (renderer == '1up') { renderer = '2up';