[PATCH 09 of 10 V4] ui: simplify geteditor

Jun Wu quark at fb.com
Mon Mar 27 00:49:22 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1490589702 25200
#      Sun Mar 26 21:41:42 2017 -0700
# Node ID cc06430c144b85ae2d53528eb8149f1debdb7706
# Parent  4ed7dd7a9241b7b792ab6c810d298a70348c9a27
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r cc06430c144b
ui: simplify geteditor

Now $EDITOR and $VISUAL will affect ui.editor directly. So it's no longer
necessary to test them in ui.geteditor.

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1327,7 +1327,5 @@ class ui(object):
             editor = 'vi'
         return (encoding.environ.get("HGEDITOR") or
-                self.config("ui", "editor") or
-                encoding.environ.get("VISUAL") or
-                encoding.environ.get("EDITOR", editor))
+                self.config("ui", "editor", editor))
 
     @util.propertycache


More information about the Mercurial-devel mailing list