# HG changeset patch # User Sean Farley # Date 1401756829 18000 # Node ID b1a6edc78bfb04f6fc3bd58ffce343ab0d2313f5 # Parent 1414cdafa7af509a2fd98dfaeac0894b80ea7d45 compathacks: add wrapper for memfilectx diff --git a/hgsubversion/compathacks.py b/hgsubversion/compathacks.py --- a/hgsubversion/compathacks.py +++ b/hgsubversion/compathacks.py @@ -15,3 +15,14 @@ def pickle_load(f): import cPickle as pickle f.seek(0) return pickle.load(f) + +def makememfilectx(repo, path, data, islink, isexec, copied): + """Return a memfilectx + + Works around memfilectx() adding a repo argument between 3.0 and 3.1. + """ + from mercurial import context + try: + return context.memfilectx(repo, path, data, islink, isexec, copied) + except TypeError: + return context.memfilectx(path, data, islink, isexec, copied)