diff --git a/support/aphlict/client/build_aphlict_client.sh b/support/aphlict/client/build_aphlict_client.sh index 0d2e4ae122..a9a324052a 100755 --- a/support/aphlict/client/build_aphlict_client.sh +++ b/support/aphlict/client/build_aphlict_client.sh @@ -12,8 +12,6 @@ set -e $MXMLC \ -output=$ROOT/webroot/rsrc/swf/aphlict.swf \ - -default-background-color=0x444444 \ - -default-size=500,500 \ -warnings=true \ -source-path=$ROOT/externals/vegas/src \ -static-link-runtime-shared-libraries=true \ -- 2.51.2 From 323c529c3bac2ec6f6c8eebb273a53254d9ad5b3 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Fri, 30 May 2014 09:48:03 -0700 Subject: [PATCH 02/14] Allow the notifications from Aphlict debug messages to expire. Summary: Currently, debugging (log) messages from the Aphlict client trigger a visible notification in the web UI (when `notification.debug` is enabled). After D9327, the log messages can be quite verbose and seem to "block" legitimate notifications because they are not automatically dismissed. Test Plan: Enabled `notification.debug` and observed that the debugging notifications expired and closed after a few seconds. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D9339 --- resources/celerity/map.php | 32 +++++++++---------- .../aphlict/behavior-aphlict-listen.js | 1 - 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 28c802f2ab..d1da88183c 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -8,7 +8,7 @@ return array( 'names' => array( 'core.pkg.css' => '8ecc2a14', - 'core.pkg.js' => '7db41c19', + 'core.pkg.js' => '639b2433', 'darkconsole.pkg.js' => 'ca8671ce', 'differential.pkg.css' => 'fbf57382', 'differential.pkg.js' => 'f4c86691', @@ -344,7 +344,7 @@ return array( 'rsrc/image/texture/table_header_tall.png' => 'd56b434f', 'rsrc/js/application/aphlict/Aphlict.js' => '493665ee', 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => '2a2dba85', - 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => '0a6c2de6', + 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => '9aa97ab6', 'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18', 'rsrc/js/application/config/behavior-reorder-fields.js' => '938aed89', 'rsrc/js/application/conpherence/behavior-menu.js' => '7ee23816', @@ -482,7 +482,7 @@ return array( 'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8', 'rsrc/js/phuix/PHUIXActionView.js' => '6e8cefa4', 'rsrc/js/phuix/PHUIXDropdownMenu.js' => 'bd4c8dca', - 'rsrc/swf/aphlict.swf' => '731d14a6', + 'rsrc/swf/aphlict.swf' => 'f22c1e40', ), 'symbols' => array( @@ -532,7 +532,7 @@ return array( 'javelin-aphlict' => '493665ee', 'javelin-behavior' => '8a3ed18b', 'javelin-behavior-aphlict-dropdown' => '2a2dba85', - 'javelin-behavior-aphlict-listen' => '0a6c2de6', + 'javelin-behavior-aphlict-listen' => '9aa97ab6', 'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884', 'javelin-behavior-aphront-crop' => 'b98fc918', 'javelin-behavior-aphront-drag-and-drop-textarea' => '4a11ea9c', @@ -891,18 +891,6 @@ return array( 3 => 'javelin-dom', 4 => 'javelin-router', ), - '0a6c2de6' => - array( - 0 => 'javelin-behavior', - 1 => 'javelin-aphlict', - 2 => 'javelin-stratcom', - 3 => 'javelin-request', - 4 => 'javelin-uri', - 5 => 'javelin-dom', - 6 => 'javelin-json', - 7 => 'javelin-router', - 8 => 'phabricator-notification', - ), '0c33c1a0' => array( 0 => 'javelin-view', @@ -1539,6 +1527,18 @@ return array( 3 => 'javelin-dom', 4 => 'phabricator-draggable-list', ), + '9aa97ab6' => + array( + 0 => 'javelin-behavior', + 1 => 'javelin-aphlict', + 2 => 'javelin-stratcom', + 3 => 'javelin-request', + 4 => 'javelin-uri', + 5 => 'javelin-dom', + 6 => 'javelin-json', + 7 => 'javelin-router', + 8 => 'phabricator-notification', + ), '9b9197be' => array( 0 => 'javelin-behavior', diff --git a/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js b/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js index b576b51884..5fc15968d1 100644 --- a/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js +++ b/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js @@ -41,7 +41,6 @@ JX.behavior('aphlict-listen', function(config) { new JX.Notification() .setContent('(Aphlict) [' + type + '] ' + details) .alterClassName('jx-notification-debug', true) - .setDuration(0) .show(); } } -- 2.51.2 From 851794e895e4fc3788beb476cd9962bc5571e11c Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 30 May 2014 10:07:33 -0700 Subject: [PATCH 03/14] Fix a JS issue in Paste Summary: Fixes T5227. --- resources/celerity/map.php | 18 +++++++++--------- webroot/rsrc/js/core/behavior-line-linker.js | 8 +++++++- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index d1da88183c..acc2fde13a 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -460,7 +460,7 @@ return array( 'rsrc/js/core/behavior-keyboard-shortcuts.js' => 'd75709e6', 'rsrc/js/core/behavior-konami.js' => '5bc2cb21', 'rsrc/js/core/behavior-lightbox-attachments.js' => '3aa45ad9', - 'rsrc/js/core/behavior-line-linker.js' => '0969ff43', + 'rsrc/js/core/behavior-line-linker.js' => 'f726d506', 'rsrc/js/core/behavior-more.js' => '9b9197be', 'rsrc/js/core/behavior-object-selector.js' => 'e6f67523', 'rsrc/js/core/behavior-oncopy.js' => 'c3e218fe', @@ -601,7 +601,7 @@ return array( 'javelin-behavior-phabricator-hovercards' => '9c808199', 'javelin-behavior-phabricator-keyboard-pager' => 'b657bdf8', 'javelin-behavior-phabricator-keyboard-shortcuts' => 'd75709e6', - 'javelin-behavior-phabricator-line-linker' => '0969ff43', + 'javelin-behavior-phabricator-line-linker' => 'f726d506', 'javelin-behavior-phabricator-nav' => 'b5842a5e', 'javelin-behavior-phabricator-notification-example' => 'c51a6616', 'javelin-behavior-phabricator-object-selector' => 'e6f67523', @@ -864,13 +864,6 @@ return array( array( 0 => 'javelin-install', ), - '0969ff43' => - array( - 0 => 'javelin-behavior', - 1 => 'javelin-stratcom', - 2 => 'javelin-dom', - 3 => 'javelin-history', - ), '09b15cf1' => array( 0 => 'javelin-stratcom', @@ -1994,6 +1987,13 @@ return array( 2 => 'javelin-util', 3 => 'javelin-reactor', ), + 'f726d506' => + array( + 0 => 'javelin-behavior', + 1 => 'javelin-stratcom', + 2 => 'javelin-dom', + 3 => 'javelin-history', + ), 'f7379f45' => array( 0 => 'javelin-behavior', diff --git a/webroot/rsrc/js/core/behavior-line-linker.js b/webroot/rsrc/js/core/behavior-line-linker.js index 2a564b7125..7e50e5c38c 100644 --- a/webroot/rsrc/js/core/behavior-line-linker.js +++ b/webroot/rsrc/js/core/behavior-line-linker.js @@ -10,7 +10,13 @@ JX.behavior('phabricator-line-linker', function() { var origin = null; var target = null; var root = null; - var editor_link = JX.$('editor_link'); + + var editor_link = null; + try { + editor_link = JX.$('editor_link'); + } catch (ex) { + // Ignore. + } function getRowNumber(tr) { var th = JX.DOM.find(tr, 'th', 'phabricator-source-line'); -- 2.51.2 From c8ee8d8ae939800ad3d85b9b451eda1c331628fd Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 30 May 2014 11:33:11 -0700 Subject: [PATCH 04/14] Fix routes for MetaMTA Summary: This no longer has a base URI since it's not accessible. --- .../metamta/application/PhabricatorApplicationMetaMTA.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/metamta/application/PhabricatorApplicationMetaMTA.php b/src/applications/metamta/application/PhabricatorApplicationMetaMTA.php index 70605eb1a1..9b20056832 100644 --- a/src/applications/metamta/application/PhabricatorApplicationMetaMTA.php +++ b/src/applications/metamta/application/PhabricatorApplicationMetaMTA.php @@ -32,7 +32,7 @@ final class PhabricatorApplicationMetaMTA extends PhabricatorApplication { public function getRoutes() { return array( - $this->getBaseURI() => array( + '/mail/' => array( 'sendgrid/' => 'PhabricatorMetaMTASendGridReceiveController', 'mailgun/' => 'PhabricatorMetaMTAMailgunReceiveController', ), -- 2.51.2 From 8ea9935ea5c2b9d7066ea8f96031fb3fd7d4ed8c Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 2 Jun 2014 15:25:28 -0700 Subject: [PATCH 05/14] Deduplicate parents from PhabricatorGitGraphStream Summary: Fixes T5226. It's rare (but possible) for a commit to have the same parent more than once in Git. Test Plan: Ran `bin/repository parents` on a normal repository. Reviewers: joshuaspence Reviewed By: joshuaspence Subscribers: epriestley Maniphest Tasks: T5226 Differential Revision: https://secure.phabricator.com/D9344 --- .../repository/daemon/PhabricatorGitGraphStream.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/applications/repository/daemon/PhabricatorGitGraphStream.php b/src/applications/repository/daemon/PhabricatorGitGraphStream.php index 5cbac88a7e..9133983677 100644 --- a/src/applications/repository/daemon/PhabricatorGitGraphStream.php +++ b/src/applications/repository/daemon/PhabricatorGitGraphStream.php @@ -29,7 +29,12 @@ final class PhabricatorGitGraphStream if (!isset($this->parents[$commit])) { $this->parseUntil($commit); } - return $this->parents[$commit]; + $parents = $this->parents[$commit]; + + // NOTE: In Git, it is possible for a commit to list the same parent more + // than once. See T5226. Discard duplicate parents. + + return array_unique($parents); } public function getCommitDate($commit) { -- 2.51.2 From 1e2a592ceb3624035aedb719366a2bddd1270389 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Mon, 2 Jun 2014 16:58:48 -0700 Subject: [PATCH 06/14] Expose "Abandon Revision" to non-authors with a config flag. Summary: Fixes T4720. Allows non-authors to permanently reject a differential by exposing the "Abandon Revision" action via a configuration flag. Test Plan: {F161434} Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T4720 Differential Revision: https://secure.phabricator.com/D9306 --- conf/default.conf.php | 4 ++++ .../config/PhabricatorDifferentialConfigOptions.php | 11 +++++++++++ .../controller/DifferentialRevisionViewController.php | 5 +++++ .../editor/DifferentialTransactionEditor.php | 5 ++++- 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/conf/default.conf.php b/conf/default.conf.php index e441e130da..8895942921 100644 --- a/conf/default.conf.php +++ b/conf/default.conf.php @@ -811,6 +811,10 @@ return array( // only the submitter can close a revision. 'differential.always-allow-close' => false, + // If you set this to true, any user can abandon any revision. If false, only + // the submitter can abandon a revision. + 'differential.always-allow-abandon' => false, + // If you set this to true, any user can reopen a revision so long as it has // been closed. This can be useful if a revision is accidentally closed or // if a developer changes his or her mind after closing a revision. If it is diff --git a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php index a0c0f4e914..61832ae125 100644 --- a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php +++ b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php @@ -165,6 +165,17 @@ final class PhabricatorDifferentialConfigOptions "where the reviewer is often the actual committer can benefit ". "from turning this option to true. If false, only the submitter ". "can close a revision.")), + $this->newOption('differential.always-allow-abandon', 'bool', false) + ->setBoolOptions( + array( + pht('Allow any user'), + pht('Restrict to submitter'), + )) + ->setSummary(pht('Allows any user to abandon revisions.')) + ->setDescription( + pht( + 'If you set this to true, any user can abandon any revision. If '. + 'false, only the submitter can abandon a revision.')), $this->newOption('differential.allow-reopen', 'bool', false) ->setBoolOptions( array( diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php index c45b4197ac..f92014aeab 100644 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -553,6 +553,8 @@ final class DifferentialRevisionViewController extends DifferentialController { $allow_self_accept = PhabricatorEnv::getEnvConfig( 'differential.allow-self-accept'); + $always_allow_abandon = PhabricatorEnv::getEnvConfig( + 'differential.always-allow-abandon'); $always_allow_close = PhabricatorEnv::getEnvConfig( 'differential.always-allow-close'); $allow_reopen = PhabricatorEnv::getEnvConfig( @@ -586,17 +588,20 @@ final class DifferentialRevisionViewController extends DifferentialController { } else { switch ($status) { case ArcanistDifferentialRevisionStatus::NEEDS_REVIEW: + $actions[DifferentialAction::ACTION_ABANDON] = $always_allow_abandon; $actions[DifferentialAction::ACTION_ACCEPT] = true; $actions[DifferentialAction::ACTION_REJECT] = true; $actions[DifferentialAction::ACTION_RESIGN] = $viewer_is_reviewer; break; case ArcanistDifferentialRevisionStatus::NEEDS_REVISION: case ArcanistDifferentialRevisionStatus::CHANGES_PLANNED: + $actions[DifferentialAction::ACTION_ABANDON] = $always_allow_abandon; $actions[DifferentialAction::ACTION_ACCEPT] = true; $actions[DifferentialAction::ACTION_REJECT] = !$viewer_has_rejected; $actions[DifferentialAction::ACTION_RESIGN] = $viewer_is_reviewer; break; case ArcanistDifferentialRevisionStatus::ACCEPTED: + $actions[DifferentialAction::ACTION_ABANDON] = $always_allow_abandon; $actions[DifferentialAction::ACTION_ACCEPT] = !$viewer_has_accepted; $actions[DifferentialAction::ACTION_REJECT] = true; $actions[DifferentialAction::ACTION_RESIGN] = $viewer_is_reviewer; diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php index c26899e4ea..221f79d963 100644 --- a/src/applications/differential/editor/DifferentialTransactionEditor.php +++ b/src/applications/differential/editor/DifferentialTransactionEditor.php @@ -789,6 +789,9 @@ final class DifferentialTransactionEditor $actor_phid = $this->getActor()->getPHID(); $actor_is_author = ($author_phid == $actor_phid); + $config_abandon_key = 'differential.always-allow-abandon'; + $always_allow_abandon = PhabricatorEnv::getEnvConfig($config_abandon_key); + $config_close_key = 'differential.always-allow-close'; $always_allow_close = PhabricatorEnv::getEnvConfig($config_close_key); @@ -860,7 +863,7 @@ final class DifferentialTransactionEditor break; case DifferentialAction::ACTION_ABANDON: - if (!$actor_is_author) { + if (!$actor_is_author && !$always_allow_abandon) { return pht( "You can not abandon this revision because you do not own it. ". "You can only abandon revisions you own."); -- 2.51.2 From c2eff7c2163c216b81e1c7730f2c813a94af64d5 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Mon, 2 Jun 2014 17:10:29 -0700 Subject: [PATCH 07/14] Allow projects to be deleted with `./bin/remove destroy`. Summary: Fixes T5235. Implement `PhabricatorDestructableInterface` on `PhabricatorProject` so that projects can be deleted with `./bin/remove destroy`. Test Plan: Created (and then destroyed) a test project. Verified that the corresponding objects (project, slugs and workboard columns) were removed from the database. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Maniphest Tasks: T5235 Differential Revision: https://secure.phabricator.com/D9352 --- .../project/storage/PhabricatorProject.php | 26 ++++++++++++++++++- .../storage/PhabricatorProjectColumn.php | 14 +++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/applications/project/storage/PhabricatorProject.php b/src/applications/project/storage/PhabricatorProject.php index ecdd28f31c..e7c56f2e04 100644 --- a/src/applications/project/storage/PhabricatorProject.php +++ b/src/applications/project/storage/PhabricatorProject.php @@ -5,7 +5,8 @@ final class PhabricatorProject extends PhabricatorProjectDAO PhabricatorFlaggableInterface, PhabricatorPolicyInterface, PhabricatorSubscribableInterface, - PhabricatorCustomFieldInterface { + PhabricatorCustomFieldInterface, + PhabricatorDestructableInterface { protected $name; protected $status = PhabricatorProjectStatus::STATUS_ACTIVE; @@ -247,4 +248,27 @@ final class PhabricatorProject extends PhabricatorProjectDAO } +/* -( PhabricatorDestructableInterface )----------------------------------- */ + + public function destroyObjectPermanently( + PhabricatorDestructionEngine $engine) { + + $this->openTransaction(); + $this->delete(); + + $columns = id(new PhabricatorProjectColumn()) + ->loadAllWhere('projectPHID = %s', $this->getPHID()); + foreach ($columns as $column) { + $engine->destroyObject($column); + } + + $slugs = id(new PhabricatorProjectSlug()) + ->loadAllWhere('projectPHID = %s', $this->getPHID()); + foreach ($slugs as $slug) { + $slug->delete(); + } + + $this->saveTransaction(); + } + } diff --git a/src/applications/project/storage/PhabricatorProjectColumn.php b/src/applications/project/storage/PhabricatorProjectColumn.php index e79443c22a..439e1ea13b 100644 --- a/src/applications/project/storage/PhabricatorProjectColumn.php +++ b/src/applications/project/storage/PhabricatorProjectColumn.php @@ -2,7 +2,8 @@ final class PhabricatorProjectColumn extends PhabricatorProjectDAO - implements PhabricatorPolicyInterface { + implements PhabricatorPolicyInterface, + PhabricatorDestructableInterface { const STATUS_ACTIVE = 0; const STATUS_DELETED = 1; @@ -87,4 +88,15 @@ final class PhabricatorProjectColumn return pht('Users must be able to see a project to see its board.'); } + +/* -( PhabricatorDestructableInterface )----------------------------------- */ + + public function destroyObjectPermanently( + PhabricatorDestructionEngine $engine) { + + $this->openTransaction(); + $this->delete(); + $this->saveTransaction(); + } + } -- 2.51.2 From 0d03bbe43cf758a8b1317a5315caa7fbae3d67d6 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Mon, 2 Jun 2014 17:11:58 -0700 Subject: [PATCH 08/14] Allow repositories to be deleted using `./bin/remove`. Summary: Currently, repositories can be deleted using `./bin/repository delete`. It makes sense to expose this operate to the `./bin/remove` script as well, for consistency. Test Plan: Deleted a repository with `./bin/remove rTEST`. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D9350 --- src/__phutil_library_map__.php | 3 +- ...iffusionRepositoryEditDeleteController.php | 2 +- ...atorRepositoryManagementDeleteWorkflow.php | 64 ------------------- .../storage/PhabricatorRepository.php | 14 +++- 4 files changed, 15 insertions(+), 68 deletions(-) delete mode 100644 src/applications/repository/management/PhabricatorRepositoryManagementDeleteWorkflow.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 47991d04db..478b723c54 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2022,7 +2022,6 @@ phutil_register_library_map(array( 'PhabricatorRepositoryGraphStream' => 'applications/repository/daemon/PhabricatorRepositoryGraphStream.php', 'PhabricatorRepositoryListController' => 'applications/repository/controller/PhabricatorRepositoryListController.php', 'PhabricatorRepositoryManagementCacheWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementCacheWorkflow.php', - 'PhabricatorRepositoryManagementDeleteWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementDeleteWorkflow.php', 'PhabricatorRepositoryManagementDiscoverWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php', 'PhabricatorRepositoryManagementEditWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php', 'PhabricatorRepositoryManagementImportingWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php', @@ -4831,6 +4830,7 @@ phutil_register_library_map(array( 1 => 'PhabricatorPolicyInterface', 2 => 'PhabricatorFlaggableInterface', 3 => 'PhabricatorMarkupInterface', + 4 => 'PhabricatorDestructableInterface', ), 'PhabricatorRepositoryArcanistProject' => array( @@ -4872,7 +4872,6 @@ phutil_register_library_map(array( 'PhabricatorRepositoryGraphStream' => 'Phobject', 'PhabricatorRepositoryListController' => 'PhabricatorRepositoryController', 'PhabricatorRepositoryManagementCacheWorkflow' => 'PhabricatorRepositoryManagementWorkflow', - 'PhabricatorRepositoryManagementDeleteWorkflow' => 'PhabricatorRepositoryManagementWorkflow', 'PhabricatorRepositoryManagementDiscoverWorkflow' => 'PhabricatorRepositoryManagementWorkflow', 'PhabricatorRepositoryManagementEditWorkflow' => 'PhabricatorRepositoryManagementWorkflow', 'PhabricatorRepositoryManagementImportingWorkflow' => 'PhabricatorRepositoryManagementWorkflow', diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php index 0a8c5d00a8..c754c4fa90 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php @@ -29,7 +29,7 @@ final class DiffusionRepositoryEditDeleteController 'If you really want to delete the repository, run this command from '. 'the command line:'); $command = csprintf( - 'phabricator/ $ ./bin/repository delete %s', + 'phabricator/ $ ./bin/remove destroy %s', $repository->getCallsign()); $text_2 = pht('Repositories touch many objects and as such deletes are '. 'prohibitively expensive to run from the web UI.'); diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementDeleteWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementDeleteWorkflow.php deleted file mode 100644 index dd97df8d55..0000000000 --- a/src/applications/repository/management/PhabricatorRepositoryManagementDeleteWorkflow.php +++ /dev/null @@ -1,64 +0,0 @@ -setName('delete') - ->setExamples('**delete** __repository__ ...') - ->setSynopsis('Delete __repository__, named by callsign.') - ->setArguments( - array( - array( - 'name' => 'verbose', - 'help' => 'Show additional debugging information.', - ), - array( - 'name' => 'force', - 'help' => 'Do not prompt for confirmation.', - ), - array( - 'name' => 'repos', - 'wildcard' => true, - ), - )); - } - - public function execute(PhutilArgumentParser $args) { - $repos = $this->loadRepositories($args, 'repos'); - - if (!$repos) { - throw new PhutilArgumentUsageException( - "Specify one or more repositories to delete, by callsign."); - } - - $console = PhutilConsole::getConsole(); - - if (!$args->getArg('force')) { - $console->writeOut("%s\n\n", pht('These repositories will be deleted:')); - - foreach ($repos as $repo) { - $console->writeOut( - " %s %s\n", - 'r'.$repo->getCallsign(), - $repo->getName()); - } - - $prompt = pht('Permanently delete these repositories?'); - if (!$console->confirm($prompt)) { - return 1; - } - } - - foreach ($repos as $repo) { - $console->writeOut("Deleting '%s'...\n", $repo->getCallsign()); - $repo->delete(); - } - - $console->writeOut("Done.\n"); - - return 0; - } - -} diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php index 632e1785a8..f04f3ad1d3 100644 --- a/src/applications/repository/storage/PhabricatorRepository.php +++ b/src/applications/repository/storage/PhabricatorRepository.php @@ -7,7 +7,8 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO implements PhabricatorPolicyInterface, PhabricatorFlaggableInterface, - PhabricatorMarkupInterface { + PhabricatorMarkupInterface, + PhabricatorDestructableInterface { /** * Shortest hash we'll recognize in raw "a829f32" form. @@ -1322,4 +1323,15 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO return true; } + +/* -( PhabricatorDestructableInterface )----------------------------------- */ + + public function destroyObjectPermanently( + PhabricatorDestructionEngine $engine) { + + $this->openTransaction(); + $this->delete(); + $this->saveTransaction(); + } + } -- 2.51.2 From b01f57bfdbc80d3e1e34ef5c61b54aa1b329ca25 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Tue, 3 Jun 2014 06:10:27 -0700 Subject: [PATCH 09/14] Explicitly enable strict compilation for the Aphlict client SWF. Summary: Strict mode is enabled by default, but it would be best to explicitly enable it... just in case. Strict mode prints undefined property and function calls; also performs compile-time type checking on assignments and options supplied to method calls. See http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7a92.html Test Plan: N/A Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D9354 --- support/aphlict/client/build_aphlict_client.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/support/aphlict/client/build_aphlict_client.sh b/support/aphlict/client/build_aphlict_client.sh index a9a324052a..7c9eb01bc6 100755 --- a/support/aphlict/client/build_aphlict_client.sh +++ b/support/aphlict/client/build_aphlict_client.sh @@ -12,6 +12,7 @@ set -e $MXMLC \ -output=$ROOT/webroot/rsrc/swf/aphlict.swf \ + -strict=true \ -warnings=true \ -source-path=$ROOT/externals/vegas/src \ -static-link-runtime-shared-libraries=true \ -- 2.51.2 From e3d7c16d8c8535ebab6653f14bd1e57af360c97d Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 3 Jun 2014 09:40:16 -0700 Subject: [PATCH 10/14] Use "https://" instead of "git://" for anoymous GitHub requests in documentation Summary: These both work, but "git://" uses a nonstandard and possibly firewalled port, is less familiar to users, and is not promoted in the GitHub UI. Test Plan: `grep`, reviewed diff. Reviewers: chad, avive, avivey Reviewed By: avivey Subscribers: epriestley, avivey Differential Revision: https://secure.phabricator.com/D9360 --- scripts/install/install_rhel-derivs.sh | 6 +++--- scripts/install/install_ubuntu.sh | 6 +++--- src/docs/user/installation_guide.diviner | 6 +++--- src/docs/user/userguide/arcanist.diviner | 4 ++-- src/docs/user/userguide/arcanist_quick_start.diviner | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/install/install_rhel-derivs.sh b/scripts/install/install_rhel-derivs.sh index 58753c038c..64bd77d057 100755 --- a/scripts/install/install_rhel-derivs.sh +++ b/scripts/install/install_rhel-derivs.sh @@ -119,21 +119,21 @@ confirm if [[ ! -e libphutil ]] then - git clone git://github.com/phacility/libphutil.git + git clone https://github.com/phacility/libphutil.git else (cd libphutil && git pull --rebase) fi if [[ ! -e arcanist ]] then - git clone git://github.com/phacility/arcanist.git + git clone https://github.com/phacility/arcanist.git else (cd arcanist && git pull --rebase) fi if [[ ! -e phabricator ]] then - git clone git://github.com/phacility/phabricator.git + git clone https://github.com/phacility/phabricator.git else (cd phabricator && git pull --rebase) fi diff --git a/scripts/install/install_ubuntu.sh b/scripts/install/install_ubuntu.sh index 265d044883..5e97397774 100755 --- a/scripts/install/install_ubuntu.sh +++ b/scripts/install/install_ubuntu.sh @@ -64,21 +64,21 @@ fi if [ ! -e libphutil ] then - git clone git://github.com/phacility/libphutil.git + git clone https://github.com/phacility/libphutil.git else (cd libphutil && git pull --rebase) fi if [ ! -e arcanist ] then - git clone git://github.com/phacility/arcanist.git + git clone https://github.com/phacility/arcanist.git else (cd arcanist && git pull --rebase) fi if [ ! -e phabricator ] then - git clone git://github.com/phacility/phabricator.git + git clone https://github.com/phacility/phabricator.git else (cd phabricator && git pull --rebase) fi diff --git a/src/docs/user/installation_guide.diviner b/src/docs/user/installation_guide.diviner index b829c5aa1f..b9adeb6bcf 100644 --- a/src/docs/user/installation_guide.diviner +++ b/src/docs/user/installation_guide.diviner @@ -95,9 +95,9 @@ Now that you have all that stuff installed, grab Phabricator and its dependencies: $ cd somewhere/ # pick some install directory - somewhere/ $ git clone git://github.com/phacility/libphutil.git - somewhere/ $ git clone git://github.com/phacility/arcanist.git - somewhere/ $ git clone git://github.com/phacility/phabricator.git + somewhere/ $ git clone https://github.com/phacility/libphutil.git + somewhere/ $ git clone https://github.com/phacility/arcanist.git + somewhere/ $ git clone https://github.com/phacility/phabricator.git = Installing APC (Optional) = diff --git a/src/docs/user/userguide/arcanist.diviner b/src/docs/user/userguide/arcanist.diviner index 5211e173d8..8f8ba37eb5 100644 --- a/src/docs/user/userguide/arcanist.diviner +++ b/src/docs/user/userguide/arcanist.diviner @@ -92,8 +92,8 @@ have PHP installed, you can download it from . To install Arcanist, pick an install directory and clone the code from GitHub: - some_install_path/ $ git clone git://github.com/phacility/libphutil.git - some_install_path/ $ git clone git://github.com/phacility/arcanist.git + some_install_path/ $ git clone https://github.com/phacility/libphutil.git + some_install_path/ $ git clone https://github.com/phacility/arcanist.git This should leave you with a directory structure like this diff --git a/src/docs/user/userguide/arcanist_quick_start.diviner b/src/docs/user/userguide/arcanist_quick_start.diviner index 3d4407f42a..23f5cbb399 100644 --- a/src/docs/user/userguide/arcanist_quick_start.diviner +++ b/src/docs/user/userguide/arcanist_quick_start.diviner @@ -23,8 +23,8 @@ Then install Arcanist itself: $ mkdir somewhere/ $ cd somewhere/ - somewhere/ $ git clone git://github.com/phacility/libphutil.git - somewhere/ $ git clone git://github.com/phacility/arcanist.git + somewhere/ $ git clone https://github.com/phacility/libphutil.git + somewhere/ $ git clone https://github.com/phacility/arcanist.git Add `arc` to your path: -- 2.51.2 From 1503840cd945bb7014f9a9f7dcb71d8f9b358a3a Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Tue, 3 Jun 2014 11:27:57 -0700 Subject: [PATCH 11/14] Batch up SQL operations in the `./bin/repository parents` script. Summary: Fixes T5255. Currently the `./bin/repository parents` workflow is quite slow. Batching up the SQL operations should make the workflow //seem// much faster. Test Plan: Not yet tested. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T5255 Differential Revision: https://secure.phabricator.com/D9361 --- ...torRepositoryManagementParentsWorkflow.php | 63 ++++++++++++------- 1 file changed, 41 insertions(+), 22 deletions(-) diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementParentsWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementParentsWorkflow.php index 86fb07c7bf..0cd355c46d 100644 --- a/src/applications/repository/management/PhabricatorRepositoryManagementParentsWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementParentsWorkflow.php @@ -100,35 +100,50 @@ final class PhabricatorRepositoryManagementParentsWorkflow $bar = id(new PhutilConsoleProgressBar()) ->setTotal(count($graph)); + $need = array(); foreach ($graph as $child => $parents) { - $names = $parents; - $names[] = $child; + foreach ($parents as $parent) { + $need[$parent] = $parent; + } + $need[$child] = $child; + } + $map = array(); + foreach (array_chunk($need, 2048) as $chunk) { $rows = queryfx_all( $conn_w, 'SELECT id, commitIdentifier FROM %T WHERE commitIdentifier IN (%Ls) AND repositoryID = %d', $commit_table_name, - $names, + $chunk, $repo->getID()); + foreach ($rows as $row) { + $map[$row['commitIdentifier']] = $row['id']; + } + } + + $insert_sql = array(); + $delete_sql = array(); + + foreach ($graph as $child => $parents) { + $names = $parents; + $names[] = $child; - $map = ipull($rows, 'id', 'commitIdentifier'); foreach ($names as $name) { if (empty($map[$name])) { throw new Exception(pht('Unknown commit "%s"!', $name)); } } - $sql = array(); if (!$parents) { // Write an explicit 0 to indicate "no parents" instead of "no data". - $sql[] = qsprintf( + $insert_sql[] = qsprintf( $conn_w, '(%d, 0)', $map[$child]); } else { foreach ($parents as $parent) { - $sql[] = qsprintf( + $insert_sql[] = qsprintf( $conn_w, '(%d, %d)', $map[$child], @@ -136,25 +151,29 @@ final class PhabricatorRepositoryManagementParentsWorkflow } } - $commit_table->openTransaction(); - queryfx( - $conn_w, - 'DELETE FROM %T WHERE childCommitID = %d', - PhabricatorRepository::TABLE_PARENTS, - $map[$child]); - - if ($sql) { - queryfx( - $conn_w, - 'INSERT INTO %T (childCommitID, parentCommitID) VALUES %Q', - PhabricatorRepository::TABLE_PARENTS, - implode(', ', $sql)); - } - $commit_table->saveTransaction(); + $delete_sql[] = $map[$child]; $bar->update(1); } + $commit_table->openTransaction(); + foreach (PhabricatorLiskDAO::chunkSQL($delete_sql) as $chunk) { + queryfx( + $conn_w, + 'DELETE FROM %T WHERE childCommitID IN (%Q)', + PhabricatorRepository::TABLE_PARENTS, + $chunk); + } + + foreach (PhabricatorLiskDAO::chunkSQL($insert_sql) as $chunk) { + queryfx( + $conn_w, + 'INSERT INTO %T (childCommitID, parentCommitID) VALUES %Q', + PhabricatorRepository::TABLE_PARENTS, + $chunk); + } + $commit_table->saveTransaction(); + $bar->done(); } -- 2.51.2 From c86604bad853d72a3ee6c22d9b80f7b531a24fa7 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Tue, 3 Jun 2014 11:46:43 -0700 Subject: [PATCH 12/14] Reduce the verbosity of the `./bin/search index` script. Summary: Currently, the `./bin/search index` script produces a lot of output (one line for every indexed object). Instead, use a `PhutilConsoleProgressBar` to indicate progress. This is much less verbose and gives a real indication of how long the script should take to complete. Test Plan: Ran `./bin/search index` and verified that a progress bar was output. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D9364 --- ...abricatorSearchManagementIndexWorkflow.php | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php b/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php index dd608cd444..63df499bc5 100644 --- a/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php +++ b/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php @@ -62,8 +62,7 @@ final class PhabricatorSearchManagementIndexWorkflow } if (!$phids) { - throw new PhutilArgumentUsageException( - "Nothing to index!"); + throw new PhutilArgumentUsageException('Nothing to index!'); } if ($args->getArg('background')) { @@ -73,27 +72,31 @@ final class PhabricatorSearchManagementIndexWorkflow $is_background = false; } + if (!$is_background) { + $console->writeOut( + "%s\n", + pht( + 'Run this workflow with "--background" to queue tasks for the '. + 'daemon workers.')); + } + $groups = phid_group_by_type($phids); foreach ($groups as $group_type => $group) { $console->writeOut( "%s\n", - pht( - "Indexing %d object(s) of type %s.", - count($group), - $group_type)); + pht('Indexing %d object(s) of type %s.', count($group), $group_type)); } + $bar = id(new PhutilConsoleProgressBar()) + ->setTotal(count($phids)); + $indexer = new PhabricatorSearchIndexer(); foreach ($phids as $phid) { - if ($is_background) { - $console->writeOut("%s\n", pht("Queueing '%s'...", $phid)); - } else { - $console->writeOut("%s\n", pht("Indexing '%s'...", $phid)); - } $indexer->queueDocumentForIndexing($phid); + $bar->update(1); } - $console->writeOut("Done.\n"); + $bar->done(); } private function loadPHIDsByNames(array $names) { -- 2.51.2 From 389a88d4bc07374735a94b57fb18c8f11301d0fe Mon Sep 17 00:00:00 2001 From: Chad Little Date: Tue, 3 Jun 2014 12:10:56 -0700 Subject: [PATCH 13/14] Dashboard panel CSS fixes Summary: Fixes a couple of spacing issues on object-lists Test Plan: Test some object lists, desktop, mobile Reviewers: epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D9356 --- resources/celerity/map.php | 6 +++--- webroot/rsrc/css/phui/phui-object-item-list-view.css | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index acc2fde13a..7975f91d33 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ return array( 'names' => array( - 'core.pkg.css' => '8ecc2a14', + 'core.pkg.css' => '3070de53', 'core.pkg.js' => '639b2433', 'darkconsole.pkg.js' => 'ca8671ce', 'differential.pkg.css' => 'fbf57382', @@ -136,7 +136,7 @@ return array( 'rsrc/css/phui/phui-info-panel.css' => '27ea50a1', 'rsrc/css/phui/phui-list.css' => 'bf15683f', 'rsrc/css/phui/phui-object-box.css' => 'ce92d8ec', - 'rsrc/css/phui/phui-object-item-list-view.css' => '15c582b1', + 'rsrc/css/phui/phui-object-item-list-view.css' => 'bd66015e', 'rsrc/css/phui/phui-pinboard-view.css' => '874c22f9', 'rsrc/css/phui/phui-property-list-view.css' => '2f7199e8', 'rsrc/css/phui/phui-remarkup-preview.css' => '19ad512b', @@ -766,7 +766,7 @@ return array( 'phui-info-panel-css' => '27ea50a1', 'phui-list-view-css' => 'bf15683f', 'phui-object-box-css' => 'ce92d8ec', - 'phui-object-item-list-view-css' => '15c582b1', + 'phui-object-item-list-view-css' => 'bd66015e', 'phui-pinboard-view-css' => '874c22f9', 'phui-property-list-view-css' => '2f7199e8', 'phui-remarkup-preview-css' => '19ad512b', diff --git a/webroot/rsrc/css/phui/phui-object-item-list-view.css b/webroot/rsrc/css/phui/phui-object-item-list-view.css index d9787f2c51..5f790fe387 100644 --- a/webroot/rsrc/css/phui/phui-object-item-list-view.css +++ b/webroot/rsrc/css/phui/phui-object-item-list-view.css @@ -659,9 +659,9 @@ margin-bottom: -1px; } -.dashboard-panel .phui-object-list-cards .phui-object-item { +.dashboard-panel .phui-object-item-list-view .phui-object-item { border-radius: 0; - margin-bottom: 0; + margin: 0; background-image: none; background-color: #fff; border-left-width: 4px; -- 2.51.2 From 75cbc3ef6c0ec583f60383162a6e211c9f6cf5a8 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 3 Jun 2014 12:42:54 -0700 Subject: [PATCH 14/14] Fix an issues with moved Phriction documents if the old location does not exist or can't be loaded Summary: Fixes T5250. This needs some general cleanup, but fix the fatal. Test Plan: - Viewed moved document. - Viewed moved-from-nonexistent-source document. Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T5250 Differential Revision: https://secure.phabricator.com/D9357 --- .../PhrictionDocumentController.php | 40 ++++++++++++------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/src/applications/phriction/controller/PhrictionDocumentController.php b/src/applications/phriction/controller/PhrictionDocumentController.php index bf09700796..dbb25bc9e2 100644 --- a/src/applications/phriction/controller/PhrictionDocumentController.php +++ b/src/applications/phriction/controller/PhrictionDocumentController.php @@ -75,7 +75,6 @@ final class PhrictionDocumentController $vdate = phabricator_datetime($content->getDateCreated(), $user); $version_note = new AphrontErrorView(); $version_note->setSeverity(AphrontErrorView::SEVERITY_NOTICE); - $version_note->setTitle('Older Version'); $version_note->appendChild( pht('You are viewing an older version of this document, as it '. 'appeared on %s.', $vdate)); @@ -126,9 +125,8 @@ final class PhrictionDocumentController $slug_uri = PhrictionDocument::getSlugURI($new_doc->getSlug()); } - $notice = new AphrontErrorView(); - $notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE); - $notice->setTitle(pht('Document Moved')); + $notice = id(new AphrontErrorView()) + ->setSeverity(AphrontErrorView::SEVERITY_NOTICE); if ($slug_uri) { $notice->appendChild( @@ -159,22 +157,33 @@ final class PhrictionDocumentController $move_notice = null; if ($current_status == PhrictionChangeType::CHANGE_MOVE_HERE) { $from_doc_id = $content->getChangeRef(); - $from_doc = id(new PhrictionDocumentQuery()) + + $slug_uri = null; + + // If the old document exists and is visible, provide a link to it. + $from_docs = id(new PhrictionDocumentQuery()) ->setViewer($user) ->withIDs(array($from_doc_id)) - ->executeOne(); - $slug_uri = PhrictionDocument::getSlugURI($from_doc->getSlug()); + ->execute(); + if ($from_docs) { + $from_doc = head($from_docs); + $slug_uri = PhrictionDocument::getSlugURI($from_doc->getSlug()); + } $move_notice = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) - ->appendChild(pht('This document was moved from %s', - phutil_tag('a', array('href' => $slug_uri), $slug_uri))) - ->render(); - } - } + ->setSeverity(AphrontErrorView::SEVERITY_NOTICE); - if ($version_note) { - $version_note = $version_note->render(); + if ($slug_uri) { + $move_notice->appendChild( + pht( + 'This document was moved from %s.', + phutil_tag('a', array('href' => $slug_uri), $slug_uri))); + } else { + // Render this for consistency, even though it's a bit silly. + $move_notice->appendChild( + pht('This document was moved from elsewhere.')); + } + } } $children = $this->renderDocumentChildren($slug); @@ -204,6 +213,7 @@ final class PhrictionDocumentController array( $actions, $prop_list, + $version_note, $move_notice, $core_content, ));