Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F568044
DrydockTestRepositoryOperation.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
DrydockTestRepositoryOperation.php
View Options
<?php
final
class
DrydockTestRepositoryOperation
extends
DrydockRepositoryOperationType
{
const
OPCONST
=
'test'
;
public
function
getOperationDescription
(
DrydockRepositoryOperation
$operation
,
PhabricatorUser
$viewer
)
{
return
pht
(
'Test Configuration'
);
}
public
function
getOperationCurrentStatus
(
DrydockRepositoryOperation
$operation
,
PhabricatorUser
$viewer
)
{
$repository
=
$operation
->
getRepository
();
switch
(
$operation
->
getOperationState
())
{
case
DrydockRepositoryOperation
::
STATE_WAIT
:
return
pht
(
'Waiting to test configuration for %s...'
,
$repository
->
getMonogram
());
case
DrydockRepositoryOperation
::
STATE_WORK
:
return
pht
(
'Testing configuration for %s. This may take a moment if Drydock '
.
'has to clone the repository for the first time.'
,
$repository
->
getMonogram
());
case
DrydockRepositoryOperation
::
STATE_DONE
:
return
pht
(
'Success! Automation is configured properly and Drydock can '
.
'operate on %s.'
,
$repository
->
getMonogram
());
}
}
public
function
applyOperation
(
DrydockRepositoryOperation
$operation
,
DrydockInterface
$interface
)
{
$repository
=
$operation
->
getRepository
();
if
(
$repository
->
isGit
())
{
$interface
->
execx
(
'git status'
);
}
else
if
(
$repository
->
isHg
())
{
$interface
->
execx
(
'hg status'
);
}
else
if
(
$repository
->
isSVN
())
{
$interface
->
execx
(
'svn status'
);
}
else
{
throw
new
PhutilMethodNotImplementedException
();
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 13, 1:12 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
124313
Default Alt Text
DrydockTestRepositoryOperation.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment