changeset 44089:bd22e90c54b3

graft: extract repo[None] to a variable I plan to allow the caller pass in an overlayworkingctx, so this prepares for that. Differential Revision: https://phab.mercurial-scm.org/D7857
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 27 Dec 2019 13:03:40 -0800
parents b3ec1ea95ee6
children 2f0a44c69e07
files mercurial/merge.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Thu Jan 16 00:30:08 2020 +0800
+++ b/mercurial/merge.py	Fri Dec 27 13:03:40 2019 -0800
@@ -2605,7 +2605,8 @@
     # to copy commits), and 2) informs update that the incoming changes are
     # newer than the destination so it doesn't prompt about "remote changed foo
     # which local deleted".
-    pctx = repo[b'.']
+    wctx = repo[None]
+    pctx = wctx.p1()
     mergeancestor = repo.changelog.isancestor(pctx.node(), ctx.node())
 
     stats = update(
@@ -2634,7 +2635,7 @@
         repo.setparents(pctx.node(), pother)
         repo.dirstate.write(repo.currenttransaction())
         # fix up dirstate for copies and renames
-        copies.duplicatecopies(repo, repo[None], ctx.rev(), base.rev())
+        copies.duplicatecopies(repo, wctx, ctx.rev(), base.rev())
     return stats