Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99438713
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
Fri, Jan 24, 14:01
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 26, 14:01 (2 d)
Engine
blob
Format
Raw Data
Handle
23801081
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