diff mercurial/subrepo.py @ 35833:eed02e192770 stable

subrepo: don't attempt to share remote sources (issue5793) Untangling _abssource() to resolve the new subrepo relative to the shared parent's share path, and then either sharing from there (if it exists), or cloning to that location and then sharing, is probably more than should be attempted on stable. Absolute subrepo references are discouraged, so for now, this resumes the behavior prior to 68e0bcb90357 of cloning the absolute subrepo locally.
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 01 Mar 2018 11:13:00 -0500
parents 0c0689a7565e
children fb278041df06
line wrap: on
line diff
--- a/mercurial/subrepo.py	Wed Feb 28 00:29:27 2018 -0500
+++ b/mercurial/subrepo.py	Thu Mar 01 11:13:00 2018 -0500
@@ -982,7 +982,13 @@
         if len(self._repo) == 0:
             # use self._repo.vfs instead of self.wvfs to remove .hg only
             self._repo.vfs.rmtree()
-            if parentrepo.shared():
+
+            # A remote subrepo could be shared if there is a local copy
+            # relative to the parent's share source.  But clone pooling doesn't
+            # assemble the repos in a tree, so that can't be consistently done.
+            # A simpler option is for the user to configure clone pooling, and
+            # work with that.
+            if parentrepo.shared() and hg.islocal(srcurl):
                 self.ui.status(_('sharing subrepo %s from %s\n')
                                % (subrelpath(self), srcurl))
                 shared = hg.share(self._repo._subparent.baseui,