Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F73335047
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
Sat, Jul 20, 16:22
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Jul 22, 16:22 (2 d)
Engine
blob
Format
Raw Data
Handle
19184848
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