Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7862237
ArcanistCommitRef.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
ArcanistCommitRef.php
View Options
<?php
final
class
ArcanistCommitRef
extends
ArcanistRef
{
private
$commitHash
;
private
$treeHash
;
private
$commitEpoch
;
private
$authorEpoch
;
private
$upstream
;
const
HARDPOINT_MESSAGE
=
'message'
;
const
HARDPOINT_UPSTREAM
=
'upstream'
;
public
function
getRefDisplayName
()
{
return
pht
(
'Commit "%s"'
,
$this
->
getCommitHash
());
}
protected
function
newHardpoints
()
{
return
array
(
$this
->
newHardpoint
(
self
::
HARDPOINT_MESSAGE
),
$this
->
newHardpoint
(
self
::
HARDPOINT_UPSTREAM
),
);
}
public
function
setCommitHash
(
$commit_hash
)
{
$this
->
commitHash
=
$commit_hash
;
return
$this
;
}
public
function
getCommitHash
()
{
return
$this
->
commitHash
;
}
public
function
setTreeHash
(
$tree_hash
)
{
$this
->
treeHash
=
$tree_hash
;
return
$this
;
}
public
function
getTreeHash
()
{
return
$this
->
treeHash
;
}
public
function
setCommitEpoch
(
$commit_epoch
)
{
$this
->
commitEpoch
=
$commit_epoch
;
return
$this
;
}
public
function
getCommitEpoch
()
{
return
$this
->
commitEpoch
;
}
public
function
setAuthorEpoch
(
$author_epoch
)
{
$this
->
authorEpoch
=
$author_epoch
;
return
$this
;
}
public
function
getAuthorEpoch
()
{
return
$this
->
authorEpoch
;
}
public
function
getSummary
()
{
$message
=
$this
->
getMessage
();
$message
=
trim
(
$message
);
$lines
=
phutil_split_lines
(
$message
,
false
);
return
head
(
$lines
);
}
public
function
attachMessage
(
$message
)
{
return
$this
->
attachHardpoint
(
self
::
HARDPOINT_MESSAGE
,
$message
);
}
public
function
getMessage
()
{
return
$this
->
getHardpoint
(
self
::
HARDPOINT_MESSAGE
);
}
public
function
getURI
()
{
return
$this
->
getUpstreamProperty
(
'uri'
);
}
private
function
getUpstreamProperty
(
$key
,
$default
=
null
)
{
$upstream
=
$this
->
getHardpoint
(
self
::
HARDPOINT_UPSTREAM
);
if
(!
$upstream
)
{
return
$default
;
}
return
idx
(
$upstream
,
$key
,
$default
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Aug 13, 20:16 (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
877033
Default Alt Text
ArcanistCommitRef.php (1 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline
Log In to Comment