Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102520173
DiffusionMercurialRawDiffQuery.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, Feb 21, 14:26
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Feb 23, 14:26 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24339307
Attached To
rPH Phabricator
DiffusionMercurialRawDiffQuery.php
View Options
<?php
final
class
DiffusionMercurialRawDiffQuery
extends
DiffusionRawDiffQuery
{
protected
function
executeQuery
()
{
return
$this
->
executeRawDiffCommand
();
}
protected
function
executeRawDiffCommand
()
{
$drequest
=
$this
->
getRequest
();
$repository
=
$drequest
->
getRepository
();
$commit
=
$drequest
->
getCommit
();
// If there's no path, get the entire raw diff.
$path
=
nonempty
(
$drequest
->
getPath
(),
'.'
);
$against
=
$this
->
getAgainstCommit
();
if
(
$against
===
null
)
{
// If `$commit` has no parents (usually because it's the first commit
// in the repository), we want to diff against `null`. This revset will
// do that for us automatically.
$against
=
'('
.
$commit
.
'^ or null)'
;
}
$future
=
$repository
->
getLocalCommandFuture
(
'diff -U %d --git --rev %s --rev %s -- %s'
,
$this
->
getLinesOfContext
(),
$against
,
$commit
,
$path
);
$this
->
configureFuture
(
$future
);
list
(
$raw_diff
)
=
$future
->
resolvex
();
return
$raw_diff
;
}
}
Event Timeline
Log In to Comment