Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93563915
PhabricatorCommitBranchesField.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, Nov 29, 18:50
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Dec 1, 18:50 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22664323
Attached To
rPH Phabricator
PhabricatorCommitBranchesField.php
View Options
<?php
final
class
PhabricatorCommitBranchesField
extends
PhabricatorCommitCustomField
{
public
function
getFieldKey
()
{
return
'diffusion:branches'
;
}
public
function
getFieldName
()
{
return
pht
(
'Branches'
);
}
public
function
getFieldDescription
()
{
return
pht
(
'Shows branches a commit appears on in email.'
);
}
public
function
shouldAppearInTransactionMail
()
{
return
true
;
}
public
function
updateTransactionMailBody
(
PhabricatorMetaMTAMailBody
$body
,
PhabricatorApplicationTransactionEditor
$editor
,
array
$xactions
)
{
$params
=
array
(
'contains'
=>
$this
->
getObject
()->
getCommitIdentifier
(),
'callsign'
=>
$this
->
getObject
()->
getRepository
()->
getCallsign
(),
);
$branches_raw
=
id
(
new
ConduitCall
(
'diffusion.branchquery'
,
$params
))
->
setUser
(
$this
->
getViewer
())
->
execute
();
$branches
=
DiffusionRepositoryRef
::
loadAllFromDictionaries
(
$branches_raw
);
if
(!
$branches
)
{
return
;
}
$branch_names
=
mpull
(
$branches
,
'getShortName'
);
sort
(
$branch_names
);
$body
->
addTextSection
(
pht
(
'BRANCHES'
),
implode
(
', '
,
$branch_names
));
}
}
Event Timeline
Log In to Comment