diff -r 30657909b2ba -r f3c6540f2cd1 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