changeset 47705:6975cef3add1

context: use new API instead of `normal` during fixup post status We use `set_clean` or `update_file` depending of if we are in the middle of an update or not. Differential Revision: https://phab.mercurial-scm.org/D11147
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 19 Jul 2021 01:44:24 +0200
parents 8a50fb0784a9
children 5bbf304271a0
files mercurial/context.py
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Mon Jul 19 00:47:59 2021 +0200
+++ b/mercurial/context.py	Mon Jul 19 01:44:24 2021 +0200
@@ -1838,9 +1838,15 @@
                 # wlock can invalidate the dirstate, so cache normal _after_
                 # taking the lock
                 with self._repo.wlock(False):
-                    if self._repo.dirstate.identity() == oldid:
+                    dirstate = self._repo.dirstate
+                    if dirstate.identity() == oldid:
                         if fixup:
-                            normal = self._repo.dirstate.normal
+                            if dirstate.pendingparentchange():
+                                normal = lambda f: dirstate.update_file(
+                                    f, p1_tracked=True, wc_tracked=True
+                                )
+                            else:
+                                normal = dirstate.set_clean
                             for f in fixup:
                                 normal(f)
                             # write changes out explicitly, because nesting