diff hgext/narrow/narrowrepo.py @ 36159:0fe7e39dc683

hg: move share._getsrcrepo into core The fact we were calling this from extensions was a sign that it should live in core. We were also able to remove some extra attribute aliases from the share extension. Differential Revision: https://phab.mercurial-scm.org/D2200
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 12 Feb 2018 16:15:34 -0800
parents 0c104ee51918
children 9fd8c2a3db5a
line wrap: on
line diff
--- a/hgext/narrow/narrowrepo.py	Mon Feb 12 15:49:15 2018 -0800
+++ b/hgext/narrow/narrowrepo.py	Mon Feb 12 16:15:34 2018 -0800
@@ -9,15 +9,12 @@
 
 from mercurial import (
     bundlerepo,
+    hg,
     localrepo,
     match as matchmod,
     scmutil,
 )
 
-from .. import (
-    share,
-)
-
 from . import (
     narrowrevlog,
     narrowspec,
@@ -37,7 +34,7 @@
 def unsharenarrowspec(orig, ui, repo, repopath):
     if (REQUIREMENT in repo.requirements
         and repo.path == repopath and repo.shared()):
-        srcrepo = share._getsrcrepo(repo)
+        srcrepo = hg.sharedreposource(repo)
         with srcrepo.vfs(narrowspec.FILENAME) as f:
             spec = f.read()
         with repo.vfs(narrowspec.FILENAME, 'w') as f: