Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F108297100
DiffusionInternalAncestorsConduitAPIMethod.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
Tue, Apr 15, 14:41
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Apr 17, 14:41 (2 d)
Engine
blob
Format
Raw Data
Handle
25506644
Attached To
rPH Phabricator
DiffusionInternalAncestorsConduitAPIMethod.php
View Options
<?php
final
class
DiffusionInternalAncestorsConduitAPIMethod
extends
DiffusionQueryConduitAPIMethod
{
public
function
isInternalAPI
()
{
return
true
;
}
public
function
getAPIMethodName
()
{
return
'diffusion.internal.ancestors'
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Internal method for filtering ref ancestors.'
);
}
protected
function
defineReturnType
()
{
return
'list<string>'
;
}
protected
function
defineCustomParamTypes
()
{
return
array
(
'ref'
=>
'required string'
,
'commits'
=>
'required list<string>'
,
);
}
protected
function
getResult
(
ConduitAPIRequest
$request
)
{
$drequest
=
$this
->
getDiffusionRequest
();
$repository
=
$drequest
->
getRepository
();
$commits
=
$request
->
getValue
(
'commits'
);
$ref
=
$request
->
getValue
(
'ref'
);
$graph
=
new
PhabricatorGitGraphStream
(
$repository
,
$ref
);
$keep
=
array
();
foreach
(
$commits
as
$identifier
)
{
try
{
$graph
->
getCommitDate
(
$identifier
);
$keep
[]
=
$identifier
;
}
catch
(
Exception
$ex
)
{
// Not an ancestor.
}
}
return
$keep
;
}
}
Event Timeline
Log In to Comment