Patchwork D10925: 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-6ol5ruhv25fewwxrexvl-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49239/
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 shorter and simpler to read.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -442,10 +442,9 @@ 
                     break
                 entry = self._map.get(d)
                 if entry is not None and entry[0] != b'r':
-                    raise error.Abort(
-                        _(b'file %r in dirstate clashes with %r')
-                        % (pycompat.bytestr(d), pycompat.bytestr(f))
-                    )
+                    msg = _(b'file %r in dirstate clashes with %r')
+                    msg %= (pycompat.bytestr(d), pycompat.bytestr(f))
+                    raise error.Abort(msg)
         self._dirty = True
         self._updatedfiles.add(f)
         self._map.addfile(f, oldstate, state, mode, size, mtime)