Commits

Colin Caughie  committed b0c9980

Modified to heed the new EOL options added in Mercurial 1.3

Copied the new code from patch.internalpatch() into hgshelve.

  • Participants
  • Parent commits 1881565

Comments (0)

Files changed (1)

     
     Adapted from patch.internalpatch() to support reverse patching.
     """
+
+    eolmode = ui.config('patch', 'eol', 'strict')
+    try:
+        eol = {'strict': None, 'crlf': '\r\n', 'lf': '\n'}[eolmode.lower()]
+    except KeyError:
+        raise util.Abort(_('Unsupported line endings type: %s') % eolmode)
+
     try:
         fp = file(patchobj, 'rb')
     except TypeError:
         os.chdir(cwd)
     try:
         ret = patch.applydiff(ui, fp, files, strip=strip, 
-                              reverse=reverse)
+                              reverse=reverse, eol=eol)
     finally:
         if cwd:
             os.chdir(curdir)