Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P1052
Fork of P1051 no_op.diff
Active
Public
Actions
Authored by
richardvanvelzen
on Jan 28 2014, 8:30 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F105470: Fork_of_P1051_no_op.diff
Jan 28 2014, 8:30 AM
2014-01-28 08:30:53 (UTC+0)
Subscribers
None
diff --git a/src/repository/api/ArcanistMercurialAPI.php b/src/repository/api/ArcanistMercurialAPI.php
index 3ece7d9..44f3489 100644
--- a/src/repository/api/ArcanistMercurialAPI.php
+++ b/src/repository/api/ArcanistMercurialAPI.php
@@ -750,9 +750,23 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
$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 (Exception $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();
}
Event Timeline
richardvanvelzen
edited the content of this paste.
(Show Details)
Jan 28 2014, 8:30 AM
2014-01-28 08:30:53 (UTC+0)
richardvanvelzen
changed the title of this paste from untitled to
Fork of P1051 no_op.diff
.
richardvanvelzen
updated the paste's language from
autodetect
to
autodetect
.
Log In to Comment