Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103344950
DiffusionLowLevelMercurialBranchesQuery.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
Sat, Mar 1, 08:24
Size
701 B
Mime Type
text/x-php
Expires
Mon, Mar 3, 08:24 (2 d)
Engine
blob
Format
Raw Data
Handle
24547115
Attached To
rPH Phabricator
DiffusionLowLevelMercurialBranchesQuery.php
View Options
<?php
/**
* Execute and parse a low-level Mercurial branches query using `hg branches`.
*/
final
class
DiffusionLowLevelMercurialBranchesQuery
extends
DiffusionLowLevelQuery
{
protected
function
executeQuery
()
{
$repository
=
$this
->
getRepository
();
// NOTE: `--debug` gives us 40-character hashes.
list
(
$stdout
)
=
$repository
->
execxLocalCommand
(
'--debug branches'
);
$branches
=
array
();
$lines
=
ArcanistMercurialParser
::
parseMercurialBranches
(
$stdout
);
foreach
(
$lines
as
$name
=>
$spec
)
{
$branches
[]
=
id
(
new
DiffusionBranchInformation
())
->
setName
(
$name
)
->
setHeadCommitIdentifier
(
$spec
[
'rev'
]);
}
return
$branches
;
}
}
Event Timeline
Log In to Comment