[PATCH 3 of 8 v2] largefiles: extract 'orig' method in lfilesmanifestdict.__contains__

Martin von Zweigbergk martinvonz at gmail.com
Tue Sep 23 16:46:08 CDT 2014


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at gmail.com>
# Date 1410904238 25200
#      Tue Sep 16 14:50:38 2014 -0700
# Node ID 998451943c857aaabc31f6d1938a9f839d1b7fd1
# Parent  ac6f39112e0683cb6660cff0af26e8bc3b62bbbf
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()


More information about the Mercurial-devel mailing list