mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-29 10:12:41 +01:00
Fix hg amend during arc diff
Summary: When doing an arc diff with pending changes in your working copy it was creating a new commit with the pending changes instead of amending the existing one. The problem was the author comparison was comparing values like "John Smith <john@foo.com>" with "John Smith". The fix changes $api->getAuthor() to return "John Smith" instead of the full string. This matches the behavior (and implementation) found in the git api. Test Plan: hg book foo touch a && hg commit -Ama touch b && hg add b arc diff When prompted, amend the pending changes to the existing commit. Verified that the changes were amended instead of making a new commit. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5706
This commit is contained in:
parent
b0a0414766
commit
bfc1eeba07
1 changed files with 4 additions and 1 deletions
|
@ -693,7 +693,10 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAuthor() {
|
public function getAuthor() {
|
||||||
return $this->getMercurialConfig('ui.username');
|
$full_author = $this->getMercurialConfig('ui.username');
|
||||||
|
$email = new PhutilEmailAddress($full_author);
|
||||||
|
$author = $email->getDisplayName();
|
||||||
|
return $author;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addToCommit(array $paths) {
|
public function addToCommit(array $paths) {
|
||||||
|
|
Loading…
Reference in a new issue