Fix git-p4 on Windows to not use the Posix sysconf function.
authorMarius Storm-Olsen <marius@trolltech.com>
Fri, 13 Jul 2007 12:39:05 +0000 (14:39 +0200)
committerShawn O. Pearce <spearce@spearce.org>
Sun, 15 Jul 2007 02:47:14 +0000 (22:47 -0400)
Add condition for Windows, since it doesn't support the os.sysconf module.
We hardcode the commandline limit to 2K, as that should work on most
Windows platforms.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
contrib/fast-import/git-p4

index 54a05eb..d877150 100755 (executable)
@@ -717,7 +717,11 @@ class P4Sync(Command):
         # POSIX says it's 4096 bytes, default for Linux seems to be 130 K.
         # and all OS from the table below seems to be higher than POSIX.
         # See http://www.in-ulm.de/~mascheck/various/argmax/
-        argmax = min(4000, os.sysconf('SC_ARG_MAX'))
+        if (self.isWindows):
+            argmax = 2000
+        else:
+            argmax = min(4000, os.sysconf('SC_ARG_MAX'))
+
         chunk = ''
         filedata = []
         for i in xrange(len(files)):