Patchwork D11128: dirstate: replace a dead conditional branch with an assert in `update_file`

login
register
mail settings
Submitter phabricator
Date July 19, 2021, 10:40 a.m.
Message ID <differential-rev-PHID-DREV-mg2qug2zd75dxlsmik3b-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49443/
State Superseded
Headers show

Comments

phabricator - July 19, 2021, 10:40 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is a case we never meet, so lets trim it away to simplify the code before
  more changes.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -567,8 +567,7 @@ 
             self._drop(filename)
         elif merged:
             assert wc_tracked
-            if not self.in_merge:
-                self.normallookup(filename)
+            assert self.in_merge  # we are never in the "normallookup" case
             self.otherparent(filename)
         elif not (p1_tracked or p2_tracked) and wc_tracked:
             self._addpath(filename, added=True, possibly_dirty=possibly_dirty)