Patchwork D11437: dirstate: drop dirstatemap.addfile

login
register
mail settings
Submitter phabricator
Date Sept. 16, 2021, 2:45 p.m.
Message ID <differential-rev-PHID-DREV-jyvcsfue5rr6df5qxstr-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49753/
State Superseded
Headers show

Comments

phabricator - Sept. 16, 2021, 2:45 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  All users have been migrated.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -177,51 +177,6 @@ 
         self.copymap.pop(filename, None)
         self.nonnormalset.discard(filename)
 
-    def addfile(
-        self,
-        f,
-        mode=0,
-        size=None,
-        mtime=None,
-        added=False,
-        merged=False,
-        from_p2=False,
-        possibly_dirty=False,
-    ):
-        """Add a tracked file to the dirstate."""
-        if added:
-            assert not merged
-            assert not possibly_dirty
-            assert not from_p2
-            new_entry = DirstateItem.new_added()
-            self.copymap.pop(f, None)
-        elif merged:
-            assert not possibly_dirty
-            assert not from_p2
-            new_entry = DirstateItem.new_merged()
-        elif from_p2:
-            assert not possibly_dirty
-            new_entry = DirstateItem.new_from_p2()
-        elif possibly_dirty:
-            new_entry = DirstateItem.new_possibly_dirty()
-        else:
-            assert size is not None
-            assert mtime is not None
-            size = size & rangemask
-            mtime = mtime & rangemask
-            new_entry = DirstateItem.new_normal(mode, size, mtime)
-        old_entry = self.get(f)
-        self._dirs_incr(f, old_entry)
-        self._map[f] = new_entry
-        if new_entry.dm_nonnormal:
-            self.nonnormalset.add(f)
-        else:
-            self.nonnormalset.discard(f)
-        if new_entry.dm_otherparent:
-            self.otherparentset.add(f)
-        else:
-            self.otherparentset.discard(f)
-
     def reset_state(
         self,
         filename,