Patchwork [09,of,10,V4] ui: simplify geteditor

login
register
mail settings
Submitter Jun Wu
Date March 27, 2017, 4:49 a.m.
Message ID <cc06430c144b85ae2d53.1490590162@localhost.localdomain>
Download mbox | patch
Permalink /patch/19741/
State Superseded
Headers show

Comments

Jun Wu - March 27, 2017, 4:49 a.m.
# HG changeset patch
# User Jun Wu <quark@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.

Patch

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