diff mercurial/context.py @ 50022:c166b212bdee

dirstate: pass the repo to the `changeparent` method If we want the context to be responsible for writing (and we want it), we need to have access to a localrepository object. So we now requires a localrepository object as an argument to this context manager.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 25 Jan 2023 18:46:20 +0100
parents 2e726c934fcd
children 7a8bfc05b691
line wrap: on
line diff
--- a/mercurial/context.py	Tue Dec 13 10:00:04 2022 +0100
+++ b/mercurial/context.py	Wed Jan 25 18:46:20 2023 +0100
@@ -1595,7 +1595,7 @@
         if p2node is None:
             p2node = self._repo.nodeconstants.nullid
         dirstate = self._repo.dirstate
-        with dirstate.parentchange():
+        with dirstate.parentchange(self._repo):
             copies = dirstate.setparents(p1node, p2node)
             pctx = self._repo[p1node]
             if copies:
@@ -2050,7 +2050,7 @@
         return sorted(f for f in ds.matches(match) if ds.get_entry(f).tracked)
 
     def markcommitted(self, node):
-        with self._repo.dirstate.parentchange():
+        with self._repo.dirstate.parentchange(self._repo):
             for f in self.modified() + self.added():
                 self._repo.dirstate.update_file(
                     f, p1_tracked=True, wc_tracked=True