[PATCH 1 of 3 V1] localrepo: support for shared repo location

Oleg Afanasyev olegaf at fb.com
Fri Apr 8 01:08:20 UTC 2016


# HG changeset patch
# User Oleg Afanasyev <olegaf at fb.com>
# Date 1459526806 25200
#      Fri Apr 01 09:06:46 2016 -0700
# Node ID 1df4525bb092eb3ba82b1a7929b5f5b8a9110904
# Parent  ff0d3b6b287f89594bd8d0308fe2810d2a18ea01
localrepo: support for shared repo location

Localrepo will provide a vfs for shared repository location. Extensions
can use this location if they expect their data to be shareable.

For non shared repositories this location will be equal to the main one.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -869,6 +869,12 @@
             return 'store'
         return None
 
+    def sharedvfs(self):
+        if self.sharedpath != self.path:
+            return scmutil.vfs(self.sharedpath)
+        else:
+            return self.vfs
+
     def join(self, f, *insidef):
         return self.vfs.join(os.path.join(f, *insidef))
 


More information about the Mercurial-devel mailing list