transaction: rename find to findoffset and drop backup file support
authorJoerg Sonnenberger <joerg@bec.de>
Sat, 07 Nov 2020 19:24:12 +0100
changeset 45870 a6f08085edfe
parent 45869 63edc384d3b7
child 45871 a985c4fb23ca
transaction: rename find to findoffset and drop backup file support transaction.find used to support access to both the regular file and backup file list. They have different formats, so any consumer has to be aware of the difference alredy. There is no in-core consumer for the backup file access, so don't provide it. Differential Revision: https://phab.mercurial-scm.org/D9276
mercurial/revlog.py
mercurial/transaction.py
--- a/mercurial/revlog.py	Sat Nov 07 17:56:01 2020 +0100
+++ b/mercurial/revlog.py	Sat Nov 07 19:24:12 2020 +0100
@@ -2000,12 +2000,11 @@
         ):
             return
 
-        trinfo = tr.find(self.indexfile)
-        if trinfo is None:
+        troffset = tr.findoffset(self.indexfile)
+        if troffset is None:
             raise error.RevlogError(
                 _(b"%s not found in the transaction") % self.indexfile
             )
-        troffset = trinfo[1]
         trindex = 0
         tr.add(self.datafile, 0)
 
--- a/mercurial/transaction.py	Sat Nov 07 17:56:01 2020 +0100
+++ b/mercurial/transaction.py	Sat Nov 07 19:24:12 2020 +0100
@@ -395,11 +395,9 @@
         return any
 
     @active
-    def find(self, file):
+    def findoffset(self, file):
         if file in self._map:
-            return self._entries[self._map[file]]
-        if file in self._backupmap:
-            return self._backupentries[self._backupmap[file]]
+            return self._entries[self._map[file]][1]
         return None
 
     @active