comparison mercurial/patch.py @ 14832:d60e4f227d75 stable

patch: fix parsing patch files containing CRs not followed by LFs Since 1e64e1e12195 , patch lines containing a CR not followed by a LF would be incorrectly splitten, causing a failure to apply the patch.
author Wagner Bruna <wbruna@softwareexpress.com.br>
date Mon, 04 Jul 2011 19:53:39 -0300
parents a7d5816087a9
children 0588fb0e2e8d db0646afb725
comparison
equal deleted inserted replaced
14831:0407b7613e99 14832:d60e4f227d75
591 else: 591 else:
592 data, mode = store.getfile(self.copysource)[:2] 592 data, mode = store.getfile(self.copysource)[:2]
593 self.exists = backend.exists(self.fname) 593 self.exists = backend.exists(self.fname)
594 self.missing = False 594 self.missing = False
595 if data: 595 if data:
596 self.lines = data.splitlines(True) 596 self.lines = mdiff.splitnewlines(data)
597 if self.mode is None: 597 if self.mode is None:
598 self.mode = mode 598 self.mode = mode
599 if self.lines: 599 if self.lines:
600 # Normalize line endings 600 # Normalize line endings
601 if self.lines[0].endswith('\r\n'): 601 if self.lines[0].endswith('\r\n'):