D1658: memfilectx: make changectx argument mandatory in constructor (API)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG79392b35e947: memfilectx: make changectx argument mandatory in constructor (API) (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1658?vs=4381&id=4418 REVISION DETAIL https://phab.mercurial-scm.org/D1658 AFFECTED FILES contrib/synthrepo.py hgext/convert/hg.py hgext/histedit.py hgext/largefiles/lfcommands.py hgext/uncommit.py mercurial/cmdutil.py mercurial/context.py mercurial/debugcommands.py tests/test-commit.t tests/test-context.py CHANGE DETAILS diff --git a/tests/test-context.py b/tests/test-context.py --- a/tests/test-context.py +++ b/tests/test-context.py @@ -32,7 +32,7 @@ # test memctx with non-ASCII commit message def filectxfn(repo, memctx, path): -return context.memfilectx(repo, "foo", "") +return context.memfilectx(repo, memctx, "foo", "") ctx = context.memctx(repo, ['tip', None], encoding.tolocal("Gr\xc3\xbcezi!"), @@ -49,7 +49,7 @@ data, flags = fctx.data(), fctx.flags() if f == 'foo': data += 'bar\n' -return context.memfilectx(repo, f, data, 'l' in flags, 'x' in flags) +return context.memfilectx(repo, memctx, f, data, 'l' in flags, 'x' in flags) ctxa = repo.changectx(0) ctxb = context.memctx(repo, [ctxa.node(), None], "test diff", ["foo"], diff --git a/tests/test-commit.t b/tests/test-commit.t --- a/tests/test-commit.t +++ b/tests/test-commit.t @@ -648,7 +648,8 @@ > u = uimod.ui.load() > r = hg.repository(u, '.') > def filectxfn(repo, memctx, path): - > return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned') + > return context.memfilectx(repo, memctx, path, + > '[hooks]\nupdate = echo owned') > c = context.memctx(r, [r['tip'].node(), node.nullid], >'evil', [notrc], filectxfn, 0) > r.commitctx(c) @@ -673,7 +674,8 @@ > u = uimod.ui.load() > r = hg.repository(u, '.') > def filectxfn(repo, memctx, path): - > return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned') + > return context.memfilectx(repo, memctx, path, + > '[hooks]\nupdate = echo owned') > c = context.memctx(r, [r['tip'].node(), node.nullid], >'evil', [notrc], filectxfn, 0) > r.commitctx(c) @@ -692,7 +694,8 @@ > u = uimod.ui.load() > r = hg.repository(u, '.') > def filectxfn(repo, memctx, path): - > return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned') + > return context.memfilectx(repo, memctx, path, + > '[hooks]\nupdate = echo owned') > c = context.memctx(r, [r['tip'].node(), node.nullid], >'evil', [notrc], filectxfn, 0) > r.commitctx(c) diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -225,7 +225,8 @@ def fctxfn(repo, cx, path): if path in filecontent: -return context.memfilectx(repo, path, filecontent[path]) +return context.memfilectx(repo, cx, path, + filecontent[path]) return None if len(ps) == 0 or ps[0] < 0: diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -2204,12 +2204,11 @@ files = self._cache.keys() def getfile(repo, memctx, path): if self._cache[path]['exists']: -return memfilectx(repo, path, +return memfilectx(repo, memctx, path, self._cache[path]['data'], 'l' in self._cache[path]['flags'], 'x' in self._cache[path]['flags'], - self._cache[path]['copied'], - memctx) + self._cache[path]['copied']) else: # Returning None, but including the path in `files`, is # necessary for memctx to register a deletion. @@ -2389,9 +2388,9 @@ copied = fctx.renamed() if copied: copied = copied[0] -return memfilectx(repo, path, fctx.data(), +return memfilectx(repo, memctx, path, fctx.data(), islink=fctx.islink(), isexec=fctx.isexec(), - copied=copied, memctx=memctx) + copied=copied) return getfilectx @@ -2405,9 +2404,8 @@ if data is None: return None islink, isexec = mode -return memfilectx(repo, path, data, islink=islink, - isexec=isexec, copied=copied, - memctx=memctx) +return memfilectx(repo, memctx, path
D1658: memfilectx: make changectx argument mandatory in constructor (API)
martinvonz added a comment. In https://phab.mercurial-scm.org/D1658#28514, @yuja wrote: > Looks good, but can you flag this as (API) change? Good point. Done. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1658 To: martinvonz, durin42, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1658: memfilectx: make changectx argument mandatory in constructor
martinvonz updated this revision to Diff 4381. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1658?vs=4365&id=4381 REVISION DETAIL https://phab.mercurial-scm.org/D1658 AFFECTED FILES contrib/synthrepo.py hgext/convert/hg.py hgext/histedit.py hgext/largefiles/lfcommands.py hgext/uncommit.py mercurial/cmdutil.py mercurial/context.py mercurial/debugcommands.py tests/test-commit.t tests/test-context.py CHANGE DETAILS diff --git a/tests/test-context.py b/tests/test-context.py --- a/tests/test-context.py +++ b/tests/test-context.py @@ -32,7 +32,7 @@ # test memctx with non-ASCII commit message def filectxfn(repo, memctx, path): -return context.memfilectx(repo, "foo", "") +return context.memfilectx(repo, memctx, "foo", "") ctx = context.memctx(repo, ['tip', None], encoding.tolocal("Gr\xc3\xbcezi!"), @@ -49,7 +49,7 @@ data, flags = fctx.data(), fctx.flags() if f == 'foo': data += 'bar\n' -return context.memfilectx(repo, f, data, 'l' in flags, 'x' in flags) +return context.memfilectx(repo, memctx, f, data, 'l' in flags, 'x' in flags) ctxa = repo.changectx(0) ctxb = context.memctx(repo, [ctxa.node(), None], "test diff", ["foo"], diff --git a/tests/test-commit.t b/tests/test-commit.t --- a/tests/test-commit.t +++ b/tests/test-commit.t @@ -648,7 +648,8 @@ > u = uimod.ui.load() > r = hg.repository(u, '.') > def filectxfn(repo, memctx, path): - > return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned') + > return context.memfilectx(repo, memctx, path, + > '[hooks]\nupdate = echo owned') > c = context.memctx(r, [r['tip'].node(), node.nullid], >'evil', [notrc], filectxfn, 0) > r.commitctx(c) @@ -673,7 +674,8 @@ > u = uimod.ui.load() > r = hg.repository(u, '.') > def filectxfn(repo, memctx, path): - > return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned') + > return context.memfilectx(repo, memctx, path, + > '[hooks]\nupdate = echo owned') > c = context.memctx(r, [r['tip'].node(), node.nullid], >'evil', [notrc], filectxfn, 0) > r.commitctx(c) @@ -692,7 +694,8 @@ > u = uimod.ui.load() > r = hg.repository(u, '.') > def filectxfn(repo, memctx, path): - > return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned') + > return context.memfilectx(repo, memctx, path, + > '[hooks]\nupdate = echo owned') > c = context.memctx(r, [r['tip'].node(), node.nullid], >'evil', [notrc], filectxfn, 0) > r.commitctx(c) diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -225,7 +225,8 @@ def fctxfn(repo, cx, path): if path in filecontent: -return context.memfilectx(repo, path, filecontent[path]) +return context.memfilectx(repo, cx, path, + filecontent[path]) return None if len(ps) == 0 or ps[0] < 0: diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -2204,12 +2204,11 @@ files = self._cache.keys() def getfile(repo, memctx, path): if self._cache[path]['exists']: -return memfilectx(repo, path, +return memfilectx(repo, memctx, path, self._cache[path]['data'], 'l' in self._cache[path]['flags'], 'x' in self._cache[path]['flags'], - self._cache[path]['copied'], - memctx) + self._cache[path]['copied']) else: # Returning None, but including the path in `files`, is # necessary for memctx to register a deletion. @@ -2389,9 +2388,9 @@ copied = fctx.renamed() if copied: copied = copied[0] -return memfilectx(repo, path, fctx.data(), +return memfilectx(repo, memctx, path, fctx.data(), islink=fctx.islink(), isexec=fctx.isexec(), - copied=copied, memctx=memctx) + copied=copied) return getfilectx @@ -2405,9 +2404,8 @@ if data is None: return None islink, isexec = mode -return memfilectx(repo, path, data, islink=islink, - isexec=isexec, copied=copied, - memctx=memctx) +return memfilectx(repo, memctx, path, data, islink=islink, + isexec=isexec, copied=copied) return getfilectx @@ -2539,16 +2537,16 @@ See memctx and committablefilect
D1658: memfilectx: make changectx argument mandatory in constructor
yuja added a comment. Looks good, but can you flag this as (API) change? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1658 To: martinvonz, durin42, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1658: memfilectx: make changectx argument mandatory in constructor
martinvonz added a comment. In https://phab.mercurial-scm.org/D1658#28406, @durin42 wrote: > This seems to break test-rebase-inmemory.t - could you take a look? Sorry, I was lazy and didn't run the tests after the last rebase. Phil's new test-rebase-inmemory.t caught a bug (thanks!). I also found another bug in synthrepo that I have now fixed. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1658 To: martinvonz, durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1658: memfilectx: make changectx argument mandatory in constructor
martinvonz updated this revision to Diff 4365. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1658?vs=4358&id=4365 REVISION DETAIL https://phab.mercurial-scm.org/D1658 AFFECTED FILES contrib/synthrepo.py hgext/convert/hg.py hgext/histedit.py hgext/largefiles/lfcommands.py hgext/uncommit.py mercurial/cmdutil.py mercurial/context.py mercurial/debugcommands.py tests/test-commit.t tests/test-context.py CHANGE DETAILS diff --git a/tests/test-context.py b/tests/test-context.py --- a/tests/test-context.py +++ b/tests/test-context.py @@ -32,7 +32,7 @@ # test memctx with non-ASCII commit message def filectxfn(repo, memctx, path): -return context.memfilectx(repo, "foo", "") +return context.memfilectx(repo, memctx, "foo", "") ctx = context.memctx(repo, ['tip', None], encoding.tolocal("Gr\xc3\xbcezi!"), @@ -49,7 +49,7 @@ data, flags = fctx.data(), fctx.flags() if f == 'foo': data += 'bar\n' -return context.memfilectx(repo, f, data, 'l' in flags, 'x' in flags) +return context.memfilectx(repo, memctx, f, data, 'l' in flags, 'x' in flags) ctxa = repo.changectx(0) ctxb = context.memctx(repo, [ctxa.node(), None], "test diff", ["foo"], diff --git a/tests/test-commit.t b/tests/test-commit.t --- a/tests/test-commit.t +++ b/tests/test-commit.t @@ -648,7 +648,8 @@ > u = uimod.ui.load() > r = hg.repository(u, '.') > def filectxfn(repo, memctx, path): - > return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned') + > return context.memfilectx(repo, memctx, path, + > '[hooks]\nupdate = echo owned') > c = context.memctx(r, [r['tip'].node(), node.nullid], >'evil', [notrc], filectxfn, 0) > r.commitctx(c) @@ -673,7 +674,8 @@ > u = uimod.ui.load() > r = hg.repository(u, '.') > def filectxfn(repo, memctx, path): - > return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned') + > return context.memfilectx(repo, memctx, path, + > '[hooks]\nupdate = echo owned') > c = context.memctx(r, [r['tip'].node(), node.nullid], >'evil', [notrc], filectxfn, 0) > r.commitctx(c) @@ -692,7 +694,8 @@ > u = uimod.ui.load() > r = hg.repository(u, '.') > def filectxfn(repo, memctx, path): - > return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned') + > return context.memfilectx(repo, memctx, path, + > '[hooks]\nupdate = echo owned') > c = context.memctx(r, [r['tip'].node(), node.nullid], >'evil', [notrc], filectxfn, 0) > r.commitctx(c) diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -225,7 +225,8 @@ def fctxfn(repo, cx, path): if path in filecontent: -return context.memfilectx(repo, path, filecontent[path]) +return context.memfilectx(repo, cx, path, + filecontent[path]) return None if len(ps) == 0 or ps[0] < 0: diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -2204,12 +2204,11 @@ files = self._cache.keys() def getfile(repo, memctx, path): if self._cache[path]['exists']: -return memfilectx(repo, path, +return memfilectx(repo, memctx, path, self._cache[path]['data'], 'l' in self._cache[path]['flags'], 'x' in self._cache[path]['flags'], - self._cache[path]['copied'], - memctx) + self._cache[path]['copied']) else: # Returning None, but including the path in `files`, is # necessary for memctx to register a deletion. @@ -2389,9 +2388,9 @@ copied = fctx.renamed() if copied: copied = copied[0] -return memfilectx(repo, path, fctx.data(), +return memfilectx(repo, memctx, path, fctx.data(), islink=fctx.islink(), isexec=fctx.isexec(), - copied=copied, memctx=memctx) + copied=copied) return getfilectx @@ -2405,9 +2404,8 @@ if data is None: return None islink, isexec = mode -return memfilectx(repo, path, data, islink=islink, - isexec=isexec, copied=copied, - memctx=memctx) +return memfilectx(repo, memctx, path, data, islink=islink, + isexec=isexec, copied=copied) return getfilectx @@ -2539,16 +2537,16 @@ See memctx and committablefilect
D1658: memfilectx: make changectx argument mandatory in constructor
durin42 requested changes to this revision. durin42 added a comment. This revision now requires changes to proceed. This seems to break test-rebase-inmemory.t - could you take a look? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1658 To: martinvonz, durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1658: memfilectx: make changectx argument mandatory in constructor
martinvonz updated this revision to Diff 4358. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1658?vs=4356&id=4358 REVISION DETAIL https://phab.mercurial-scm.org/D1658 AFFECTED FILES contrib/synthrepo.py hgext/convert/hg.py hgext/histedit.py hgext/largefiles/lfcommands.py hgext/uncommit.py mercurial/cmdutil.py mercurial/context.py mercurial/debugcommands.py tests/test-commit.t tests/test-context.py CHANGE DETAILS diff --git a/tests/test-context.py b/tests/test-context.py --- a/tests/test-context.py +++ b/tests/test-context.py @@ -32,7 +32,7 @@ # test memctx with non-ASCII commit message def filectxfn(repo, memctx, path): -return context.memfilectx(repo, "foo", "") +return context.memfilectx(repo, memctx, "foo", "") ctx = context.memctx(repo, ['tip', None], encoding.tolocal("Gr\xc3\xbcezi!"), @@ -49,7 +49,7 @@ data, flags = fctx.data(), fctx.flags() if f == 'foo': data += 'bar\n' -return context.memfilectx(repo, f, data, 'l' in flags, 'x' in flags) +return context.memfilectx(repo, memctx, f, data, 'l' in flags, 'x' in flags) ctxa = repo.changectx(0) ctxb = context.memctx(repo, [ctxa.node(), None], "test diff", ["foo"], diff --git a/tests/test-commit.t b/tests/test-commit.t --- a/tests/test-commit.t +++ b/tests/test-commit.t @@ -648,7 +648,8 @@ > u = uimod.ui.load() > r = hg.repository(u, '.') > def filectxfn(repo, memctx, path): - > return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned') + > return context.memfilectx(repo, memctx, path, + > '[hooks]\nupdate = echo owned') > c = context.memctx(r, [r['tip'].node(), node.nullid], >'evil', [notrc], filectxfn, 0) > r.commitctx(c) @@ -673,7 +674,8 @@ > u = uimod.ui.load() > r = hg.repository(u, '.') > def filectxfn(repo, memctx, path): - > return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned') + > return context.memfilectx(repo, memctx, path, + > '[hooks]\nupdate = echo owned') > c = context.memctx(r, [r['tip'].node(), node.nullid], >'evil', [notrc], filectxfn, 0) > r.commitctx(c) @@ -692,7 +694,8 @@ > u = uimod.ui.load() > r = hg.repository(u, '.') > def filectxfn(repo, memctx, path): - > return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned') + > return context.memfilectx(repo, memctx, path, + > '[hooks]\nupdate = echo owned') > c = context.memctx(r, [r['tip'].node(), node.nullid], >'evil', [notrc], filectxfn, 0) > r.commitctx(c) diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -225,7 +225,8 @@ def fctxfn(repo, cx, path): if path in filecontent: -return context.memfilectx(repo, path, filecontent[path]) +return context.memfilectx(repo, cx, path, + filecontent[path]) return None if len(ps) == 0 or ps[0] < 0: diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -2389,9 +2389,9 @@ copied = fctx.renamed() if copied: copied = copied[0] -return memfilectx(repo, path, fctx.data(), +return memfilectx(repo, memctx, path, fctx.data(), islink=fctx.islink(), isexec=fctx.isexec(), - copied=copied, memctx=memctx) + copied=copied) return getfilectx @@ -2405,9 +2405,8 @@ if data is None: return None islink, isexec = mode -return memfilectx(repo, path, data, islink=islink, - isexec=isexec, copied=copied, - memctx=memctx) +return memfilectx(repo, memctx, path, data, islink=islink, + isexec=isexec, copied=copied) return getfilectx @@ -2539,16 +2538,16 @@ See memctx and committablefilectx for more details. """ -def __init__(self, repo, path, data, islink=False, - isexec=False, copied=None, memctx=None): +def __init__(self, repo, changectx, path, data, islink=False, + isexec=False, copied=None): """ path is the normalized file path relative to repository root. data is the file content as a string. islink is True if the file is a symbolic link. isexec is True if the file is executable. copied is the source file path if current file was copied in the revision being committed, or None.""" -super(memfilectx, self).__init__(repo, path, None, memctx) +super(memfilectx, self).__init__(repo, path, None, changectx) self._data = d
D1658: memfilectx: make changectx argument mandatory in constructor
martinvonz created this revision. Herald added a reviewer: durin42. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 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. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1658 AFFECTED FILES contrib/synthrepo.py hgext/convert/hg.py hgext/histedit.py hgext/largefiles/lfcommands.py hgext/uncommit.py mercurial/cmdutil.py mercurial/context.py mercurial/debugcommands.py tests/test-commit.t tests/test-context.py CHANGE DETAILS diff --git a/tests/test-context.py b/tests/test-context.py --- a/tests/test-context.py +++ b/tests/test-context.py @@ -32,7 +32,7 @@ # test memctx with non-ASCII commit message def filectxfn(repo, memctx, path): -return context.memfilectx(repo, "foo", "") +return context.memfilectx(repo, memctx, "foo", "") ctx = context.memctx(repo, ['tip', None], encoding.tolocal("Gr\xc3\xbcezi!"), @@ -49,7 +49,7 @@ data, flags = fctx.data(), fctx.flags() if f == 'foo': data += 'bar\n' -return context.memfilectx(repo, f, data, 'l' in flags, 'x' in flags) +return context.memfilectx(repo, memctx, f, data, 'l' in flags, 'x' in flags) ctxa = repo.changectx(0) ctxb = context.memctx(repo, [ctxa.node(), None], "test diff", ["foo"], diff --git a/tests/test-commit.t b/tests/test-commit.t --- a/tests/test-commit.t +++ b/tests/test-commit.t @@ -648,7 +648,8 @@ > u = uimod.ui.load() > r = hg.repository(u, '.') > def filectxfn(repo, memctx, path): - > return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned') + > return context.memfilectx(repo, memctx, path, + > '[hooks]\nupdate = echo owned') > c = context.memctx(r, [r['tip'].node(), node.nullid], >'evil', [notrc], filectxfn, 0) > r.commitctx(c) @@ -673,7 +674,8 @@ > u = uimod.ui.load() > r = hg.repository(u, '.') > def filectxfn(repo, memctx, path): - > return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned') + > return context.memfilectx(repo, memctx, path, + > '[hooks]\nupdate = echo owned') > c = context.memctx(r, [r['tip'].node(), node.nullid], >'evil', [notrc], filectxfn, 0) > r.commitctx(c) @@ -692,7 +694,8 @@ > u = uimod.ui.load() > r = hg.repository(u, '.') > def filectxfn(repo, memctx, path): - > return context.memfilectx(repo, path, '[hooks]\nupdate = echo owned') + > return context.memfilectx(repo, memctx, path, + > '[hooks]\nupdate = echo owned') > c = context.memctx(r, [r['tip'].node(), node.nullid], >'evil', [notrc], filectxfn, 0) > r.commitctx(c) diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -225,7 +225,8 @@ def fctxfn(repo, cx, path): if path in filecontent: -return context.memfilectx(repo, path, filecontent[path]) +return context.memfilectx(repo, cx, path, + filecontent[path]) return None if len(ps) == 0 or ps[0] < 0: diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -2239,9 +2239,9 @@ copied = fctx.renamed() if copied: copied = copied[0] -return memfilectx(repo, path, fctx.data(), +return memfilectx(repo, memctx, path, fctx.data(), islink=fctx.islink(), isexec=fctx.isexec(), - copied=copied, memctx=memctx) + copied=copied) return getfilectx @@ -2255,9 +2255,8 @@ if data is None: return None islink, isexec = mode -return memfilectx(repo, path, data, islink=islink, - isexec=isexec, copied=copied, - memctx=memctx) +return memfilectx(repo, memctx, path, data, islink=islink, + isexec=isexec, copied=copied) return getfilectx @@ -2389,16 +2388,16 @@ See memctx and committablefilectx for more details. """ -def __init__(self, repo, path, data, islink=False, -