Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F115392284
DiffusionMercurialDiffQuery.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, May 31, 14:53
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Jun 2, 14:53 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
26486337
Attached To
rPH Phabricator
DiffusionMercurialDiffQuery.php
View Options
<?php
final
class
DiffusionMercurialDiffQuery
extends
DiffusionDiffQuery
{
protected
function
executeQuery
()
{
$drequest
=
$this
->
getRequest
();
$repository
=
$drequest
->
getRepository
();
$effective_commit
=
$this
->
getEffectiveCommit
();
if
(!
$effective_commit
)
{
return
null
;
}
// TODO: This side effect is kind of skethcy.
$drequest
->
setCommit
(
$effective_commit
);
$query
=
DiffusionRawDiffQuery
::
newFromDiffusionRequest
(
$drequest
);
$raw_diff
=
$query
->
loadRawDiff
();
$parser
=
new
ArcanistDiffParser
();
$try_encoding
=
$repository
->
getDetail
(
'encoding'
);
if
(
$try_encoding
)
{
$parser
->
setTryEncoding
(
$try_encoding
);
}
$parser
->
setDetectBinaryFiles
(
true
);
$changes
=
$parser
->
parseDiff
(
$raw_diff
);
$diff
=
DifferentialDiff
::
newFromRawChanges
(
$changes
);
$changesets
=
$diff
->
getChangesets
();
$changeset
=
reset
(
$changesets
);
$this
->
renderingReference
=
$drequest
->
generateURI
(
array
(
'action'
=>
'rendering-ref'
,
));
return
$changeset
;
}
}
Event Timeline
Log In to Comment