diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -230,7 +230,8 @@ class dirstate(object): self._pl = p def invalidate(self): - for a in "_map _copymap _foldmap _branch _pl _dirs _ignore".split(): + for a in ("_map", "_copymap", "_foldmap", "_branch", "_pl", "_dirs", + "_ignore"): if a in self.__dict__: delattr(self, a) self._dirty = False diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -733,7 +733,7 @@ class localrepository(repo.repository): self._branchcachetip = None def invalidate(self): - for a in "changelog manifest".split(): + for a in ("changelog", "manifest"): if a in self.__dict__: delattr(self, a) self.invalidatecaches() diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -1099,7 +1099,7 @@ def parsedate(date, formats=None, defaul if not defaults: defaults = {} now = makedate() - for part in "d mb yY HI M S".split(): + for part in ("d", "mb", "yY", "HI", "M", "S"): if part not in defaults: if part[0] in "HMS": defaults[part] = "00" @@ -1146,7 +1146,7 @@ def matchdate(date): def upper(date): d = dict(mb="12", HI="23", M="59", S="59") - for days in "31 30 29".split(): + for days in ("31", "30", "29"): try: d["d"] = days return parsedate(date, extendeddateformats, d)[0]