mercurial/subrepo.py
branchstable
changeset 13460 64bb8e586a92
parent 13432 5a5bd7614401
child 13465 fa88fabc1d66
--- a/mercurial/subrepo.py	Tue Feb 22 16:31:01 2011 +0100
+++ b/mercurial/subrepo.py	Tue Feb 22 15:11:10 2011 -0500
@@ -659,6 +659,7 @@
         self._path = path
         self._relpath = os.path.join(reporelpath(ctx._repo), path)
         self._abspath = ctx._repo.wjoin(path)
+        self._subparent = ctx._repo
         self._ui = ctx._repo.ui
 
     def _gitcommand(self, commands, env=None, stream=False):
@@ -751,10 +752,14 @@
                          (remote, ref.split('/', 2)[2])] = b
         return tracking
 
+    def _abssource(self, source):
+        self._subsource = source
+        return _abssource(self)
+
     def _fetch(self, source, revision):
         if not os.path.exists(os.path.join(self._abspath, '.git')):
             self._ui.status(_('cloning subrepo %s\n') % self._relpath)
-            self._gitnodir(['clone', source, self._abspath])
+            self._gitnodir(['clone', self._abssource(source), self._abspath])
         if self._githavelocally(revision):
             return
         self._ui.status(_('pulling subrepo %s\n') % self._relpath)
@@ -763,7 +768,7 @@
         if self._githavelocally(revision):
             return
         # then try from known subrepo source
-        self._gitcommand(['fetch', source])
+        self._gitcommand(['fetch', self._abssource(source)])
         if not self._githavelocally(revision):
             raise util.Abort(_("revision %s does not exist in subrepo %s\n") %
                                (revision, self._relpath))