changeset 47481:612f5f36fcf6

dirstate: split a not-so-one-liner This is shorter and simpler to read. Differential Revision: https://phab.mercurial-scm.org/D10925
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 01 Jul 2021 18:59:29 +0200
parents f93298a48da1
children cb29484eaade
files mercurial/dirstate.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Thu Jul 01 18:57:35 2021 +0200
+++ b/mercurial/dirstate.py	Thu Jul 01 18:59:29 2021 +0200
@@ -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)