Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22395310
ArcanistMercurialBranchCommitHardpointLoader.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
ArcanistMercurialBranchCommitHardpointLoader.php
View Options
<?php
final
class
ArcanistMercurialBranchCommitHardpointLoader
extends
ArcanistMercurialHardpointLoader
{
const
LOADERKEY
=
'hg.branch.commit'
;
public
function
canLoadRef
(
ArcanistRef
$ref
)
{
return
(
$ref
instanceof
ArcanistBranchRef
);
}
public
function
canLoadHardpoint
(
ArcanistRef
$ref
,
$hardpoint
)
{
return
(
$hardpoint
==
'commitRef'
);
}
public
function
loadHardpoints
(
array
$refs
,
$hardpoint
)
{
$api
=
$this
->
getQuery
()->
getRepositoryAPI
();
$futures
=
array
();
foreach
(
$refs
as
$ref_key
=>
$branch
)
{
$branch_name
=
$branch
->
getBranchName
();
$futures
[
$ref_key
]
=
$api
->
execFutureLocal
(
'log -l 1 --template %s -r %s'
,
"{node}
\1
{date|hgdate}
\1
{p1node}
\1
{desc|firstline}
\1
{desc}"
,
hgsprintf
(
'%s'
,
$branch_name
));
}
$results
=
array
();
$iterator
=
$this
->
newFutureIterator
(
$futures
);
foreach
(
$iterator
as
$ref_key
=>
$future
)
{
list
(
$info
)
=
$future
->
resolvex
();
$fields
=
explode
(
"
\1
"
,
trim
(
$info
),
5
);
list
(
$hash
,
$epoch
,
$parent
,
$desc
,
$text
)
=
$fields
;
$commit_ref
=
$api
->
newCommitRef
()
->
setCommitHash
(
$hash
)
->
setCommitEpoch
((
int
)
$epoch
)
->
attachMessage
(
$text
);
$results
[
$ref_key
]
=
$commit_ref
;
}
return
$results
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 27, 16:25 (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1222858
Default Alt Text
ArcanistMercurialBranchCommitHardpointLoader.php (1 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline