copies: avoid reference to c1/c2 in makectx
authorMatt Mackall <mpm@selenic.com>
Fri, 21 Aug 2015 15:12:58 -0500
changeset 26655 f3c6540f2cd1
parent 26654 30657909b2ba
child 26656 3e3d783b0d59
copies: avoid reference to c1/c2 in makectx
mercurial/copies.py
--- a/mercurial/copies.py	Mon Oct 12 03:37:09 2015 -0500
+++ b/mercurial/copies.py	Fri Aug 21 15:12:58 2015 -0500
@@ -300,6 +300,7 @@
         """
         rev = ctx.rev()
         ac = getattr(ctx, '_ancestrycontext', None)
+        repo = ctx._repo
         if ac is None:
             revs = [rev]
             if rev is None:
@@ -308,9 +309,9 @@
             ctx._ancestrycontext = ac
         def makectx(f, n):
             if len(n) != 20:  # in a working context?
-                if c1.rev() is None:
-                    return c1.filectx(f)
-                return c2.filectx(f)
+                if ctx.rev() is None:
+                    return ctx.filectx(f)
+                return repo[None][f]
             fctx = repo.filectx(f, fileid=n)
             # setup only needed for filectx not create from a changectx
             fctx._ancestrycontext = ac