[PATCH] localrepo: improve vfs documentation

Jun Wu quark at fb.com
Mon Mar 20 22:51:16 EDT 2017


Excerpts from Ryan McElroy's message of 2017-03-21 02:38:32 +0000:
> 
> On 3/21/17 2:11 AM, Jun Wu wrote:
> > Excerpts from Ryan McElroy's message of 2017-03-20 19:07:18 -0700:
> >> # HG changeset patch
> >> # User Ryan McElroy <rmcelroy at fb.com>
> >> # Date 1490060600 25200
> >> #      Mon Mar 20 18:43:20 2017 -0700
> >> # Node ID 8fbdaf1533bb20cb471679be6ab2dc799fd7e634
> >> # Parent  2dc8b65b19a9d4bd14e8e935a27e29c91be1f6ec
> >> localrepo: improve vfs documentation
> >>
> >> At the beginning of March, I promised Yuya that I would follow up a comment I
> >> made on a patch with improved documention for these vfs objects. Also hat tip
> >> to Pierre-Yves for adding the documentation here in the first place.
> >>
> >> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> >> --- a/mercurial/localrepo.py
> >> +++ b/mercurial/localrepo.py
> >> @@ -259,11 +259,11 @@ class localrepository(object):
> >>   
> >>       def __init__(self, baseui, path, create=False):
> >>           self.requirements = set()
> >> -        # vfs to access the working copy
> >> +        # vfs rooted at the repository root used to access the working copy
> >>           self.wvfs = vfsmod.vfs(path, expandpath=True, realpath=True)
> >> -        # vfs to access the content of the repository
> >> +        # vfs rooted at .hg used to access repo files outside of .hg/store
> >>           self.vfs = None
> >> -        # vfs to access the store part of the repository
> >> +        # vfs rooted at .hg/store used to access repository history
> > If share is enabled, it may be something else.
> 
> Good point, though even with share enabled, it will point to .hg/store, 
> but perhaps inside of another repository. The idea behind this patch is 
> to optimize the language, though, so bike-shedding is encouraged!

TIL sharedpath has to end with "/.hg".

> How about:
> 
> # vfs usually rooted at .hg/store, used to access repository history
> 
> I could also add something like this:
> 
> # If this is a shared repository, this vfs may point to another
> # repository's .hg/store directory.

Sounds good.

> 
> >
> >>           self.svfs = None
> >>           self.root = self.wvfs.base
> >>           self.path = self.wvfs.join(".hg")


More information about the Mercurial-devel mailing list