Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97538775
DiffusionLowLevelMercurialPathsQuery.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
Sun, Jan 5, 01:53
Size
807 B
Mime Type
text/x-php
Expires
Tue, Jan 7, 01:53 (2 d)
Engine
blob
Format
Raw Data
Handle
23423379
Attached To
rPH Phabricator
DiffusionLowLevelMercurialPathsQuery.php
View Options
<?php
/**
* Execute and parse a low-level Mercurial paths query using `hg locate`.
*/
final
class
DiffusionLowLevelMercurialPathsQuery
extends
DiffusionLowLevelQuery
{
private
$commit
;
private
$path
;
public
function
withCommit
(
$commit
)
{
$this
->
commit
=
$commit
;
return
$this
;
}
public
function
withPath
(
$path
)
{
$this
->
path
=
$path
;
return
$this
;
}
protected
function
executeQuery
()
{
$repository
=
$this
->
getRepository
();
$path
=
$this
->
path
;
$commit
=
$this
->
commit
;
$match_against
=
trim
(
$path
,
'/'
);
$prefix
=
trim
(
'./'
.
$match_against
,
'/'
);
list
(
$entire_manifest
)
=
$repository
->
execxLocalCommand
(
'locate --print0 --rev %s -I %s'
,
hgsprintf
(
'%s'
,
$commit
),
$prefix
);
return
explode
(
"
\0
"
,
$entire_manifest
);
}
}
Event Timeline
Log In to Comment