Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2892196
PhabricatorCommitBranchesField.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
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
(
)
,
'repository'
=>
$this
->
getObject
(
)
->
getRepository
(
)
->
getPHID
(
)
,
)
;
try
{
$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
)
;
$branch_text
=
implode
(
', '
,
$branch_names
)
;
}
catch
(
Exception
$ex
)
{
$branch_text
=
pht
(
'<%s: %s>'
,
get_class
(
$ex
)
,
$ex
->
getMessage
(
)
)
;
}
$body
->
addTextSection
(
pht
(
'BRANCHES'
)
,
$branch_text
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 16:23 (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1126450
Default Alt Text
PhabricatorCommitBranchesField.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment