Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22418753
ArcanistCommitUpstreamHardpointLoader.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
ArcanistCommitUpstreamHardpointLoader.php
View Options
<?php
final
class
ArcanistCommitUpstreamHardpointLoader
extends
ArcanistHardpointLoader
{
const
LOADERKEY
=
'commit.conduit'
;
public
function
canLoadRepositoryAPI
(
ArcanistRepositoryAPI
$api
)
{
return
true
;
}
public
function
canLoadRef
(
ArcanistRef
$ref
)
{
return
(
$ref
instanceof
ArcanistCommitRef
);
}
public
function
canLoadHardpoint
(
ArcanistRef
$ref
,
$hardpoint
)
{
return
(
$hardpoint
==
'upstream'
);
}
public
function
loadHardpoints
(
array
$refs
,
$hardpoint
)
{
$query
=
$this
->
getQuery
();
$repository_ref
=
$query
->
getRepositoryRef
();
if
(!
$repository_ref
)
{
return
array_fill_keys
(
array_keys
(
$refs
),
null
);
}
$repository_phid
=
$repository_ref
->
getPHID
();
$commit_map
=
array
();
foreach
(
$refs
as
$key
=>
$ref
)
{
$hash
=
$ref
->
getCommitHash
();
$commit_map
[
$hash
][]
=
$key
;
}
$commit_info
=
$this
->
resolveCall
(
'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
;
}
}
return
$results
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 28, 02:16 (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1224602
Default Alt Text
ArcanistCommitUpstreamHardpointLoader.php (1 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline