changeset 47893:0b35bc0b8636

dirstatemap: temporarily use `from_v1_data` in `addfile` We are about to change the `__init__` for `DirstateItem`. To make the transition easier, we move existing caller to `DirstateItem.from_v1_data`. Differential Revision: https://phab.mercurial-scm.org/D11318
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 16 Jul 2021 16:30:52 +0200
parents 32aa80a8d162
children 226c7dbeea11
files mercurial/dirstatemap.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstatemap.py	Fri Aug 20 18:11:49 2021 +0200
+++ b/mercurial/dirstatemap.py	Fri Jul 16 16:30:52 2021 +0200
@@ -220,7 +220,7 @@
         assert mtime is not None
         old_entry = self.get(f)
         self._dirs_incr(f, old_entry)
-        e = self._map[f] = DirstateItem(state, mode, size, mtime)
+        e = self._map[f] = DirstateItem.from_v1_data(state, mode, size, mtime)
         if e.dm_nonnormal:
             self.nonnormalset.add(f)
         if e.dm_otherparent:
@@ -273,7 +273,7 @@
             # XXX might be merged and removed ?
             old_entry = self._map.get(filename)
             self._dirs_decr(filename, old_entry=old_entry, remove_variant=True)
-            self._map[filename] = DirstateItem(b'r', 0, 0, 0)
+            self._map[filename] = DirstateItem.from_v1_data(b'r', 0, 0, 0)
             self.nonnormalset.add(filename)
         elif clean_p2 and wc_tracked:
             if p1_tracked or self.get(filename) is not None: