Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96145713
20130409.commitdrev.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
Mon, Dec 23, 02:42
Size
897 B
Mime Type
text/x-php
Expires
Wed, Dec 25, 02:42 (2 d)
Engine
blob
Format
Raw Data
Handle
23131517
Attached To
rPH Phabricator
20130409.commitdrev.php
View Options
<?php
echo
"Migrating differential.revisionPHID to edges...
\n
"
;
$commit_table
=
new
PhabricatorRepositoryCommit
();
$data_table
=
new
PhabricatorRepositoryCommitData
();
$editor
=
id
(
new
PhabricatorEdgeEditor
())->
setSuppressEvents
(
true
);
$commit_table
->
establishConnection
(
'w'
);
$edges
=
0
;
foreach
(
new
LiskMigrationIterator
(
$commit_table
)
as
$commit
)
{
$data
=
$commit
->
loadOneRelative
(
$data_table
,
'commitID'
);
if
(!
$data
)
{
continue
;
}
$revision_phid
=
$data
->
getCommitDetail
(
'differential.revisionPHID'
);
if
(!
$revision_phid
)
{
continue
;
}
$commit_drev
=
PhabricatorEdgeConfig
::
TYPE_COMMIT_HAS_DREV
;
$editor
->
addEdge
(
$commit
->
getPHID
(),
$commit_drev
,
$revision_phid
);
$edges
++;
if
(
$edges
%
256
==
0
)
{
echo
"."
;
$editor
->
save
();
$editor
=
id
(
new
PhabricatorEdgeEditor
())->
setSuppressEvents
(
true
);
}
}
echo
"."
;
$editor
->
save
();
echo
"
\n
Done.
\n
"
;
Event Timeline
Log In to Comment