Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P838
find_smallest_queued_commit.php
Active
Public
Actions
Authored by
epriestley
on May 22 2013, 3:39 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F43924: find_smallest_queued_commit.php
Feb 24 2016, 1:31 AM
2016-02-24 01:31:53 (UTC+0)
Subscribers
None
<?php
$min
=
PHP_INT_MAX
;
$tasks
=
new
LiskMigrationIterator
(
new
PhabricatorWorkerActiveTask
());
foreach
(
$tasks
as
$task
)
{
$class
=
$task
->
getTaskClass
();
if
(!
preg_match
(
'/ChangeParserWorker/'
,
$class
))
{
continue
;
}
$data
=
id
(
new
PhabricatorWorkerTaskData
())->
loadOneWhere
(
'id = %d'
,
$task
->
getDataID
());
if
(!
$data
)
{
continue
;
}
$min
=
min
(
idx
(
$data
->
getData
(),
'commitID'
,
PHP_INT_MAX
),
$min
);
}
echo
"Min commit ID is: {$min}
\n
"
;
$commit
=
id
(
new
PhabricatorRepositoryCommit
())->
load
(
$min
);
if
(
$commit
)
{
echo
"Minimum queued commit is r"
.
$commit
->
getCommitIdentifier
().
"
\n
"
;
}
else
{
echo
"No minimum queued commit found."
;
}
Event Timeline
epriestley
edited the content of this paste.
(Show Details)
May 22 2013, 3:39 PM
2013-05-22 15:39:23 (UTC+0)
Log In to Comment