Patchwork D11582: dirstatemap: drop legacy method on the dirstatemap wrapper

login
register
mail settings
Submitter phabricator
Date Oct. 2, 2021, 3:06 p.m.
Message ID <differential-rev-PHID-DREV-mjak2fdht7cn4ceientu-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49906/
State Superseded
Headers show

Comments

phabricator - Oct. 2, 2021, 3:06 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  They are no longer in use now that the Rust wrapper version of the Dirstatemap
  are back in line with the Python one.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11582

AFFECTED FILES
  mercurial/dirstatemap.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/dirstatemap.py b/mercurial/dirstatemap.py
--- a/mercurial/dirstatemap.py
+++ b/mercurial/dirstatemap.py
@@ -803,42 +803,3 @@ 
         def __setitem__(self, key, value):
             assert isinstance(value, DirstateItem)
             self._map.set_dirstate_item(key, value)
-
-        ### Legacy method we need to get rid of
-
-        def addfile(
-            self,
-            f,
-            mode=0,
-            size=None,
-            mtime=None,
-            added=False,
-            merged=False,
-            from_p2=False,
-            possibly_dirty=False,
-        ):
-            if added:
-                assert not possibly_dirty
-                assert not from_p2
-                item = DirstateItem.new_added()
-            elif merged:
-                assert not possibly_dirty
-                assert not from_p2
-                item = DirstateItem.new_merged()
-            elif from_p2:
-                assert not possibly_dirty
-                item = DirstateItem.new_from_p2()
-            elif possibly_dirty:
-                item = DirstateItem.new_possibly_dirty()
-            else:
-                assert size is not None
-                assert mtime is not None
-                size = size & rangemask
-                mtime = mtime & rangemask
-                item = DirstateItem.new_normal(mode, size, mtime)
-            self._map.addfile(f, item)
-            if added:
-                self.copymap.pop(f, None)
-
-        def removefile(self, *args, **kwargs):
-            return self._map.removefile(*args, **kwargs)