summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorShawn Bohrer <shawn.bohrer@gmail.com>2008-03-13 00:03:24 (GMT)
committerSimon Hausmann <simon@lst.de>2008-03-13 07:57:29 (GMT)
commit82cea9ffb1c4677155e3e2996d76542502611370 (patch)
tree4c51f5cf44ff19cd17541c016edfef9a8fea6030 /contrib
parent67abd417165d1e7716d947949f5e5e27318c8a29 (diff)
downloadgit-82cea9ffb1c4677155e3e2996d76542502611370.zip
git-82cea9ffb1c4677155e3e2996d76542502611370.tar.gz
git-82cea9ffb1c4677155e3e2996d76542502611370.tar.bz2
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>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/fast-import/git-p45
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 28b9c3c..3cb0330 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -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()