Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103137669
DiffusionMercurialBlameQuery.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, Feb 27, 14:13
Size
821 B
Mime Type
text/x-php
Expires
Sat, Mar 1, 14:13 (1 d, 20 h)
Engine
blob
Format
Raw Data
Handle
24484767
Attached To
rPH Phabricator
DiffusionMercurialBlameQuery.php
View Options
<?php
final
class
DiffusionMercurialBlameQuery
extends
DiffusionBlameQuery
{
protected
function
newBlameFuture
(
DiffusionRequest
$request
,
$path
)
{
$repository
=
$request
->
getRepository
();
$commit
=
$request
->
getCommit
();
// NOTE: We're using "--debug" to make "--changeset" give us the full
// commit hashes.
return
$repository
->
getLocalCommandFuture
(
'annotate --debug --changeset --rev %s -- %s'
,
$commit
,
$path
);
}
protected
function
resolveBlameFuture
(
ExecFuture
$future
)
{
list
(
$err
,
$stdout
)
=
$future
->
resolve
();
if
(
$err
)
{
return
null
;
}
$result
=
array
();
$lines
=
phutil_split_lines
(
$stdout
);
foreach
(
$lines
as
$line
)
{
list
(
$commit
)
=
explode
(
':'
,
$line
,
2
);
$result
[]
=
$commit
;
}
return
$result
;
}
}
Event Timeline
Log In to Comment