comparison mercurial/transaction.py @ 25294:b1b89a0a606d stable

transaction: really fix _addbackupentry key usage (issue4684) The fix in fd905b2bea59 is actually wrong. We now use the filename to match what '_addentry'. This whole untested code is quite suspicious. This seems to point that no one is ever running 'tr.find' for a backup file.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 26 May 2015 13:02:28 -0700
parents fd905b2bea59
children bcb17d7dbec2
comparison
equal deleted inserted replaced
25279:708b19c18adf 25294:b1b89a0a606d
220 self._addbackupentry((location, file, backupfile, False)) 220 self._addbackupentry((location, file, backupfile, False))
221 221
222 def _addbackupentry(self, entry): 222 def _addbackupentry(self, entry):
223 """register a new backup entry and write it to disk""" 223 """register a new backup entry and write it to disk"""
224 self._backupentries.append(entry) 224 self._backupentries.append(entry)
225 self._backupmap[entry] = len(self._backupentries) - 1 225 self._backupmap[entry[1]] = len(self._backupentries) - 1
226 self._backupsfile.write("%s\0%s\0%s\0%d\n" % entry) 226 self._backupsfile.write("%s\0%s\0%s\0%d\n" % entry)
227 self._backupsfile.flush() 227 self._backupsfile.flush()
228 228
229 @active 229 @active
230 def registertmp(self, tmpfile, location=''): 230 def registertmp(self, tmpfile, location=''):