Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15335138
D8083.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D8083.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D8083: Don't consider a no-op amend to be an error in Mercurial
Attached
Detach File
Event Timeline
Log In to Comment