Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1096644
DifferentialRevisionStatusFieldSpecification.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
DifferentialRevisionStatusFieldSpecification.php
View Options
<?php
final
class
DifferentialRevisionStatusFieldSpecification
extends
DifferentialFieldSpecification
{
public
function
shouldAppearOnRevisionView
()
{
return
true
;
}
public
function
renderLabelForRevisionView
()
{
return
'Revision Status:'
;
}
public
function
renderValueForRevisionView
()
{
$revision
=
$this
->
getRevision
();
$diff
=
$this
->
getDiff
();
$status
=
$revision
->
getStatus
();
$info
=
null
;
$local_vcs
=
$diff
->
getSourceControlSystem
();
$backing_vcs
=
$diff
->
getBackingVersionControlSystem
();
if
(!
$backing_vcs
)
{
$backing_vcs
=
$local_vcs
;
}
if
(
$status
==
ArcanistDifferentialRevisionStatus
::
ACCEPTED
)
{
$next_step
=
null
;
switch
(
$local_vcs
)
{
case
PhabricatorRepositoryType
::
REPOSITORY_TYPE_MERCURIAL
:
case
PhabricatorRepositoryType
::
REPOSITORY_TYPE_GIT
:
$next_step
=
'<tt>arc land</tt>'
;
break
;
case
PhabricatorRepositoryType
::
REPOSITORY_TYPE_SVN
:
$next_step
=
'<tt>arc commit</tt>'
;
break
;
}
if
(
$next_step
)
{
$info
=
' · Next step: '
.
$next_step
;
}
}
else
if
(
$status
==
ArcanistDifferentialRevisionStatus
::
CLOSED
)
{
$committed
=
$revision
->
getDateCommitted
();
if
(
$committed
)
{
$verb
=
null
;
switch
(
$backing_vcs
)
{
case
PhabricatorRepositoryType
::
REPOSITORY_TYPE_MERCURIAL
:
case
PhabricatorRepositoryType
::
REPOSITORY_TYPE_GIT
:
$verb
=
'Pushed'
;
break
;
case
PhabricatorRepositoryType
::
REPOSITORY_TYPE_SVN
:
$verb
=
'Committed'
;
break
;
}
if
(
$verb
)
{
$when
=
phabricator_datetime
(
$committed
,
$this
->
getUser
());
$info
=
" ({$verb} {$when})"
;
}
}
}
$status
=
ArcanistDifferentialRevisionStatus
::
getNameForRevisionStatus
(
$status
);
return
'<strong>'
.
$status
.
'</strong>'
.
$info
;
}
public
function
shouldAppearOnRevisionList
()
{
return
true
;
}
public
function
renderHeaderForRevisionList
()
{
return
'Status'
;
}
public
function
renderValueForRevisionList
(
DifferentialRevision
$revision
)
{
return
ArcanistDifferentialRevisionStatus
::
getNameForRevisionStatus
(
$revision
->
getStatus
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jun 30, 11:11 AM (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
273256
Default Alt Text
DifferentialRevisionStatusFieldSpecification.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment