Patchwork [8,of,9,v2] auditvfs: forward options property from nested vfs

login
register
mail settings
Submitter Augie Fackler
Date Aug. 5, 2016, 5:23 p.m.
Message ID <bf05e3655cb4239fa34e.1470417826@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/16127/
State Superseded
Headers show

Comments

Augie Fackler - Aug. 5, 2016, 5:23 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1470410362 14400
#      Fri Aug 05 11:19:22 2016 -0400
# Node ID bf05e3655cb4239fa34e0b7e263aa33a7a2143bd
# Parent  cb4b54c546d76d5ac0ccfe32ac02265d9ae8d336
auditvfs: forward options property from nested vfs

This was breaking my ability to use treemanifests in bundlerepos, and
was deeply mysterious. We should probably just make the options
property a formal part of the vfs API, and make it a required
construction parameter. Sadly, I don't have time to dive into that
refactor right now.
via Mercurial-devel - Aug. 5, 2016, 9:14 p.m.
I don't understand this, but I know way too little to say it's wrong,
so unless someone objects, I'll queue this blindly (with v3 of this
series).

On Fri, Aug 5, 2016 at 10:23 AM, Augie Fackler <raf@durin42.com> wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1470410362 14400
> #      Fri Aug 05 11:19:22 2016 -0400
> # Node ID bf05e3655cb4239fa34e0b7e263aa33a7a2143bd
> # Parent  cb4b54c546d76d5ac0ccfe32ac02265d9ae8d336
> auditvfs: forward options property from nested vfs
>
> This was breaking my ability to use treemanifests in bundlerepos, and
> was deeply mysterious. We should probably just make the options
> property a formal part of the vfs API, and make it a required
> construction parameter. Sadly, I don't have time to dive into that
> refactor right now.
>
> diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
> --- a/mercurial/scmutil.py
> +++ b/mercurial/scmutil.py
> @@ -638,6 +638,14 @@ class auditvfs(object):
>      def mustaudit(self, onoff):
>          self.vfs.mustaudit = onoff
>
> +    @property
> +    def options(self):
> +        return self.vfs.options
> +
> +    @options.setter
> +    def options(self, value):
> +        self.vfs.options = value
> +
>  class filtervfs(abstractvfs, auditvfs):
>      '''Wrapper vfs for filtering filenames with a function.'''
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -638,6 +638,14 @@  class auditvfs(object):
     def mustaudit(self, onoff):
         self.vfs.mustaudit = onoff
 
+    @property
+    def options(self):
+        return self.vfs.options
+
+    @options.setter
+    def options(self, value):
+        self.vfs.options = value
+
 class filtervfs(abstractvfs, auditvfs):
     '''Wrapper vfs for filtering filenames with a function.'''