Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7187845
ArcanistCommitUpstreamHardpointQuery.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
ArcanistCommitUpstreamHardpointQuery.php
View Options
<?php
final
class
ArcanistCommitUpstreamHardpointQuery
extends
ArcanistWorkflowHardpointQuery
{
public
function
getHardpoints
()
{
return
array
(
ArcanistCommitRefPro
::
HARDPOINT_UPSTREAM
,
);
}
protected
function
canLoadRef
(
ArcanistRefPro
$ref
)
{
return
(
$ref
instanceof
ArcanistCommitRefPro
);
}
public
function
loadHardpoint
(
array
$refs
,
$hardpoint
)
{
$repository_ref
=
(
yield
$this
->
yieldRepositoryRef
());
if
(!
$repository_ref
)
{
yield
$this
->
yieldValue
(
$refs
,
null
);
}
$repository_phid
=
$repository_ref
->
getPHID
();
$commit_map
=
array
();
foreach
(
$refs
as
$key
=>
$ref
)
{
$hash
=
$ref
->
getCommitHash
();
$commit_map
[
$hash
][]
=
$key
;
}
$commit_info
=
(
yield
$this
->
yieldConduit
(
'diffusion.querycommits'
,
array
(
'repositoryPHID'
=>
$repository_phid
,
'names'
=>
array_keys
(
$commit_map
),
)));
$results
=
array
();
foreach
(
$commit_map
as
$hash
=>
$keys
)
{
$commit_phid
=
idx
(
$commit_info
[
'identifierMap'
],
$hash
);
if
(
$commit_phid
)
{
$commit_data
=
idx
(
$commit_info
[
'data'
],
$commit_phid
);
}
else
{
$commit_data
=
null
;
}
foreach
(
$keys
as
$key
)
{
$results
[
$key
]
=
$commit_data
;
}
}
yield
$this
->
yieldMap
(
$results
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jul 8, 07:41 (8 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
810384
Default Alt Text
ArcanistCommitUpstreamHardpointQuery.php (1 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline
Log In to Comment