changeset 47422:88439c6fbafc

transaction: simplify `undo.backupfiles` file creation with a variable This make the code shorter and clearer. (This is an opportunity improvement while looking at something next to that.) Differential Revision: https://phab.mercurial-scm.org/D10846
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 09 Jun 2021 00:59:44 +0200
parents d2e0226b511a
children be903d043099
files mercurial/transaction.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/transaction.py	Wed Jun 09 00:59:04 2021 +0200
+++ b/mercurial/transaction.py	Wed Jun 09 00:59:44 2021 +0200
@@ -633,9 +633,9 @@
         """write transaction data for possible future undo call"""
         if self._undoname is None:
             return
-        undobackupfile = self._opener.open(
-            b"%s.backupfiles" % self._undoname, b'w'
-        )
+
+        undo_backup_path = b"%s.backupfiles" % self._undoname
+        undobackupfile = self._opener.open(undo_backup_path, b'w')
         undobackupfile.write(b'%d\n' % version)
         for l, f, b, c in self._backupentries:
             if not f:  # temporary file