mercurial/patch.py
changeset 38329 f47608575c10
parent 38165 2ce60954b1b7
child 38332 7b12a2d2eedc
equal deleted inserted replaced
38328:aa9dd805234d 38329:f47608575c10
   705             eol = '\n'
   705             eol = '\n'
   706 
   706 
   707         if self.eolmode != 'strict' and eol and eol != '\n':
   707         if self.eolmode != 'strict' and eol and eol != '\n':
   708             rawlines = []
   708             rawlines = []
   709             for l in lines:
   709             for l in lines:
   710                 if l and l[-1] == '\n':
   710                 if l and l.endswith('\n'):
   711                     l = l[:-1] + eol
   711                     l = l[:-1] + eol
   712                 rawlines.append(l)
   712                 rawlines.append(l)
   713             lines = rawlines
   713             lines = rawlines
   714 
   714 
   715         self.backend.setfile(fname, ''.join(lines), mode, self.copysource)
   715         self.backend.setfile(fname, ''.join(lines), mode, self.copysource)