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

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Mon Jul 19 10:40:20 UTC 2021


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

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)



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


More information about the Mercurial-devel mailing list