Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F547628
DiffusionCommitRemarkupRule.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
DiffusionCommitRemarkupRule.php
View Options
<?php
final
class
DiffusionCommitRemarkupRule
extends
PhabricatorObjectRemarkupRule
{
protected
function
getObjectNamePrefix
()
{
return
''
;
}
protected
function
getObjectNamePrefixBeginsWithWordCharacter
()
{
return
true
;
}
protected
function
getObjectIDPattern
()
{
return
PhabricatorRepositoryCommitPHIDType
::
getCommitObjectNamePattern
();
}
protected
function
getObjectNameText
(
$object
,
PhabricatorObjectHandle
$handle
,
$id
)
{
// If this commit is unreachable, return the handle name instead of the
// normal text because it may be able to tell the user that the commit
// was rewritten and where to find the new one.
// By default, we try to preserve what the user actually typed as
// faithfully as possible, but if they're referencing a deleted commit
// it's more valuable to try to pick up any rewrite. See T11522.
if
(
$object
->
isUnreachable
())
{
return
$handle
->
getName
();
}
return
parent
::
getObjectNameText
(
$object
,
$handle
,
$id
);
}
protected
function
loadObjects
(
array
$ids
)
{
$viewer
=
$this
->
getEngine
()->
getConfig
(
'viewer'
);
$query
=
id
(
new
DiffusionCommitQuery
())
->
setViewer
(
$viewer
)
->
withIdentifiers
(
$ids
);
$query
->
execute
();
return
$query
->
getIdentifierMap
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 1:36 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
120441
Default Alt Text
DiffusionCommitRemarkupRule.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment