762 self._ui.status(_('cloning subrepo %s\n') % self._relpath) |
762 self._ui.status(_('cloning subrepo %s\n') % self._relpath) |
763 self._gitnodir(['clone', self._abssource(source), self._abspath]) |
763 self._gitnodir(['clone', self._abssource(source), self._abspath]) |
764 if self._githavelocally(revision): |
764 if self._githavelocally(revision): |
765 return |
765 return |
766 self._ui.status(_('pulling subrepo %s\n') % self._relpath) |
766 self._ui.status(_('pulling subrepo %s\n') % self._relpath) |
767 # first try from origin |
767 # try only origin: the originally cloned repo |
768 self._gitcommand(['fetch']) |
768 self._gitcommand(['fetch']) |
769 if self._githavelocally(revision): |
|
770 return |
|
771 # then try from known subrepo source |
|
772 self._gitcommand(['fetch', self._abssource(source)]) |
|
773 if not self._githavelocally(revision): |
769 if not self._githavelocally(revision): |
774 raise util.Abort(_("revision %s does not exist in subrepo %s\n") % |
770 raise util.Abort(_("revision %s does not exist in subrepo %s\n") % |
775 (revision, self._relpath)) |
771 (revision, self._relpath)) |
776 |
772 |
777 def dirty(self, ignoreupdate=False): |
773 def dirty(self, ignoreupdate=False): |