提交 c1f9197f 编写于 作者: M Marius Storm-Olsen 提交者: Simon Hausmann

Replace \r\n with \n when importing from p4 on Windows

Signed-off-by: NMarius Storm-Olsen <marius@trolltech.com>
上级 ebd81168
......@@ -540,6 +540,7 @@ class P4Sync(Command):
self.verbose = False
self.importIntoRemotes = True
self.maxChanges = ""
self.isWindows = (platform.system() == "Windows")
def p4File(self, depotPath):
return os.popen("p4 print -q \"%s\"" % depotPath, "rb").read()
......@@ -647,6 +648,9 @@ class P4Sync(Command):
data = self.p4File(depotPath)
if self.isWindows and file["type"].endswith("text"):
data = data.replace("\r\n", "\n")
self.gitStream.write("M %s inline %s\n" % (mode, relPath))
self.gitStream.write("data %s\n" % len(data))
self.gitStream.write(data)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册