Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101628945
migrate-differential-dependencies.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
Wed, Feb 12, 06:04
Size
667 B
Mime Type
text/x-php
Expires
Fri, Feb 14, 06:04 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24201150
Attached To
rPH Phabricator
migrate-differential-dependencies.php
View Options
<?php
echo
"Migrating differential dependencies to edges...
\n
"
;
$table
=
new
DifferentialRevision
();
$table
->
openTransaction
();
foreach
(
new
LiskMigrationIterator
(
$table
)
as
$rev
)
{
$id
=
$rev
->
getID
();
echo
"Revision {$id}: "
;
$deps
=
$rev
->
getAttachedPHIDs
(
PhabricatorPHIDConstants
::
PHID_TYPE_DREV
);
if
(!
$deps
)
{
echo
"-
\n
"
;
continue
;
}
$editor
=
new
PhabricatorEdgeEditor
();
$editor
->
setSuppressEvents
(
true
);
foreach
(
$deps
as
$dep
)
{
$editor
->
addEdge
(
$rev
->
getPHID
(),
PhabricatorEdgeConfig
::
TYPE_DREV_DEPENDS_ON_DREV
,
$dep
);
}
$editor
->
save
();
echo
"OKAY
\n
"
;
}
$table
->
saveTransaction
();
echo
"Done.
\n
"
;
Event Timeline
Log In to Comment