From c1bb70eed7c30f94150461a7abb816b21e307572 Mon Sep 17 00:00:00 2001 From: Pierre-Yves David Date: Sun, 9 Apr 2017 19:08:24 +0200 Subject: [PATCH] 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. --- mercurial/bundle2.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py index 81a40b2aba..522833f568 100644 --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -660,11 +660,6 @@ class unpackermixin(object): 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 @@ class unbundle20(unpackermixin): 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 = {}