Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99056698
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
Sat, Jan 18, 18:52
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Jan 20, 18:52 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23698596
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