Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99060600
20161213.diff.01.hunks.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
Sat, Jan 18, 19:38
Size
938 B
Mime Type
text/x-php
Expires
Mon, Jan 20, 19:38 (2 d)
Engine
blob
Format
Raw Data
Handle
23691267
Attached To
rPH Phabricator
20161213.diff.01.hunks.php
View Options
<?php
$conn
=
id
(
new
DifferentialRevision
())->
establishConnection
(
'w'
);
$src_table
=
'differential_hunk'
;
$dst_table
=
'differential_hunk_modern'
;
echo
tsprintf
(
"%s
\n
"
,
pht
(
'Migrating old hunks...'
));
foreach
(
new
LiskRawMigrationIterator
(
$conn
,
$src_table
)
as
$row
)
{
queryfx
(
$conn
,
'INSERT INTO %T
(changesetID, oldOffset, oldLen, newOffset, newLen,
dataType, dataEncoding, dataFormat, data,
dateCreated, dateModified)
VALUES
(%d, %d, %d, %d, %d,
%s, %s, %s, %s,
%d, %d)'
,
$dst_table
,
$row
[
'changesetID'
],
$row
[
'oldOffset'
],
$row
[
'oldLen'
],
$row
[
'newOffset'
],
$row
[
'newLen'
],
DifferentialHunk
::
DATATYPE_TEXT
,
'utf8'
,
DifferentialHunk
::
DATAFORMAT_RAW
,
// In rare cases, this could be NULL. See T12090.
(
string
)
$row
[
'changes'
],
$row
[
'dateCreated'
],
$row
[
'dateModified'
]);
}
echo
tsprintf
(
"%s
\n
"
,
pht
(
'Done.'
));
Event Timeline
Log In to Comment