[PATCH STABLE] transaction: use the proper variable in '_addbackupentry' (issue4684)

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri May 22 14:17:03 CDT 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1432314798 18000
#      Fri May 22 12:13:18 2015 -0500
# Branch stable
# Node ID abf77a0441d90fd019a57c837f804d65957ad008
# Parent  2664f536a97e9893f44539b71ada43b87ca79e6d
transaction: use the proper variable in '_addbackupentry' (issue4684)

The 'file' variable was undefined but resolved to the 'file' built-in.
This is why pylint complains about overwriting built-ins...

diff --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -220,11 +220,11 @@ class transaction(object):
         self._addbackupentry((location, file, backupfile, False))
 
     def _addbackupentry(self, entry):
         """register a new backup entry and write it to disk"""
         self._backupentries.append(entry)
-        self._backupmap[file] = len(self._backupentries) - 1
+        self._backupmap[entry] = len(self._backupentries) - 1
         self._backupsfile.write("%s\0%s\0%s\0%d\n" % entry)
         self._backupsfile.flush()
 
     @active
     def registertmp(self, tmpfile, location=''):


More information about the Mercurial-devel mailing list