comparison mercurial/context.py @ 41776:322ce0bca19d

memfilefromctx: migrate to new method for getting copy info Differential Revision: https://phab.mercurial-scm.org/D6016
author Martin von Zweigbergk <martinvonz@google.com>
date Sun, 25 Mar 2018 22:07:35 -0700
parents c7a843aa4b42
children 2ba96fca8528
comparison
equal deleted inserted replaced
41775:a86e22007b54 41776:322ce0bca19d
2232 This is a convenience method for building a memctx based on another 2232 This is a convenience method for building a memctx based on another
2233 context. 2233 context.
2234 """ 2234 """
2235 def getfilectx(repo, memctx, path): 2235 def getfilectx(repo, memctx, path):
2236 fctx = ctx[path] 2236 fctx = ctx[path]
2237 copied = fctx.renamed() 2237 copied = fctx.copysource()
2238 if copied:
2239 copied = copied[0]
2240 return memfilectx(repo, memctx, path, fctx.data(), 2238 return memfilectx(repo, memctx, path, fctx.data(),
2241 islink=fctx.islink(), isexec=fctx.isexec(), 2239 islink=fctx.islink(), isexec=fctx.isexec(),
2242 copied=copied) 2240 copied=copied)
2243 2241
2244 return getfilectx 2242 return getfilectx