Patchwork [v2] localrepo: improve vfs documentation

login
register
mail settings
Submitter Ryan McElroy
Date March 21, 2017, 1:51 p.m.
Message ID <99b12351af995446ad4f.1490104312@devbig314.prn1.facebook.com>
Download mbox | patch
Permalink /patch/19513/
State Accepted
Headers show

Comments

Ryan McElroy - March 21, 2017, 1:51 p.m.
# HG changeset patch
# User Ryan McElroy <rmcelroy@fb.com>
# Date 1490104242 25200
#      Tue Mar 21 06:50:42 2017 -0700
# Node ID 99b12351af995446ad4f9d52b3fda0b591611e69
# Parent  527a247f114f8af37326805fd6cce923f9ac6453
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.
Yuya Nishihara - March 21, 2017, 2:05 p.m.
On Tue, 21 Mar 2017 06:51:52 -0700, Ryan McElroy wrote:
> # HG changeset patch
> # User Ryan McElroy <rmcelroy@fb.com>
> # Date 1490104242 25200
> #      Tue Mar 21 06:50:42 2017 -0700
> # Node ID 99b12351af995446ad4f9d52b3fda0b591611e69
> # Parent  527a247f114f8af37326805fd6cce923f9ac6453
> localrepo: improve vfs documentation

Queued this, thanks for the improvement.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -260,11 +260,13 @@  class localrepository(object):
 
     def __init__(self, baseui, path, create=False):
         self.requirements = set()
-        # vfs to access the working copy
+        # wvfs: 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
+        # svfs: usually rooted at .hg/store, used to access repository history
+        # If this is a shared repository, this vfs may point to another
+        # repository's .hg/store directory.
         self.svfs = None
         self.root = self.wvfs.base
         self.path = self.wvfs.join(".hg")