##// END OF EJS Templates
subrepo: expand relative sources for git subrepos
Eric Eisner -
r13460:64bb8e58 stable
parent child Browse files
Show More
@@ -659,6 +659,7 b' class gitsubrepo(abstractsubrepo):'
659 659 self._path = path
660 660 self._relpath = os.path.join(reporelpath(ctx._repo), path)
661 661 self._abspath = ctx._repo.wjoin(path)
662 self._subparent = ctx._repo
662 663 self._ui = ctx._repo.ui
663 664
664 665 def _gitcommand(self, commands, env=None, stream=False):
@@ -751,10 +752,14 b' class gitsubrepo(abstractsubrepo):'
751 752 (remote, ref.split('/', 2)[2])] = b
752 753 return tracking
753 754
755 def _abssource(self, source):
756 self._subsource = source
757 return _abssource(self)
758
754 759 def _fetch(self, source, revision):
755 760 if not os.path.exists(os.path.join(self._abspath, '.git')):
756 761 self._ui.status(_('cloning subrepo %s\n') % self._relpath)
757 self._gitnodir(['clone', source, self._abspath])
762 self._gitnodir(['clone', self._abssource(source), self._abspath])
758 763 if self._githavelocally(revision):
759 764 return
760 765 self._ui.status(_('pulling subrepo %s\n') % self._relpath)
@@ -763,7 +768,7 b' class gitsubrepo(abstractsubrepo):'
763 768 if self._githavelocally(revision):
764 769 return
765 770 # then try from known subrepo source
766 self._gitcommand(['fetch', source])
771 self._gitcommand(['fetch', self._abssource(source)])
767 772 if not self._githavelocally(revision):
768 773 raise util.Abort(_("revision %s does not exist in subrepo %s\n") %
769 774 (revision, self._relpath))
@@ -305,6 +305,15 b' nested archive'
305 305 f
306 306 g
307 307
308 relative source expansion
309
310 $ cd ..
311 $ mkdir d
312 $ hg clone t d/t
313 updating to branch default
314 cloning subrepo s
315 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
316
308 317 Check hg update --clean
309 318 $ cd $TESTTMP/ta
310 319 $ echo > s/g
General Comments 0
You need to be logged in to leave comments. Login now