Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Replace \r\n with \n when importing from p4 on Windows
author
Marius Storm-Olsen
<marius@trolltech.com>
Thu, 24 May 2007 12:07:55 +0000
(14:07 +0200)
committer
Simon Hausmann
<shausman@trolltech.com>
Thu, 24 May 2007 12:17:29 +0000
(14:17 +0200)
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
contrib/fast-import/git-p4
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
ebd8116
)
diff --git
a/contrib/fast-import/git-p4
b/contrib/fast-import/git-p4
index 9e9d623a3c1d34c93f2e3a383762b248188869b6..09b3cb5573a5667394ea62729991ada7ebf14972 100755
(executable)
--- a/
contrib/fast-import/git-p4
+++ b/
contrib/fast-import/git-p4
@@
-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)