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