Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15384042
D7514.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
D7514.diff
View Options
Index: scripts/repository/manage_repositories.php
===================================================================
--- scripts/repository/manage_repositories.php
+++ scripts/repository/manage_repositories.php
@@ -20,6 +20,7 @@
new PhabricatorRepositoryManagementDiscoverWorkflow(),
new PhabricatorRepositoryManagementListWorkflow(),
new PhabricatorRepositoryManagementDeleteWorkflow(),
+ new PhabricatorRepositoryManagementMarkImportedWorkflow(),
new PhutilHelpArgumentWorkflow(),
);
Index: src/__phutil_library_map__.php
===================================================================
--- src/__phutil_library_map__.php
+++ src/__phutil_library_map__.php
@@ -1661,6 +1661,7 @@
'PhabricatorRepositoryManagementDeleteWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementDeleteWorkflow.php',
'PhabricatorRepositoryManagementDiscoverWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php',
'PhabricatorRepositoryManagementListWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementListWorkflow.php',
+ 'PhabricatorRepositoryManagementMarkImportedWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementMarkImportedWorkflow.php',
'PhabricatorRepositoryManagementPullWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementPullWorkflow.php',
'PhabricatorRepositoryManagementWorkflow' => 'applications/repository/management/PhabricatorRepositoryManagementWorkflow.php',
'PhabricatorRepositoryMercurialCommitChangeParserWorker' => 'applications/repository/worker/commitchangeparser/PhabricatorRepositoryMercurialCommitChangeParserWorker.php',
@@ -4013,6 +4014,7 @@
'PhabricatorRepositoryManagementDeleteWorkflow' => 'PhabricatorRepositoryManagementWorkflow',
'PhabricatorRepositoryManagementDiscoverWorkflow' => 'PhabricatorRepositoryManagementWorkflow',
'PhabricatorRepositoryManagementListWorkflow' => 'PhabricatorRepositoryManagementWorkflow',
+ 'PhabricatorRepositoryManagementMarkImportedWorkflow' => 'PhabricatorRepositoryManagementWorkflow',
'PhabricatorRepositoryManagementPullWorkflow' => 'PhabricatorRepositoryManagementWorkflow',
'PhabricatorRepositoryManagementWorkflow' => 'PhutilArgumentWorkflow',
'PhabricatorRepositoryMercurialCommitChangeParserWorker' => 'PhabricatorRepositoryCommitChangeParserWorker',
Index: src/applications/repository/management/PhabricatorRepositoryManagementMarkImportedWorkflow.php
===================================================================
--- /dev/null
+++ src/applications/repository/management/PhabricatorRepositoryManagementMarkImportedWorkflow.php
@@ -0,0 +1,67 @@
+<?php
+
+final class PhabricatorRepositoryManagementMarkImportedWorkflow
+ extends PhabricatorRepositoryManagementWorkflow {
+
+ public function didConstruct() {
+ $this
+ ->setName('mark-imported')
+ ->setExamples('**mark-imported** __repository__ ...')
+ ->setSynopsis('Mark __repository__, named by callsign, as imported.')
+ ->setArguments(
+ array(
+ array(
+ 'name' => 'mark-not-imported',
+ 'help' => 'Instead, mark repositories as NOT imported.',
+ ),
+ 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 mark imported, by callsign.");
+ }
+
+ $new_importing_value = (bool)$args->getArg('mark-not-imported');
+
+ $console = PhutilConsole::getConsole();
+ foreach ($repos as $repo) {
+ $callsign = $repo->getCallsign();
+
+ if ($repo->isImporting() && $new_importing_value) {
+ $console->writeOut(
+ "%s\n",
+ pht("Repository '%s' is already importing.", $callsign));
+ } else if (!$repo->isImporting() && !$new_importing_value) {
+ $console->writeOut(
+ "%s\n",
+ pht("Repository '%s' is already imported.", $callsign));
+ } else {
+ if ($new_importing_value) {
+ $console->writeOut(
+ "%s\n",
+ pht("Marking repository '%s' as importing.", $callsign));
+ } else {
+ $console->writeOut(
+ "%s\n",
+ pht("Marking repository '%s' as imported.", $callsign));
+ }
+
+ $repo->setDetail('importing', $new_importing_value);
+ $repo->save();
+ }
+ }
+
+ $console->writeOut("Done.\n");
+
+ return 0;
+ }
+
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 15, 6:37 PM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7701215
Default Alt Text
D7514.diff (4 KB)
Attached To
Mode
D7514: Add an administrative `bin/repository mark-imported` command
Attached
Detach File
Event Timeline
Log In to Comment