Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93071709
PhabricatorAuditUpdateOwnersManagementWorkflow.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, Nov 26, 00:00
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Nov 28, 00:00 (2 d)
Engine
blob
Format
Raw Data
Handle
22569828
Attached To
rPH Phabricator
PhabricatorAuditUpdateOwnersManagementWorkflow.php
View Options
<?php
final
class
PhabricatorAuditUpdateOwnersManagementWorkflow
extends
PhabricatorAuditManagementWorkflow
{
protected
function
didConstruct
()
{
$this
->
setName
(
'update-owners'
)
->
setExamples
(
'**update-owners** ...'
)
->
setSynopsis
(
pht
(
'Update package relationships for commits.'
))
->
setArguments
(
array_merge
(
$this
->
getCommitConstraintArguments
(),
array
()));
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$viewer
=
$this
->
getViewer
();
$objects
=
$this
->
loadCommitsWithConstraints
(
$args
);
foreach
(
$objects
as
$object
)
{
$commits
=
$this
->
loadCommitsForConstraintObject
(
$object
);
foreach
(
$commits
as
$commit
)
{
$repository
=
$commit
->
getRepository
();
$affected_paths
=
PhabricatorOwnerPathQuery
::
loadAffectedPaths
(
$repository
,
$commit
,
$viewer
);
$affected_packages
=
PhabricatorOwnersPackage
::
loadAffectedPackages
(
$repository
,
$affected_paths
);
$monograms
=
mpull
(
$affected_packages
,
'getMonogram'
);
if
(
$monograms
)
{
$monograms
=
implode
(
', '
,
$monograms
);
}
else
{
$monograms
=
pht
(
'none'
);
}
echo
tsprintf
(
"%s
\n
"
,
pht
(
'Updating "%s" (%s)...'
,
$commit
->
getDisplayName
(),
$monograms
));
$commit
->
writeOwnersEdges
(
mpull
(
$affected_packages
,
'getPHID'
));
}
}
}
}
Event Timeline
Log In to Comment