Show More
@@ -11,6 +11,8 b' import cPickle as pickle' | |||||
11 | from mercurial import util |
|
11 | from mercurial import util | |
12 | from mercurial.i18n import _ |
|
12 | from mercurial.i18n import _ | |
13 |
|
13 | |||
|
14 | propertycache = util.propertycache | |||
|
15 | ||||
14 | def encodeargs(args): |
|
16 | def encodeargs(args): | |
15 | def encodearg(s): |
|
17 | def encodearg(s): | |
16 | lines = base64.encodestring(s) |
|
18 | lines = base64.encodestring(s) | |
@@ -321,14 +323,12 b' class commandline(object):' | |||||
321 | self.checkexit(status, ''.join(output)) |
|
323 | self.checkexit(status, ''.join(output)) | |
322 | return output |
|
324 | return output | |
323 |
|
325 | |||
324 | def getargmax(self): |
|
326 | @propertycache | |
325 | if '_argmax' in self.__dict__: |
|
327 | def argmax(self): | |
326 | return self._argmax |
|
|||
327 |
|
||||
328 | # POSIX requires at least 4096 bytes for ARG_MAX |
|
328 | # POSIX requires at least 4096 bytes for ARG_MAX | |
329 |
|
|
329 | argmax = 4096 | |
330 | try: |
|
330 | try: | |
331 |
|
|
331 | argmax = os.sysconf("SC_ARG_MAX") | |
332 | except: |
|
332 | except: | |
333 | pass |
|
333 | pass | |
334 |
|
334 | |||
@@ -339,13 +339,11 b' class commandline(object):' | |||||
339 |
|
339 | |||
340 | # Since ARG_MAX is for command line _and_ environment, lower our limit |
|
340 | # Since ARG_MAX is for command line _and_ environment, lower our limit | |
341 | # (and make happy Windows shells while doing this). |
|
341 | # (and make happy Windows shells while doing this). | |
342 |
|
342 | return argmax / 2 - 1 | ||
343 | self._argmax = self._argmax / 2 - 1 |
|
|||
344 | return self._argmax |
|
|||
345 |
|
343 | |||
346 | def limit_arglist(self, arglist, cmd, closestdin, *args, **kwargs): |
|
344 | def limit_arglist(self, arglist, cmd, closestdin, *args, **kwargs): | |
347 | cmdlen = len(self._cmdline(cmd, closestdin, *args, **kwargs)) |
|
345 | cmdlen = len(self._cmdline(cmd, closestdin, *args, **kwargs)) | |
348 |
limit = self. |
|
346 | limit = self.argmax - cmdlen | |
349 | bytes = 0 |
|
347 | bytes = 0 | |
350 | fl = [] |
|
348 | fl = [] | |
351 | for fn in arglist: |
|
349 | for fn in arglist: |
General Comments 0
You need to be logged in to leave comments.
Login now