Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F110163359
DiffusionMercurialRequest.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
Thu, Apr 24, 23:55
Size
837 B
Mime Type
text/x-php
Expires
Sat, Apr 26, 23:55 (2 d)
Engine
blob
Format
Raw Data
Handle
25708619
Attached To
rPH Phabricator
DiffusionMercurialRequest.php
View Options
<?php
/**
* @group diffusion
*/
final
class
DiffusionMercurialRequest
extends
DiffusionRequest
{
protected
function
getSupportsBranches
()
{
return
true
;
}
protected
function
didInitialize
()
{
// Expand abbreviated hashes to full hashes so "/rXnnnn" (i.e., fewer than
// 40 characters) works correctly.
if
(!
$this
->
commit
)
{
return
;
}
if
(
strlen
(
$this
->
commit
)
==
40
)
{
return
;
}
$this
->
expandCommitName
();
}
public
function
getBranch
()
{
if
(
$this
->
branch
)
{
return
$this
->
branch
;
}
if
(
$this
->
repository
)
{
return
$this
->
repository
->
getDefaultBranch
();
}
throw
new
Exception
(
"Unable to determine branch!"
);
}
public
function
getCommit
()
{
if
(
$this
->
commit
)
{
return
$this
->
commit
;
}
return
$this
->
getBranch
();
}
}
Event Timeline
Log In to Comment