Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78841519
PhabricatorRepositoryManagementMarkImportedWorkflow.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
Fri, Aug 23, 07:00
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Aug 25, 07:00 (2 d)
Engine
blob
Format
Raw Data
Handle
20111240
Attached To
rPH Phabricator
PhabricatorRepositoryManagementMarkImportedWorkflow.php
View Options
<?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
;
}
}
Event Timeline
Log In to Comment