Skip to content

Commit 82cea9f

Browse files
sbohrertronical
authored andcommitted
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: Shawn Bohrer <shawn.bohrer@gmail.com> Signed-off-by: Simon Hausmann <simon@lst.de>
1 parent 67abd41 commit 82cea9f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

contrib/fast-import/git-p4

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,10 @@ class P4Submit(Command):
652652
defaultEditor = "vi"
653653
if platform.system() == "Windows":
654654
defaultEditor = "notepad"
655-
editor = os.environ.get("EDITOR", defaultEditor);
655+
if os.environ.has_key("P4EDITOR"):
656+
editor = os.environ.get("P4EDITOR")
657+
else:
658+
editor = os.environ.get("EDITOR", defaultEditor);
656659
system(editor + " " + fileName)
657660
tmpFile = open(fileName, "rb")
658661
message = tmpFile.read()

0 commit comments

Comments
 (0)