Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91635084
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
Tue, Nov 12, 23:03
Size
669 B
Mime Type
text/x-php
Expires
Thu, Nov 14, 23:03 (2 d)
Engine
blob
Format
Raw Data
Handle
22297734
Attached To
rPH Phabricator
migrate-differential-dependencies.php
View Options
<?php
echo
pht
(
'Migrating differential dependencies to edges...'
).
"
\n
"
;
$table
=
new
DifferentialRevision
();
$table
->
openTransaction
();
foreach
(
new
LiskMigrationIterator
(
$table
)
as
$rev
)
{
$id
=
$rev
->
getID
();
echo
pht
(
'Revision %d: '
,
$id
);
$deps
=
$rev
->
getAttachedPHIDs
(
DifferentialRevisionPHIDType
::
TYPECONST
);
if
(!
$deps
)
{
echo
"-
\n
"
;
continue
;
}
$editor
=
new
PhabricatorEdgeEditor
();
foreach
(
$deps
as
$dep
)
{
$editor
->
addEdge
(
$rev
->
getPHID
(),
DifferentialRevisionDependsOnRevisionEdgeType
::
EDGECONST
,
$dep
);
}
$editor
->
save
();
echo
pht
(
'OKAY'
).
"
\n
"
;
}
$table
->
saveTransaction
();
echo
pht
(
'Done.'
).
"
\n
"
;
Event Timeline
Log In to Comment