diff mercurial/ui.py @ 16383:f5dd179bfa4a

plan9: initial support for plan 9 from bell labs This patch contains support for Plan 9 from Bell Labs. A README is provided in contrib/plan9 which describes the port in greater detail. A new extension is also provided named factotum which permits the factotum(4) authentication agent to provide credentials for HTTP repositories. This extension is also applicable to other POSIX platforms which make use of Plan 9 from User Space (aka plan9ports).
author Steven Stallion <sstallion@gmail.com>
date Sun, 08 Apr 2012 12:43:41 -0700
parents 329887a7074c
children 525fdb738975 15d4d475de9e
line wrap: on
line diff
--- a/mercurial/ui.py	Sun Apr 08 22:17:51 2012 -0500
+++ b/mercurial/ui.py	Sun Apr 08 12:43:41 2012 -0700
@@ -687,10 +687,17 @@
 
     def geteditor(self):
         '''return editor to use'''
+        if sys.platform == 'plan9':
+            # vi is the MIPS instruction simulator on Plan 9. We
+            # instead default to E to plumb commit messages to
+            # avoid confusion.
+            editor = 'E'
+        else:
+            editor = 'vi'
         return (os.environ.get("HGEDITOR") or
                 self.config("ui", "editor") or
                 os.environ.get("VISUAL") or
-                os.environ.get("EDITOR", "vi"))
+                os.environ.get("EDITOR", editor))
 
     def progress(self, topic, pos, item="", unit="", total=None):
         '''show a progress message