Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92767186
DifferentialCommitsFieldSpecification.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, Nov 23, 13:34
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Nov 25, 13:34 (2 d)
Engine
blob
Format
Raw Data
Handle
22500619
Attached To
rPH Phabricator
DifferentialCommitsFieldSpecification.php
View Options
<?php
final
class
DifferentialCommitsFieldSpecification
extends
DifferentialFieldSpecification
{
public
function
shouldAppearOnRevisionView
()
{
return
true
;
}
public
function
getRequiredHandlePHIDsForRevisionView
()
{
return
$this
->
getCommitPHIDs
();
}
public
function
renderLabelForRevisionView
()
{
return
'Commits:'
;
}
public
function
renderValueForRevisionView
()
{
$commit_phids
=
$this
->
getCommitPHIDs
();
if
(!
$commit_phids
)
{
return
null
;
}
$links
=
array
();
foreach
(
$commit_phids
as
$commit_phid
)
{
$links
[]
=
$this
->
getHandle
(
$commit_phid
)->
renderLink
();
}
return
array_interleave
(
phutil_tag
(
'br'
),
$links
);
}
private
function
getCommitPHIDs
()
{
$revision
=
$this
->
getRevision
();
return
$revision
->
getCommitPHIDs
();
}
public
function
renderValueForMail
(
$phase
)
{
$revision
=
$this
->
getRevision
();
if
(
$revision
->
getStatus
()
!=
ArcanistDifferentialRevisionStatus
::
CLOSED
)
{
return
null
;
}
$phids
=
$revision
->
loadCommitPHIDs
();
if
(!
$phids
)
{
return
null
;
}
$body
=
array
();
$handles
=
id
(
new
PhabricatorObjectHandleData
(
$phids
))->
loadHandles
();
$body
[]
=
pht
(
'COMMIT(S)'
,
count
(
$handles
));
foreach
(
$handles
as
$handle
)
{
$body
[]
=
' '
.
PhabricatorEnv
::
getProductionURI
(
$handle
->
getURI
());
}
return
implode
(
"
\n
"
,
$body
);
}
}
Event Timeline
Log In to Comment