[PATCH] Re: FEATURE REQ: Add BZREDITOR

Robert Collins robertc at robertcollins.net
Mon Sep 19 07:13:30 BST 2005


On Sat, 2005-09-17 at 20:12 -0400, David Clymer wrote:

> Same patch, with BZREDITOR changed to BZR_EDITOR

I'm taking a variation on this:
BZR_EDITOR is checked first
then the .bzr config. (this allows library programs to override the
editor)
then EDITOR
then the os specific heuristics.

These are then tried in sequence, and first that is runnable wins.

Rob

--- bzrlib/msgeditor.py
+++ bzrlib/msgeditor.py
@@ -27,6 +27,11 @@
     """Return a sequence of possible editor binaries for the current
platform"""
     from bzrlib.osutils import _read_config_value

+    try:
+        yield os.environ["BZR_EDITOR"]
+    except KeyError:
+        pass
+
     e = _read_config_value("editor")
     if e is not None:
         yield e

@@ -34,10 +39,12 @@
     try:
         yield os.environ["EDITOR"]
     except KeyError:
-        if os.name == "nt":
-            yield "notepad.exe"
-        elif os.name == "posix":
-            yield "/usr/bin/vi"
+        pass
+
+    if os.name == "nt":
+        yield "notepad.exe"
+    elif os.name == "posix":
+        yield "/usr/bin/vi"
 

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050919/e352f740/attachment.pgp 


More information about the bazaar mailing list