# HG changeset patch # User Martin von Zweigbergk # Date 2019-03-20 05:58:39 # Node ID 550a172a603b9ed6950f4eab8fea27861e773f67 # Parent cde5827d09a73cddd67ff69035e33b37ada88de6 memctx: rename constructor argument "copied" to "copysource" (API) It's just the path, not the nodeid, so "copysource" seems more appropriate. Differential Revision: https://phab.mercurial-scm.org/D6158 diff --git a/hgext/fix.py b/hgext/fix.py --- a/hgext/fix.py +++ b/hgext/fix.py @@ -601,7 +601,7 @@ def replacerev(ui, repo, ctx, filedata, if path not in ctx: return None fctx = ctx[path] - copied = fctx.copysource() + copysource = fctx.copysource() return context.memfilectx( repo, memctx, @@ -609,7 +609,7 @@ def replacerev(ui, repo, ctx, filedata, data=filedata.get(path, fctx.data()), islink=fctx.islink(), isexec=fctx.isexec(), - copied=copied) + copysource=copysource) extra = ctx.extra().copy() extra['fix_source'] = ctx.hex() diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -645,7 +645,7 @@ def collapse(repo, firstctx, lastctx, co fctx.path(), fctx.data(), islink='l' in flags, isexec='x' in flags, - copied=copied.get(path)) + copysource=copied.get(path)) return mctx return None diff --git a/hgext/uncommit.py b/hgext/uncommit.py --- a/hgext/uncommit.py +++ b/hgext/uncommit.py @@ -83,7 +83,7 @@ def _commitfiltered(repo, ctx, match, ke mctx = context.memfilectx(repo, memctx, fctx.path(), fctx.data(), fctx.islink(), fctx.isexec(), - copied=copied.get(path)) + copysource=copied.get(path)) return mctx if not files: diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -2563,7 +2563,7 @@ def amend(ui, repo, old, extra, pats, op fctx.path(), fctx.data(), islink='l' in flags, isexec='x' in flags, - copied=copied.get(path)) + copysource=copied.get(path)) return mctx except KeyError: return None diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -2233,10 +2233,10 @@ def memfilefromctx(ctx): """ def getfilectx(repo, memctx, path): fctx = ctx[path] - copied = fctx.copysource() + copysource = fctx.copysource() return memfilectx(repo, memctx, path, fctx.data(), islink=fctx.islink(), isexec=fctx.isexec(), - copied=copied) + copysource=copysource) return getfilectx @@ -2246,12 +2246,12 @@ def memfilefrompatch(patchstore): This is a convenience method for building a memctx based on a patchstore. """ def getfilectx(repo, memctx, path): - data, mode, copied = patchstore.getfile(path) + data, mode, copysource = patchstore.getfile(path) if data is None: return None islink, isexec = mode return memfilectx(repo, memctx, path, data, islink=islink, - isexec=isexec, copied=copied) + isexec=isexec, copysource=copysource) return getfilectx @@ -2377,7 +2377,7 @@ class memfilectx(committablefilectx): See memctx and committablefilectx for more details. """ def __init__(self, repo, changectx, path, data, islink=False, - isexec=False, copied=None): + isexec=False, copysource=None): """ path is the normalized file path relative to repository root. data is the file content as a string. @@ -2394,8 +2394,8 @@ class memfilectx(committablefilectx): else: self._flags = '' self._copied = None - if copied: - self._copied = (copied, nullid) + if copysource: + self._copied = (copysource, nullid) def cmp(self, fctx): return self.data() != fctx.data()