diff mercurial/ui.py @ 44663:e147748f750b

merge with stable
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 02 Apr 2020 21:58:10 +0530
parents b746a22349f9 c23877cb25a5
children 484e04dc7f42
line wrap: on
line diff
--- a/mercurial/ui.py	Sun Mar 29 01:57:17 2020 +0900
+++ b/mercurial/ui.py	Thu Apr 02 21:58:10 2020 +0530
@@ -1914,6 +1914,12 @@
             # instead default to E to plumb commit messages to
             # avoid confusion.
             editor = b'E'
+        elif pycompat.isdarwin:
+            # vi on darwin is POSIX compatible to a fault, and that includes
+            # exiting non-zero if you make any mistake when running an ex
+            # command. Proof: `vi -c ':unknown' -c ':qa'; echo $?` produces 1,
+            # while s/vi/vim/ doesn't.
+            editor = b'vim'
         else:
             editor = b'vi'
         return encoding.environ.get(b"HGEDITOR") or self.config(