summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: caace11)
raw | patch | inline | side by side (parent: caace11)
author | Simon Hausmann <hausmann@kde.org> | |
Tue, 15 May 2007 13:15:39 +0000 (15:15 +0200) | ||
committer | Simon Hausmann <shausman@trolltech.com> | |
Tue, 15 May 2007 13:15:07 +0000 (15:15 +0200) |
Signed-off-by: Simon Hausmann <hausmann@kde.org>
contrib/fast-import/git-p4 | patch | blob | history |
index d83ce1ae95175f2c239f302948272a771b1b9146..d134a28189182eaf021c26b1a485d182568163f3 100755 (executable)
#
import optparse, sys, os, marshal, popen2, subprocess, shelve
-import tempfile, getopt, sha, os.path, time
+import tempfile, getopt, sha, os.path, time, platform
from sets import Set;
gitdir = os.environ.get("GIT_DIR", "")
diff += "+" + line
f.close()
- separatorLine = "######## everything below this line is just the diff #######\n"
+ separatorLine = "######## everything below this line is just the diff #######"
+ if platform.system() == "Windows":
+ separatorLine += "\r"
+ separatorLine += "\n"
response = "e"
firstIteration = True
tmpFile = os.fdopen(handle, "w+")
tmpFile.write(submitTemplate + separatorLine + diff)
tmpFile.close()
- editor = os.environ.get("EDITOR", "vi")
+ defaultEditor = "vi"
+ if platform.system() == "Windows":
+ defaultEditor = "notepad"
+ editor = os.environ.get("EDITOR", defaultEditor);
system(editor + " " + fileName)
- tmpFile = open(fileName, "r")
+ tmpFile = open(fileName, "rb")
message = tmpFile.read()
tmpFile.close()
os.remove(fileName)
print submitTemplate
raw_input("Press return to continue...")
else:
- pipe = mypopen("p4 submit -i", "w")
+ pipe = os.popen("p4 submit -i", "wb")
pipe.write(submitTemplate)
pipe.close()
else: