Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100746002
DifferentialBranchFieldSpecification.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
Sun, Feb 2, 09:59
Size
864 B
Mime Type
text/x-php
Expires
Tue, Feb 4, 09:59 (1 d, 20 h)
Engine
blob
Format
Raw Data
Handle
24023954
Attached To
rPH Phabricator
DifferentialBranchFieldSpecification.php
View Options
<?php
final
class
DifferentialBranchFieldSpecification
extends
DifferentialFieldSpecification
{
public
function
shouldAppearOnRevisionView
()
{
return
true
;
}
public
function
renderLabelForRevisionView
()
{
return
'Branch:'
;
}
private
function
getBranchOrBookmarkDescription
(
DifferentialDiff
$diff
)
{
$branch
=
$diff
->
getBranch
();
$bookmark
=
$diff
->
getBookmark
();
$has_branch
=
(
$branch
!=
''
);
$has_bookmark
=
(
$bookmark
!=
''
);
if
(
$has_branch
&&
$has_bookmark
)
{
return
"{$bookmark} bookmark on {$branch} branch"
;
}
else
if
(
$has_bookmark
)
{
return
"{$bookmark} bookmark"
;
}
else
if
(
$has_branch
)
{
return
$branch
;
}
return
null
;
}
public
function
renderValueForRevisionView
()
{
$diff
=
$this
->
getManualDiff
();
return
$this
->
getBranchOrBookmarkDescription
(
$diff
);
}
}
Event Timeline
Log In to Comment