Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93549579
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
Fri, Nov 29, 15:57
Size
669 B
Mime Type
text/x-php
Expires
Sun, Dec 1, 15:57 (2 d)
Engine
blob
Format
Raw Data
Handle
22663881
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