From patchwork Wed Sep 17 20:40:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [4, of, 9] largefiles: extract 'orig' method in lfilesmanifestdict.__contains__ From: Martin von Zweigbergk X-Patchwork-Id: 5857 Message-Id: <9f0ed89346feff556e3a.1410986421@handduk2.mtv.corp.google.com> To: mercurial-devel@selenic.com Date: Wed, 17 Sep 2014 13:40:21 -0700 # HG changeset patch # User Martin von Zweigbergk # Date 1410904238 25200 # Tue Sep 16 14:50:38 2014 -0700 # Node ID 9f0ed89346feff556e3a54a5d165328491a6c531 # Parent 99b90c3d8a2d8ef506aa3c3878f0de217315d0d8 largefiles: extract 'orig' method in lfilesmanifestdict.__contains__ diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py --- a/hgext/largefiles/reposetup.py +++ b/hgext/largefiles/reposetup.py @@ -37,11 +37,8 @@ if self.lfstatus: class lfilesmanifestdict(manifest.manifestdict): def __contains__(self, filename): - if super(lfilesmanifestdict, - self).__contains__(filename): - return True - return super(lfilesmanifestdict, - self).__contains__(lfutil.standin(filename)) + orig = super(lfilesmanifestdict, self).__contains__ + return orig(filename) or orig(lfutil.standin(filename)) class lfilesctx(ctx.__class__): def files(self): filenames = super(lfilesctx, self).files()