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

login
register
mail settings
Submitter Pierre-Yves David
Date May 22, 2015, 7:17 p.m.
Message ID <abf77a0441d90fd019a5.1432322223@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/9241/
State Accepted
Headers show

Comments

Pierre-Yves David - May 22, 2015, 7:17 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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...
Matt Mackall - May 22, 2015, 10:24 p.m.
On Fri, 2015-05-22 at 14:17 -0500, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@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)

Queued for stable, thanks.

Patch

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=''):