[PATCH 1 of 5] localrepo: add some comment about role of various vfs object

Yuya Nishihara yuya at tcha.org
Fri Mar 3 08:49:16 EST 2017


On Thu, 2 Mar 2017 08:20:17 -0800, Ryan McElroy wrote:
> I'm a big +1 on adding documentation -- thanks for doing this!
> 
> 
> On 3/1/17 6:58 PM, Pierre-Yves David wrote:
> > # HG changeset patch
> > # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
> > # Date 1470397745 -7200
> > #      Fri Aug 05 13:49:05 2016 +0200
> > # Node ID b34202587b00d949dd77ff97399e50d6340779a6
> > # Parent  3f8f53190d6afed0aca6c6527236edad28ce785c
> > # EXP-Topic vfs.cleanup
> > localrepo: add some comment about role of various vfs object
> >
> > This should make things clearer for most people.
> >
> > diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> > --- a/mercurial/localrepo.py
> > +++ b/mercurial/localrepo.py
> > @@ -253,7 +253,12 @@ class localrepository(object):
> >   
> >       def __init__(self, baseui, path, create=False):
> >           self.requirements = set()
> > +        # vfs to access the working copy
> >           self.wvfs = scmutil.vfs(path, expandpath=True, realpath=True)
> > +        # vfs to access the content of the repository
> 
> This comment doesn't help me a lot -- it requires that I understand that 
> the "repository" means "things under the .hg directory", which is 
> non-obvious to newcomers to the code. I think it would be more clear to say:
> 
> # vfs to access repo files in .hg directory (excluding .hg/store)
> 
> > +        self.vfs = None
> > +        # vfs to access the store part of the repository
> 
> Consider, perhaps:
> 
> # vfs to access repo history under .hg/store

I slightly prefer the new one, but I hesitated to update them in flight.
Can you send a follow up?


More information about the Mercurial-devel mailing list