diff -r 49b82cdb5983 -r a1bcc7ff0eac mercurial/patch.py --- a/mercurial/patch.py Mon Apr 09 21:06:46 2018 +0900 +++ b/mercurial/patch.py Mon Apr 09 21:08:52 2018 +0900 @@ -795,8 +795,7 @@ # if there's skew we want to emit the "(offset %d lines)" even # when the hunk cleanly applies at start + skew, so skip the # fast case code - if (self.skew == 0 and - diffhelpers.testhunk(old, self.lines, oldstart) == 0): + if self.skew == 0 and diffhelpers.testhunk(old, self.lines, oldstart): if self.remove: self.backend.unlink(self.fname) else: @@ -823,7 +822,7 @@ cand = [oldstart] for l in cand: - if not old or diffhelpers.testhunk(old, self.lines, l) == 0: + if not old or diffhelpers.testhunk(old, self.lines, l): self.lines[l : l + len(old)] = new self.offset += len(new) - len(old) self.skew = l - orig_start