Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P1100
repo_phid.php
Active
Public
Actions
Authored by
epriestley
on Mar 24 2014, 11:42 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F134385: repo_phid.php
Mar 24 2014, 11:42 PM
2014-03-24 23:42:40 (UTC+0)
Subscribers
None
<?php
require_once
'scripts/__init_script__.php'
;
$conn_w
=
id
(
new
DifferentialRevision
())->
establishConnection
(
'w'
);
foreach
(
new
LiskMigrationIterator
(
new
DifferentialRevision
())
as
$rev
)
{
$id
=
$rev
->
getID
();
echo
"Checking D{$id}...
\n
"
;
if
(
$rev
->
getRepositoryPHID
())
{
// Already has a repository PHID, skip it.
continue
;
}
$diff
=
$rev
->
loadActiveDiff
();
if
(!
$diff
)
{
// Oldschool broken no-diff rev, skip it.
continue
;
}
if
(!
$diff
->
getRepositoryPHID
())
{
// Diff doesn't have a repository PHID either, skip it.
continue
;
}
echo
"Updating D{$id}...
\n
"
;
queryfx
(
$conn_w
,
'UPDATE %T SET repositoryPHID = %s WHERE id = %d'
,
id
(
new
DifferentialRevision
())->
getTableName
(),
$diff
->
getRepositoryPHID
(),
$id
);
}
echo
"Done.
\n
"
;
Event Timeline
epriestley
edited the content of this paste.
(Show Details)
Mar 24 2014, 11:42 PM
2014-03-24 23:42:40 (UTC+0)
epriestley
changed the title of this paste from untitled to
repo_phid.php
.
epriestley
updated the paste's language from
autodetect
to
autodetect
.
Log In to Comment