if ($this->localCommitInfo === null) {
$base_commit = $this->getBaseCommit();
list($info) = $this->execxLocal(
- "log --template '%C' --rev %s --branch %s --",
- "{node}\1{rev}\1{author|emailuser}\1{author|email}\1".
+ "log --template %s --rev %s --branch %s --",
+ "{node}\1{rev}\1{author}\1".
"{date|rfc822date}\1{branch}\1{tag}\1{parents}\1{desc}\2",
hgsprintf('(%s::. - %s)', $base_commit, $base_commit),
$this->getBranchName());
$commits = array();
foreach ($logs as $log) {
- list($node, $rev, $author, $author_email, $date, $branch, $tag,
+ list($node, $rev, $full_author, $date, $branch, $tag,
$parents, $desc) = explode("\1", $log, 9);
+ $email = new PhutilEmailAddress($full_author);
+ $author = $email->getDisplayName();
+ $author_email = $email->getAddress();
+
// NOTE: If a commit has only one parent, {parents} returns empty.
// If it has two parents, {parents} returns revs and short hashes, not
// full hashes. Try to avoid making calls to "hg parents" because it's
'phids' => array($this->getUserPHID()),
));
$author_dict = reset($authors);
+
+ list($email) = $repository_api->execxLocal('config user.email');
+
$author = sprintf('%s <%s>',
$author_dict['realName'],
- $repository_api->execxLocal('config user.email'));
+ $email);
} else if ($repository_api instanceof ArcanistMercurialAPI) {
- $repository_api->parseBaseCommitArgument($this->getArgument('paths'));
+ $this->parseBaseCommitArgument($this->getArgument('paths'));
$diff = $repository_api->getFullMercurialDiff();
$changes = $parser->parseDiff($diff);
$authors = $this->getConduit()->callMethodSynchronous(
array(
'phids' => array($this->getUserPHID()),
));
- $author_dict = reset($authors);
- $author = sprintf('%s <%s>',
- $author_dict['realName'],
- $repository_api->execxLocal('showconfig ui.username'));
+
+ list($author) = $repository_api->execxLocal('showconfig ui.username');
} else {
// TODO: paths support
$paths = $repository_api->getWorkingCopyStatus();
$bundle->setBaseRevision(
$repository_api->getSourceControlBaseRevision());
// note we can't get a revision ID for SOURCE_LOCAL
- $bundle->setAuthor($author);
+
+ $parser = new PhutilEmailAddress($author);
+ $bundle->setAuthorName($parser->getDisplayName());
+ $bundle->setAuthorEmail($parser->getAddress());
break;
case self::SOURCE_REVISION:
$bundle = $this->loadRevisionBundleFromConduit(