diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -190,7 +190,7 @@ class changelogrevision(object): # The list of files may be empty. Which means nl3 is the first of the # double newline that precedes the description. - if text[nl3 + 1] == '\n': + if text[nl3 + 1:nl3 + 2] == '\n': doublenl = nl3 else: doublenl = text.index('\n\n', nl3 + 1) diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -491,10 +491,10 @@ def makefilename(repo, pat, node, desc=N patlen = len(pat) i = 0 while i < patlen: - c = pat[i] + c = pat[i:i + 1] if c == '%': i += 1 - c = pat[i] + c = pat[i:i + 1] c = expander[c]() newname.append(c) i += 1 diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -1980,13 +1980,13 @@ def parsedate(date, formats=None, bias=N # this piece is for rounding the specific end of unknowns b = bias.get(part) if b is None: - if part[0] in "HMS": + if part[0:1] in "HMS": b = "00" else: b = "0" # this piece is for matching the generic end to today's date - n = datestr(now, "%" + part[0]) + n = datestr(now, "%" + part[0:1]) defaults[part] = (b, n)