From patchwork Tue Sep 23 21:46:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [4,of,8,v2] largefiles: extract 'orig' method in lfilesctx.filectx From: Martin von Zweigbergk X-Patchwork-Id: 5926 Message-Id: <58593ed2f24b47c7fb51.1411508769@handduk2.mtv.corp.google.com> To: mercurial-devel@selenic.com Date: Tue, 23 Sep 2014 14:46:09 -0700 # HG changeset patch # User Martin von Zweigbergk # Date 1410904285 25200 # Tue Sep 16 14:51:25 2014 -0700 # Node ID 58593ed2f24b47c7fb51be71cc854367f0a79aa8 # Parent 998451943c857aaabc31f6d1938a9f839d1b7fd1 largefiles: extract 'orig' method in lfilesctx.filectx diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py --- a/hgext/largefiles/reposetup.py +++ b/hgext/largefiles/reposetup.py @@ -48,22 +48,20 @@ man1.__class__ = lfilesmanifestdict return man1 def filectx(self, path, fileid=None, filelog=None): + orig = super(lfilesctx, self).filectx try: if filelog is not None: - result = super(lfilesctx, self).filectx( - path, fileid, filelog) + result = orig(path, fileid, filelog) else: - result = super(lfilesctx, self).filectx( - path, fileid) + result = orig(path, fileid) except error.LookupError: # Adding a null character will cause Mercurial to # identify this as a binary file. if filelog is not None: - result = super(lfilesctx, self).filectx( - lfutil.standin(path), fileid, filelog) + result = orig(lfutil.standin(path), fileid, + filelog) else: - result = super(lfilesctx, self).filectx( - lfutil.standin(path), fileid) + result = orig(lfutil.standin(path), fileid) olddata = result.data result.data = lambda: olddata() + '\0' return result