Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F122144367
DiffusionLowLevelMercurialCommitQuery.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
Wed, Jul 16, 03:11
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jul 18, 03:11 (1 d, 12 h)
Engine
blob
Format
Raw Data
Handle
27440406
Attached To
rPH Phabricator
DiffusionLowLevelMercurialCommitQuery.php
View Options
<?php
final
class
DiffusionLowLevelMercurialCommitQuery
extends
DiffusionLowLevelQuery
{
private
$identifier
;
public
function
withIdentifier
(
$identifier
)
{
$this
->
identifier
=
$identifier
;
return
$this
;
}
protected
function
executeQuery
()
{
$repository
=
$this
->
getRepository
();
list
(
$stdout
)
=
$repository
->
execxLocalCommand
(
'log --template %s --rev %s'
,
'{author}
\\
n{desc}'
,
hgsprintf
(
'%s'
,
$this
->
identifier
));
list
(
$author
,
$message
)
=
explode
(
"
\n
"
,
$stdout
,
2
);
$author
=
phutil_utf8ize
(
$author
);
$message
=
phutil_utf8ize
(
$message
);
$email
=
new
PhutilEmailAddress
(
$author
);
if
(
$email
->
getDisplayName
()
||
$email
->
getDomainName
())
{
$author_name
=
$email
->
getDisplayName
();
$author_email
=
$email
->
getAddress
();
}
else
{
$author_name
=
$email
->
getAddress
();
$author_email
=
null
;
}
return
id
(
new
DiffusionCommitRef
())
->
setAuthorName
(
$author_name
)
->
setAuthorEmail
(
$author_email
)
->
setMessage
(
$message
);
}
}
Event Timeline
Log In to Comment