Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91830494
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, Nov 14, 22:33
Size
772 B
Mime Type
text/x-php
Expires
Sat, Nov 16, 22:33 (2 d)
Engine
blob
Format
Raw Data
Handle
22332614
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
DiffusionRepositoryRef
())
->
setShortName
(
$name
)
->
setCommitIdentifier
(
$spec
[
'rev'
]);
}
return
$branches
;
}
}
Event Timeline
Log In to Comment