266 if osp.isfile(osp.join(tmpdir, 'format.txt')): |
266 if osp.isfile(osp.join(tmpdir, 'format.txt')): |
267 with open(osp.join(tmpdir, 'format.txt')) as format_file: |
267 with open(osp.join(tmpdir, 'format.txt')) as format_file: |
268 written_format = format_file.readline().strip() |
268 written_format = format_file.readline().strip() |
269 if written_format in ('portable', 'native'): |
269 if written_format in ('portable', 'native'): |
270 format = written_format |
270 format = written_format |
271 self.config.init_cnxset_pool = False |
271 repo = self.repo = repository.Repository(self.config, bootstrap=False) |
272 repo = self.repo = repository.Repository(self.config) |
|
273 source = repo.system_source |
272 source = repo.system_source |
274 try: |
273 try: |
275 source.restore(osp.join(tmpdir, source.uri), self.confirm, drop, format) |
274 source.restore(osp.join(tmpdir, source.uri), self.confirm, drop, format) |
276 except Exception as exc: |
275 except Exception as exc: |
277 print('-> error trying to restore %s [%s]' % (source.uri, exc)) |
276 print('-> error trying to restore %s [%s]' % (source.uri, exc)) |