Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 31687:5bea95a1d353
ui: simplify geteditor
Now $EDITOR and $VISUAL will affect ui.editor directly. So it's no longer
necessary to test them in ui.geteditor.
author | Jun Wu <quark@fb.com> |
---|---|
date | Sun, 26 Mar 2017 21:41:42 -0700 |
parents | d83e51654c8a |
children | c5fe0c7dad94 |
comparison
equal
deleted
inserted
replaced
31686:fbc4eb8e2433 | 31687:5bea95a1d353 |
---|---|
1324 # avoid confusion. | 1324 # avoid confusion. |
1325 editor = 'E' | 1325 editor = 'E' |
1326 else: | 1326 else: |
1327 editor = 'vi' | 1327 editor = 'vi' |
1328 return (encoding.environ.get("HGEDITOR") or | 1328 return (encoding.environ.get("HGEDITOR") or |
1329 self.config("ui", "editor") or | 1329 self.config("ui", "editor", editor)) |
1330 encoding.environ.get("VISUAL") or | |
1331 encoding.environ.get("EDITOR", editor)) | |
1332 | 1330 |
1333 @util.propertycache | 1331 @util.propertycache |
1334 def _progbar(self): | 1332 def _progbar(self): |
1335 """setup the progbar singleton to the ui object""" | 1333 """setup the progbar singleton to the ui object""" |
1336 if (self.quiet or self.debugflag | 1334 if (self.quiet or self.debugflag |