summaryrefslogtreecommitdiff
path: root/contrib/fast-import
diff options
context:
space:
mode:
authorLibravatar Marius Storm-Olsen <marius@trolltech.com>2007-05-24 14:07:55 +0200
committerLibravatar Simon Hausmann <shausman@trolltech.com>2007-05-24 14:17:29 +0200
commitc1f9197f372a5378c3dbb36adeedf37ae175ecf1 (patch)
treed682adc00c07d39cae6e5c3b8e69fa3722288055 /contrib/fast-import
parentLoad the user map from p4 only once at run-time. (diff)
downloadtgif-c1f9197f372a5378c3dbb36adeedf37ae175ecf1.tar.xz
Replace \r\n with \n when importing from p4 on Windows
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Diffstat (limited to 'contrib/fast-import')
-rwxr-xr-xcontrib/fast-import/git-p44
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 9e9d623a3c..09b3cb5573 100755
--- 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)