changeset 41994:550a172a603b

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
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 19 Mar 2019 22:58:39 -0700
parents cde5827d09a7
children 6fef387af1da
files hgext/fix.py hgext/histedit.py hgext/uncommit.py mercurial/cmdutil.py mercurial/context.py
diffstat 5 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/fix.py	Wed Mar 13 20:09:56 2019 -0700
+++ b/hgext/fix.py	Tue Mar 19 22:58:39 2019 -0700
@@ -601,7 +601,7 @@
         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 @@
             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()
--- a/hgext/histedit.py	Wed Mar 13 20:09:56 2019 -0700
+++ b/hgext/histedit.py	Tue Mar 19 22:58:39 2019 -0700
@@ -645,7 +645,7 @@
                                       fctx.path(), fctx.data(),
                                       islink='l' in flags,
                                       isexec='x' in flags,
-                                      copied=copied.get(path))
+                                      copysource=copied.get(path))
             return mctx
         return None
 
--- a/hgext/uncommit.py	Wed Mar 13 20:09:56 2019 -0700
+++ b/hgext/uncommit.py	Tue Mar 19 22:58:39 2019 -0700
@@ -83,7 +83,7 @@
         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:
--- a/mercurial/cmdutil.py	Wed Mar 13 20:09:56 2019 -0700
+++ b/mercurial/cmdutil.py	Tue Mar 19 22:58:39 2019 -0700
@@ -2563,7 +2563,7 @@
                                               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
--- a/mercurial/context.py	Wed Mar 13 20:09:56 2019 -0700
+++ b/mercurial/context.py	Tue Mar 19 22:58:39 2019 -0700
@@ -2233,10 +2233,10 @@
     """
     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 @@
     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 @@
     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 @@
         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()