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