# HG changeset patch
# User Jun Wu <qu...@fb.com>
# Date 1486689360 28800
#      Thu Feb 09 17:16:00 2017 -0800
# Node ID e042a694438fc4b35edcdcda99a4b6c4a0ce5bf2
# Parent  400747616e74d8af7ea053692e861d2495e56d78
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r e042a694438f
localrepo: move sharedpath to baselocalrepository

See previous patches for why.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -274,4 +274,17 @@ class baselocalrepository(object):
         self.requirements = self._loadrequirements(create)
 
+        self.sharedpath = self.path
+        try:
+            vfs = scmutil.vfs(self.vfs.read("sharedpath").rstrip('\n'),
+                              realpath=True)
+            s = vfs.base
+            if not vfs.exists():
+                raise error.RepoError(
+                    _('.hg/sharedpath points to nonexistent directory %s') % s)
+            self.sharedpath = s
+        except IOError as inst:
+            if inst.errno != errno.ENOENT:
+                raise
+
     def _loadextensions(self):
         # baselocalrepository is side-effect free, so "loading extensions" is a
@@ -321,17 +334,4 @@ class localrepository(baselocalrepositor
                                                 realfs=False)
 
-        self.sharedpath = self.path
-        try:
-            vfs = scmutil.vfs(self.vfs.read("sharedpath").rstrip('\n'),
-                              realpath=True)
-            s = vfs.base
-            if not vfs.exists():
-                raise error.RepoError(
-                    _('.hg/sharedpath points to nonexistent directory %s') % s)
-            self.sharedpath = s
-        except IOError as inst:
-            if inst.errno != errno.ENOENT:
-                raise
-
         self.store = store.store(
                 self.requirements, self.sharedpath, scmutil.vfs)
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to