1. Carl Meyer
  2. hgshelve

Commits

cfc  committed d95c583

Updated patch module usage for compatibility with Mercurial 1.5

patch.applydiff now takes an "eolmode" argument instead of "eol";
this is the name of the eol type, not the actual character sequence.

  • Participants
  • Parent commits 276d808
  • Branches default

Comments (0)

Files changed (1)

File hgshelve.py

View file
  • Ignore whitespace
     """
 
     eolmode = ui.config('patch', 'eol', 'strict')
-    try:
-        eol = {'strict': None, 'crlf': '\r\n', 'lf': '\n'}[eolmode.lower()]
-    except KeyError:
+
+    if eolmode.lower() not in patch.eolmodes:
         raise util.Abort(_('Unsupported line endings type: %s') % eolmode)
-
+    
     try:
         fp = file(patchobj, 'rb')
     except TypeError:
         curdir = os.getcwd()
         os.chdir(cwd)
     try:
-        ret = patch.applydiff(ui, fp, files, strip=strip, eol=eol)
+        ret = patch.applydiff(ui, fp, files, strip=strip, eolmode=eolmode)
     finally:
         if cwd:
             os.chdir(curdir)