Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F543720
DiffusionInternalAncestorsConduitAPIMethod.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
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
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 11:24 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
100171
Default Alt Text
DiffusionInternalAncestorsConduitAPIMethod.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment