diff --git a/hgext/convert/common.py b/hgext/convert/common.py --- a/hgext/convert/common.py +++ b/hgext/convert/common.py @@ -339,7 +339,7 @@ class commandline(object): # Since ARG_MAX is for command line _and_ environment, lower our limit # (and make happy Windows shells while doing this). - return argmax / 2 - 1 + return argmax // 2 - 1 def limit_arglist(self, arglist, cmd, closestdin, *args, **kwargs): cmdlen = len(self._cmdline(cmd, closestdin, *args, **kwargs)) diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -49,7 +49,7 @@ class dirstate(object): self._rootdir = os.path.join(root, '') self._dirty = False self._dirtypl = False - self._lastnormaltime = None + self._lastnormaltime = 0 self._ui = ui @propertycache @@ -251,7 +251,7 @@ class dirstate(object): "_ignore"): if a in self.__dict__: delattr(self, a) - self._lastnormaltime = None + self._lastnormaltime = 0 self._dirty = False def copy(self, source, dest): @@ -415,7 +415,7 @@ class dirstate(object): delattr(self, "_dirs") self._copymap = {} self._pl = [nullid, nullid] - self._lastnormaltime = None + self._lastnormaltime = 0 self._dirty = True def rebuild(self, parent, files): @@ -463,7 +463,7 @@ class dirstate(object): write(f) st.write(cs.getvalue()) st.close() - self._lastnormaltime = None + self._lastnormaltime = 0 self._dirty = self._dirtypl = False def _dirignore(self, f): diff --git a/mercurial/httpconnection.py b/mercurial/httpconnection.py --- a/mercurial/httpconnection.py +++ b/mercurial/httpconnection.py @@ -38,7 +38,7 @@ class httpsendfile(object): self.write = self._data.write self.length = os.fstat(self._data.fileno()).st_size self._pos = 0 - self._total = self.length / 1024 * 2 + self._total = self.length // 1024 * 2 def read(self, *args, **kwargs): try: @@ -51,7 +51,7 @@ class httpsendfile(object): # requires authentication. Since we can't know until we try # once whether authentication will be required, just lie to # the user and maybe the push succeeds suddenly at 50%. - self.ui.progress(_('sending'), self._pos / 1024, + self.ui.progress(_('sending'), self._pos // 1024, unit=_('kb'), total=self._total) return ret diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -438,6 +438,8 @@ class cachestat(object): def cacheable(self): return bool(self.stat.st_ino) + __hash__ = object.__hash__ + def __eq__(self, other): try: return self.stat == other.stat diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1108,7 +1108,7 @@ def formatspec(expr, *args): return '(0-0)' # a minimal way to represent an empty set if l == 1: return argtype(t, s[0]) - m = l / 2 + m = l // 2 return '(%s or %s)' % (listexp(s[:m], t), listexp(s[m:], t)) ret = ''