Page MenuHomePhabricator

D8083.diff
No OneTemporary

D8083.diff

Index: src/repository/api/ArcanistMercurialAPI.php
===================================================================
--- src/repository/api/ArcanistMercurialAPI.php
+++ src/repository/api/ArcanistMercurialAPI.php
@@ -750,9 +750,23 @@
$tmp_file = new TempFile();
Filesystem::writeFile($tmp_file, $message);
- $this->execxLocal(
- 'commit --amend -l %s',
- $tmp_file);
+
+ try {
+ $this->execxLocal(
+ 'commit --amend -l %s',
+ $tmp_file);
+ } catch (CommandException $ex) {
+ if (preg_match('/nothing changed/', $ex->getStdOut())) {
+ // NOTE: Mercurial considers it an error to make a no-op amend. Although
+ // we generally defer to the underlying VCS to dictate behavior, this
+ // one seems a little goofy, and we use amend as part of various
+ // workflows under the assumption that no-op amends are fine. If this
+ // amend failed because it's a no-op, just continue.
+ } else {
+ throw $ex;
+ }
+ }
+
$this->reloadWorkingCopy();
}

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 9, 2:30 PM (16 h, 8 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7389233
Default Alt Text
D8083.diff (1 KB)

Event Timeline