Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121968890
PhabricatorRepositoryManagementDiscoverWorkflow.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Jul 15, 03:16
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Jul 17, 03:16 (2 d)
Engine
blob
Format
Raw Data
Handle
27419284
Attached To
rPH Phabricator
PhabricatorRepositoryManagementDiscoverWorkflow.php
View Options
<?php
final
class
PhabricatorRepositoryManagementDiscoverWorkflow
extends
PhabricatorRepositoryManagementWorkflow
{
public
function
didConstruct
()
{
$this
->
setName
(
'discover'
)
->
setExamples
(
'**discover** [__options__] __repository__ ...'
)
->
setSynopsis
(
'Discover __repository__, named by callsign or PHID.'
)
->
setArguments
(
array
(
array
(
'name'
=>
'verbose'
,
'help'
=>
'Show additional debugging information.'
,
),
array
(
'name'
=>
'repair'
,
'help'
=>
'Repair a repository with gaps in commit '
.
'history.'
,
),
array
(
'name'
=>
'repos'
,
'wildcard'
=>
true
,
),
));
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$names
=
$args
->
getArg
(
'repos'
);
$repos
=
PhabricatorRepository
::
loadAllByPHIDOrCallsign
(
$names
);
if
(!
$repos
)
{
throw
new
PhutilArgumentUsageException
(
"Specify one or more repositories to discover, by callsign or PHID."
);
}
$console
=
PhutilConsole
::
getConsole
();
foreach
(
$repos
as
$repo
)
{
$console
->
writeOut
(
"Discovering '%s'...
\n
"
,
$repo
->
getCallsign
());
$daemon
=
new
PhabricatorRepositoryPullLocalDaemon
(
array
());
$daemon
->
setVerbose
(
$args
->
getArg
(
'verbose'
));
$daemon
->
setRepair
(
$args
->
getArg
(
'repair'
));
$daemon
->
discoverRepository
(
$repo
);
}
$console
->
writeOut
(
"Done.
\n
"
);
return
0
;
}
}
Event Timeline
Log In to Comment