@matheusbsbs / matheus-bagliano / commits / 48b4c3d5ab
Fork 0

Fix git-p4 on Windows to not use the Posix sysconf function.

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>

Marius Storm-Olsen committed Jul 13, 2007 at 14:39 UTC 48b4c3d5ab1610c6dc0198fe94334d78e8a82e16
1 file changed +5 -1
contrib/fast-import/git-p4
+5 -1
@@ -717,7 +717,11 @@ class P4Sync(Command):
717 # POSIX says it's 4096 bytes, default for Linux seems to be 130 K.
718 # and all OS from the table below seems to be higher than POSIX.
719 # See http://www.in-ulm.de/~mascheck/various/argmax/
720 - argmax = min(4000, os.sysconf('SC_ARG_MAX'))
720 + if (self.isWindows):
721 + argmax = 2000
722 + else:
723 + argmax = min(4000, os.sysconf('SC_ARG_MAX'))
724 +
725 chunk = ''
726 filedata = []
727 for i in xrange(len(files)):