diff hgext/histedit.py @ 35400:8a0cac20a1ad

memfilectx: make changectx argument mandatory in constructor (API) committablefilectx has three subclasses: workingfilectx, memfilectx, and overlayfilectx. committablefilectx takes an optional (change) ctx instance to its constructor. If it's provided, it's set on the instance as self._changectx. If not, that property is supposed to be defined by the class. However, only workingfilectx does that. The other two will have the property undefined if it's not passed in the constructor. That seems bad to me. This patch makes the changectx argument to the memfilectx constructor mandatory because that fixes the failure I ran into. It seems like we should also fix the overlayfilectx case. Differential Revision: https://phab.mercurial-scm.org/D1658
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 11 Dec 2017 09:27:40 -0800
parents a9cc233de513
children a51541681b8d
line wrap: on
line diff
--- a/hgext/histedit.py	Sat Dec 09 14:22:12 2017 -0800
+++ b/hgext/histedit.py	Mon Dec 11 09:27:40 2017 -0800
@@ -602,7 +602,7 @@
         if path in headmf:
             fctx = last[path]
             flags = fctx.flags()
-            mctx = context.memfilectx(repo,
+            mctx = context.memfilectx(repo, ctx,
                                       fctx.path(), fctx.data(),
                                       islink='l' in flags,
                                       isexec='x' in flags,