changeset 1828:2b80c01b3f58

compat: drop compatibility layer around memctx The version we support all have the same API now.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 28 Feb 2017 14:24:04 +0100
parents 15ec53d46f44
children 6dd3bb408725
files hgext3rd/evolve/__init__.py
diffstat 1 files changed, 12 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/__init__.py	Tue Feb 28 14:22:25 2017 +0100
+++ b/hgext3rd/evolve/__init__.py	Tue Feb 28 14:24:04 2017 +0100
@@ -135,16 +135,6 @@
 _pack = struct.pack
 _unpack = struct.unpack
 
-if gboptsmap is not None:
-    memfilectx = context.memfilectx
-elif gboptslist is not None:
-    oldmemfilectx = context.memfilectx
-    def memfilectx(repo, *args, **kwargs):
-        return oldmemfilectx(*args, **kwargs)
-else:
-    raise ImportError('evolve needs version %s or above' %
-                      min(testedwith.split()))
-
 aliases, entry = cmdutil.findcmd('commit', commands.table)
 hasinteractivemode = any(['interactive' in e for e in entry[1]])
 if hasinteractivemode:
@@ -880,10 +870,10 @@
             if path in headmf:
                 fctx = head[path]
                 flags = fctx.flags()
-                mctx = memfilectx(repo, fctx.path(), fctx.data(),
-                                  islink='l' in flags,
-                                  isexec='x' in flags,
-                                  copied=copied.get(path))
+                mctx = context.memfilectx(repo, fctx.path(), fctx.data(),
+                                          islink='l' in flags,
+                                          isexec='x' in flags,
+                                          copied=copied.get(path))
                 return mctx
             return None
 
@@ -2036,10 +2026,10 @@
             if path in bumped:
                 fctx = bumped[path]
                 flags = fctx.flags()
-                mctx = memfilectx(repo, fctx.path(), fctx.data(),
-                                  islink='l' in flags,
-                                  isexec='x' in flags,
-                                  copied=copied.get(path))
+                mctx = context.memfilectx(repo, fctx.path(), fctx.data(),
+                                          islink='l' in flags,
+                                          isexec='x' in flags,
+                                          copied=copied.get(path))
                 return mctx
             return None
         text = 'bumped update to %s:\n\n' % prec
@@ -2708,10 +2698,10 @@
             return None
         fctx = contentctx[path]
         flags = fctx.flags()
-        mctx = memfilectx(repo, fctx.path(), fctx.data(),
-                          islink='l' in flags,
-                          isexec='x' in flags,
-                          copied=copied.get(path))
+        mctx = context.memfilectx(repo, fctx.path(), fctx.data(),
+                                  islink='l' in flags,
+                                  isexec='x' in flags,
+                                  copied=copied.get(path))
         return mctx
 
     new = context.memctx(repo,