Patchwork D1384: bundlerepo: rename "bundlefilespos" variable and attribute

login
register
mail settings
Submitter phabricator
Date Nov. 17, 2017, 10:22 p.m.
Message ID <c79f8dca2ee458542ac2559d3d4be36b@localhost.localdomain>
Download mbox | patch
Permalink /patch/25623/
State Not Applicable
Headers show

Comments

phabricator - Nov. 17, 2017, 10:22 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG5ae62363ae55: bundlerepo: rename &quot;bundlefilespos&quot; variable and attribute (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1384?vs=3462&id=3611

REVISION DETAIL
  https://phab.mercurial-scm.org/D1384

AFFECTED FILES
  mercurial/bundlerepo.py

CHANGE DETAILS




To: indygreg, #hg-reviewers, dlax, durin42
Cc: mercurial-devel

Patch

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -247,14 +247,14 @@ 
         self.invalidate()
         self.dirty = True
 
-    bundlefilespos = {}
 def _getfilestarts(cgunpacker):
+    filespos = {}
     for chunkdata in iter(cgunpacker.filelogheader, {}):
         fname = chunkdata['filename']
-        bundlefilespos[fname] = bundle.tell()
+        filespos[fname] = cgunpacker.tell()
         for chunk in iter(lambda: cgunpacker.deltachunk(None), {}):
             pass
-    return bundlefilespos
+    return filespos
 
 class bundlerepository(localrepo.localrepository):
     """A repository instance that is a union of a local repo and a bundle.
@@ -312,8 +312,8 @@ 
             raise error.Abort(_('bundle type %s cannot be read') %
                               type(bundle))
 
-        # dict with the mapping 'filename' -> position in the bundle
-        self.bundlefilespos = {}
+        # dict with the mapping 'filename' -> position in the changegroup.
+        self._cgfilespos = {}
 
         self.firstnewrev = self.changelog.repotiprev + 1
         phases.retractboundary(self, None, phases.draft,
@@ -403,12 +403,12 @@ 
         return self._url
 
     def file(self, f):
-        if not self.bundlefilespos:
+        if not self._cgfilespos:
             self._cgunpacker.seek(self.filestart)
-            self.bundlefilespos = _getfilestarts(self._cgunpacker)
+            self._cgfilespos = _getfilestarts(self._cgunpacker)
 
-        if f in self.bundlefilespos:
-            self._cgunpacker.seek(self.bundlefilespos[f])
+        if f in self._cgfilespos:
+            self._cgunpacker.seek(self._cgfilespos[f])
             linkmapper = self.unfiltered().changelog.rev
             return bundlefilelog(self.svfs, f, self._cgunpacker, linkmapper)
         else: