mercurial/subrepo.py
changeset 9507 5987183d6e59
parent 9186 f783bb979fb3
child 9508 e2fd9b62349b
equal deleted inserted replaced
9506:49b62395e910 9507:5987183d6e59
   166         # we can't fully delete the repository as it may contain
   166         # we can't fully delete the repository as it may contain
   167         # local-only history
   167         # local-only history
   168         self._repo.ui.note(_('removing subrepo %s\n') % self._path)
   168         self._repo.ui.note(_('removing subrepo %s\n') % self._path)
   169         hg.clean(self._repo, node.nullid, False)
   169         hg.clean(self._repo, node.nullid, False)
   170 
   170 
   171     def get(self, state):
   171     def _get(self, state):
   172         source, revision = state
   172         source, revision = state
   173         try:
   173         try:
   174             self._repo.lookup(revision)
   174             self._repo.lookup(revision)
   175         except error.RepoError:
   175         except error.RepoError:
   176             self._repo._subsource = source
   176             self._repo._subsource = source
   177             self._repo.ui.status(_('pulling subrepo %s\n') % self._path)
   177             self._repo.ui.status(_('pulling subrepo %s\n') % self._path)
   178             srcurl = _abssource(self._repo)
   178             srcurl = _abssource(self._repo)
   179             other = hg.repository(self._repo.ui, srcurl)
   179             other = hg.repository(self._repo.ui, srcurl)
   180             self._repo.pull(other)
   180             self._repo.pull(other)
   181 
   181 
       
   182     def get(self, state):
       
   183         self._get(state)
       
   184         source, revision = state
   182         hg.clean(self._repo, revision, False)
   185         hg.clean(self._repo, revision, False)
   183 
   186 
   184     def merge(self, state):
   187     def merge(self, state):
       
   188         self._get(state)
   185         hg.merge(self._repo, state[1], remind=False)
   189         hg.merge(self._repo, state[1], remind=False)
   186 
   190 
   187     def push(self, force):
   191     def push(self, force):
   188         # push subrepos depth-first for coherent ordering
   192         # push subrepos depth-first for coherent ordering
   189         c = self._repo['']
   193         c = self._repo['']