Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F113156079
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
Thu, May 15, 15:33
Size
775 B
Mime Type
text/x-php
Expires
Sat, May 17, 15:33 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
26173346
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'
);
$stdout
=
PhabricatorRepository
::
filterMercurialDebugOutput
(
$stdout
);
$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