提交 82cea9ff 编写于 作者: S Shawn Bohrer 提交者: Simon Hausmann

git-p4: Use P4EDITOR environment variable when set

Perforce allows you to set the P4EDITOR environment variable to your
preferred editor for use in perforce.  Since we are displaying a
perforce changelog to the user we should use it when it is defined.
Signed-off-by: NShawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: NSimon Hausmann <simon@lst.de>
上级 67abd417
......@@ -652,7 +652,10 @@ class P4Submit(Command):
defaultEditor = "vi"
if platform.system() == "Windows":
defaultEditor = "notepad"
editor = os.environ.get("EDITOR", defaultEditor);
if os.environ.has_key("P4EDITOR"):
editor = os.environ.get("P4EDITOR")
else:
editor = os.environ.get("EDITOR", defaultEditor);
system(editor + " " + fileName)
tmpFile = open(fileName, "rb")
message = tmpFile.read()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册