changeset 31863:cd7aaf344d83

bundle2: move the 'close' method off the unpackermixin This method is unrelated to unpacking and only used by the unbundle20 class. We move it there for clarity.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sun, 09 Apr 2017 19:08:24 +0200
parents 9bd9e9cb3f69
children 70d163b86316
files mercurial/bundle2.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Sun Apr 09 18:12:54 2017 +0200
+++ b/mercurial/bundle2.py	Sun Apr 09 19:08:24 2017 +0200
@@ -660,11 +660,6 @@
                     raise
         return None
 
-    def close(self):
-        """close underlying file"""
-        if util.safehasattr(self._fp, 'close'):
-            return self._fp.close()
-
 def getunbundler(ui, fp, magicstring=None):
     """return a valid unbundler object for a given magicstring"""
     if magicstring is None:
@@ -817,6 +812,11 @@
         self.params # load params
         return self._compressed
 
+    def close(self):
+        """close underlying file"""
+        if util.safehasattr(self._fp, 'close'):
+            return self._fp.close()
+
 formatmap = {'20': unbundle20}
 
 b2streamparamsmap = {}