##// END OF EJS Templates
Use explicit integer division...
Martin Geisler -
r15791:a814f8fc default
parent child Browse files
Show More
@@ -339,7 +339,7 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 return argmax / 2 - 1
342 return argmax // 2 - 1
343
343
344 def limit_arglist(self, arglist, cmd, closestdin, *args, **kwargs):
344 def limit_arglist(self, arglist, cmd, closestdin, *args, **kwargs):
345 cmdlen = len(self._cmdline(cmd, closestdin, *args, **kwargs))
345 cmdlen = len(self._cmdline(cmd, closestdin, *args, **kwargs))
@@ -49,7 +49,7 b' class dirstate(object):'
49 self._rootdir = os.path.join(root, '')
49 self._rootdir = os.path.join(root, '')
50 self._dirty = False
50 self._dirty = False
51 self._dirtypl = False
51 self._dirtypl = False
52 self._lastnormaltime = None
52 self._lastnormaltime = 0
53 self._ui = ui
53 self._ui = ui
54
54
55 @propertycache
55 @propertycache
@@ -251,7 +251,7 b' class dirstate(object):'
251 "_ignore"):
251 "_ignore"):
252 if a in self.__dict__:
252 if a in self.__dict__:
253 delattr(self, a)
253 delattr(self, a)
254 self._lastnormaltime = None
254 self._lastnormaltime = 0
255 self._dirty = False
255 self._dirty = False
256
256
257 def copy(self, source, dest):
257 def copy(self, source, dest):
@@ -415,7 +415,7 b' class dirstate(object):'
415 delattr(self, "_dirs")
415 delattr(self, "_dirs")
416 self._copymap = {}
416 self._copymap = {}
417 self._pl = [nullid, nullid]
417 self._pl = [nullid, nullid]
418 self._lastnormaltime = None
418 self._lastnormaltime = 0
419 self._dirty = True
419 self._dirty = True
420
420
421 def rebuild(self, parent, files):
421 def rebuild(self, parent, files):
@@ -463,7 +463,7 b' class dirstate(object):'
463 write(f)
463 write(f)
464 st.write(cs.getvalue())
464 st.write(cs.getvalue())
465 st.close()
465 st.close()
466 self._lastnormaltime = None
466 self._lastnormaltime = 0
467 self._dirty = self._dirtypl = False
467 self._dirty = self._dirtypl = False
468
468
469 def _dirignore(self, f):
469 def _dirignore(self, f):
@@ -38,7 +38,7 b' class httpsendfile(object):'
38 self.write = self._data.write
38 self.write = self._data.write
39 self.length = os.fstat(self._data.fileno()).st_size
39 self.length = os.fstat(self._data.fileno()).st_size
40 self._pos = 0
40 self._pos = 0
41 self._total = self.length / 1024 * 2
41 self._total = self.length // 1024 * 2
42
42
43 def read(self, *args, **kwargs):
43 def read(self, *args, **kwargs):
44 try:
44 try:
@@ -51,7 +51,7 b' class httpsendfile(object):'
51 # requires authentication. Since we can't know until we try
51 # requires authentication. Since we can't know until we try
52 # once whether authentication will be required, just lie to
52 # once whether authentication will be required, just lie to
53 # the user and maybe the push succeeds suddenly at 50%.
53 # the user and maybe the push succeeds suddenly at 50%.
54 self.ui.progress(_('sending'), self._pos / 1024,
54 self.ui.progress(_('sending'), self._pos // 1024,
55 unit=_('kb'), total=self._total)
55 unit=_('kb'), total=self._total)
56 return ret
56 return ret
57
57
@@ -438,6 +438,8 b' class cachestat(object):'
438 def cacheable(self):
438 def cacheable(self):
439 return bool(self.stat.st_ino)
439 return bool(self.stat.st_ino)
440
440
441 __hash__ = object.__hash__
442
441 def __eq__(self, other):
443 def __eq__(self, other):
442 try:
444 try:
443 return self.stat == other.stat
445 return self.stat == other.stat
@@ -1108,7 +1108,7 b' def formatspec(expr, *args):'
1108 return '(0-0)' # a minimal way to represent an empty set
1108 return '(0-0)' # a minimal way to represent an empty set
1109 if l == 1:
1109 if l == 1:
1110 return argtype(t, s[0])
1110 return argtype(t, s[0])
1111 m = l / 2
1111 m = l // 2
1112 return '(%s or %s)' % (listexp(s[:m], t), listexp(s[m:], t))
1112 return '(%s or %s)' % (listexp(s[:m], t), listexp(s[m:], t))
1113
1113
1114 ret = ''
1114 ret = ''
General Comments 0
You need to be logged in to leave comments. Login now