# HG changeset patch # User Benoit Boissinot # Date 2010-02-26 15:52:43 # Node ID f61dced1367afb199614e60510ab0a98dcac1822 # Parent 8036bc1871c2079fb4f2449d95e51ab37f943137 fix test-mq-eol under --pure (mimic diffhelper.c behaviour) bug discovered by apycot (apycot.hg-scm.org) diff --git a/mercurial/pure/diffhelpers.py b/mercurial/pure/diffhelpers.py --- a/mercurial/pure/diffhelpers.py +++ b/mercurial/pure/diffhelpers.py @@ -34,11 +34,15 @@ def addlines(fp, hunk, lena, lenb, a, b) def fix_newline(hunk, a, b): l = hunk[-1] - c = l[0] - hline = l[:-1] + # tolerate CRLF in last line + if l.endswith('\r\n'): + hline = l[:-2] + else: + hline = l[:-1] + c = hline[0] if c == " " or c == "+": - b[-1] = l[1:-1] + b[-1] = hline[1:] if c == " " or c == "-": a[-1] = hline hunk[-1] = hline