Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14412740
D17421.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D17421.diff
View Options
diff --git a/src/applications/lipsum/generator/PhabricatorTestDataGenerator.php b/src/applications/lipsum/generator/PhabricatorTestDataGenerator.php
--- a/src/applications/lipsum/generator/PhabricatorTestDataGenerator.php
+++ b/src/applications/lipsum/generator/PhabricatorTestDataGenerator.php
@@ -45,6 +45,7 @@
$user = id(new PhabricatorPeopleQuery())
->setViewer($viewer)
->withPHIDs(array($user_phid))
+ ->needUserSettings(true)
->executeOne();
}
@@ -115,5 +116,4 @@
return $this->loadOneRandom('PhabricatorUser');
}
-
}
diff --git a/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php b/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php
--- a/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php
+++ b/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php
@@ -11,6 +11,17 @@
->setArguments(
array(
array(
+ 'name' => 'force',
+ 'short' => 'f',
+ 'help' => pht(
+ 'Generate objects without prompting for confirmation.'),
+ ),
+ array(
+ 'name' => 'quickly',
+ 'help' => pht(
+ 'Generate objects as quickly as possible.'),
+ ),
+ array(
'name' => 'args',
'wildcard' => true,
),
@@ -34,6 +45,9 @@
->execute();
$argv = $args->getArg('args');
+ $is_force = $args->getArg('force');
+ $is_quickly = $args->getArg('quickly');
+
$all = 'all';
if (isset($all_generators[$all])) {
@@ -125,20 +139,22 @@
'Selected generators: %s.',
implode(', ', mpull($generators, 'getGeneratorName'))));
- echo tsprintf(
- "**<bg:yellow> %s </bg>** %s\n",
- pht('WARNING'),
- pht(
- 'This command generates synthetic test data, including user '.
- 'accounts. It is intended for use in development environments '.
- 'so you can test features more easily. There is no easy way to '.
- 'delete this data or undo the effects of this command. If you run '.
- 'it in a production environment, it will pollute your data with '.
- 'large amounts of meaningless garbage that you can not get rid of.'));
-
- $prompt = pht('Are you sure you want to generate piles of garbage?');
- if (!phutil_console_confirm($prompt, true)) {
- return;
+ if (!$is_force) {
+ echo tsprintf(
+ "**<bg:yellow> %s </bg>** %s\n",
+ pht('WARNING'),
+ pht(
+ 'This command generates synthetic test data, including user '.
+ 'accounts. It is intended for use in development environments so '.
+ 'you can test features more easily. There is no easy way to delete '.
+ 'this data or undo the effects of this command. If you run it in a '.
+ 'production environment, it will pollute your data with large '.
+ 'amounts of meaningless garbage that you can not get rid of.'));
+
+ $prompt = pht('Are you sure you want to generate piles of garbage?');
+ if (!phutil_console_confirm($prompt, true)) {
+ return;
+ }
}
echo tsprintf(
@@ -148,10 +164,10 @@
'Generating synthetic test objects forever. '.
'Use ^C to stop when satisfied.'));
- $this->generate($generators);
+ $this->generate($generators, $is_quickly);
}
- protected function generate(array $generators) {
+ protected function generate(array $generators, $is_quickly) {
$viewer = $this->getViewer();
foreach ($generators as $generator) {
@@ -178,7 +194,11 @@
continue;
}
- $object_phid = $object->getPHID();
+ if (is_string($object)) {
+ $object_phid = $object;
+ } else {
+ $object_phid = $object->getPHID();
+ }
$handles = $viewer->loadHandles(array($object_phid));
@@ -189,7 +209,9 @@
$handles[$object_phid]->getTypeName(),
$handles[$object_phid]->getFullName()));
- sleep(1);
+ if (!$is_quickly) {
+ sleep(1);
+ }
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 1:23 PM (10 h, 31 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6926441
Default Alt Text
D17421.diff (4 KB)
Attached To
Mode
D17421: Add "--force" and "--quickly" flags to `bin/lipsum`
Attached
Detach File
Event Timeline
Log In to Comment