Skip to content

Commit 48b4c3d

Browse files
Marius Storm-Olsenspearce
authored andcommitted
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>
1 parent c7bd550 commit 48b4c3d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contrib/fast-import/git-p4

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,11 @@ class P4Sync(Command):
717717
# POSIX says it's 4096 bytes, default for Linux seems to be 130 K.
718718
# and all OS from the table below seems to be higher than POSIX.
719719
# 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+
721725
chunk = ''
722726
filedata = []
723727
for i in xrange(len(files)):

0 commit comments

Comments
 (0)