Page MenuHomePhabricator
Paste P2176

serving hack
ActivePublic

Authored by demon on Oct 9 2015, 6:19 PM.
Tags
None
Referenced Files
F2675358: serving hack
Oct 9 2015, 6:19 PM
Subscribers
None
chad@notsexy /a/phab/phabricator (master)$ git show HEAD
commit 3a809a0bc1976a6e323583645fbfc2e45266e9a0
Author: Chad Horohoe <chadh@wikimedia.org>
Date: Fri Oct 9 11:11:54 2015 -0700
Allow editing hosting policies via command line
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php
index d42ecf9..cf0a4a9 100644
--- a/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php
@@ -24,6 +24,16 @@ final class PhabricatorRepositoryManagementEditWorkflow
'param' => 'path',
'help' => pht('Edit the local path.'),
),
+ array(
+ 'name' => 'serve-http',
+ 'param' => 'string',
+ 'help' => pht('Edit the http serving policy.'),
+ ),
+ array(
+ 'name' => 'serve-ssh',
+ 'param' => 'string'
+ 'help' => pht('Edit the ssh serving policy.'),
+ ),
));
}
@@ -68,12 +78,24 @@ final class PhabricatorRepositoryManagementEditWorkflow
$xactions = array();
$type_local_path = PhabricatorRepositoryTransaction::TYPE_LOCAL_PATH;
+ $type_protocol_http = PhabricatorRepositoryTransaction::TYPE_PROTOCOL_HTTP;
+ $type_protocol_ssh = PhabricatorRepositoryTransaction::TYPE_PROTOCOL_SSH;
if ($args->getArg('local-path')) {
$xactions[] = id(new PhabricatorRepositoryTransaction())
->setTransactionType($type_local_path)
->setNewValue($args->getArg('local-path'));
}
+ if ($args->getArg('serve-http')) {
+ $xactions[] = id(new PhabricatorRepositoryTransaction())
+ ->setTransactionType($type_protocol_http)
+ ->setNewValue($args->getArg('serve-http'));
+ }
+ if ($args->getArg('serve-ssh')) {
+ $xactions[] = id(new PhabricatorRepositoryTransaction())
+ ->setTransactionType($type_protocol_ssh)
+ ->setNewValue($args->getArg('serve-ssh'));
+ }
if (!$xactions) {
throw new PhutilArgumentUsageException(

Event Timeline

demon changed the title of this paste from untitled to serving hack.
demon updated the paste's language from autodetect to autodetect.