Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F72030280
ConduitAPI_diffusion_getrecentcommitsbypath_Method.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, Jul 14, 08:07
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jul 16, 08:07 (2 d)
Engine
blob
Format
Raw Data
Handle
19024690
Attached To
rPH Phabricator
ConduitAPI_diffusion_getrecentcommitsbypath_Method.php
View Options
<?php
/**
* @group conduit
*/
final
class
ConduitAPI_diffusion_getrecentcommitsbypath_Method
extends
ConduitAPIMethod
{
const
DEFAULT_LIMIT
=
10
;
public
function
getMethodDescription
()
{
return
"Get commit identifiers for recent commits affecting a given path."
;
}
public
function
defineParamTypes
()
{
return
array
(
'callsign'
=>
'required string'
,
'path'
=>
'required string'
,
'limit'
=>
'optional int'
,
);
}
public
function
defineReturnType
()
{
return
'nonempty list<string>'
;
}
public
function
defineErrorTypes
()
{
return
array
(
);
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$drequest
=
DiffusionRequest
::
newFromDictionary
(
array
(
'callsign'
=>
$request
->
getValue
(
'callsign'
),
'path'
=>
$request
->
getValue
(
'path'
),
));
$limit
=
nonempty
(
$request
->
getValue
(
'limit'
),
self
::
DEFAULT_LIMIT
);
$history
=
DiffusionHistoryQuery
::
newFromDiffusionRequest
(
$drequest
)
->
setLimit
(
$limit
)
->
needDirectChanges
(
true
)
->
needChildChanges
(
true
)
->
loadHistory
();
$raw_commit_identifiers
=
mpull
(
$history
,
'getCommitIdentifier'
);
$result
=
array
();
foreach
(
$raw_commit_identifiers
as
$id
)
{
$result
[]
=
'r'
.
$request
->
getValue
(
'callsign'
).
$id
;
}
return
$result
;
}
}
Event Timeline
Log In to Comment