Patchwork D10924: dirstate: split a not-so-one-liner

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

Comments

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

REVISION SUMMARY
  This is simpler to read.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -433,9 +433,9 @@ 
         if state == b'a' or oldstate == b'r':
             scmutil.checkfilename(f)
             if self._map.hastrackeddir(f):
-                raise error.Abort(
-                    _(b'directory %r already in dirstate') % pycompat.bytestr(f)
-                )
+                msg = _(b'directory %r already in dirstate')
+                msg %= pycompat.bytestr(f)
+                raise error.Abort(msg)
             # shadows
             for d in pathutil.finddirs(f):
                 if self._map.hastrackeddir(d):