Patchwork D10977: dirstate: drop the last explicit `state` usage in the module

login
register
mail settings
Submitter phabricator
Date July 4, 2021, 9:55 p.m.
Message ID <differential-rev-PHID-DREV-6wqtm3pphcwfhz5ylhiw-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49292/
State Superseded
Headers show

Comments

phabricator - July 4, 2021, 9:55 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The internal detail of the `state` bytes is not longer exposed to the dirstate
  layer.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -536,7 +536,8 @@ 
         if not self.in_merge:
             msg = _(b"setting %r to other parent only allowed in merges") % f
             raise error.Abort(msg)
-        if f in self and self[f] == b'n':
+        entry = self._map.get(f)
+        if entry is not None and entry.tracked:
             # merge-like
             self._addpath(f, merged=True)
         else: