##// END OF EJS Templates
fix(mercurial): actually use assert_path instead of always initializing repo object....
super-admin -
r5581:68a5b57b default
parent child Browse files
Show More
@@ -368,26 +368,32 b' class MercurialRepository(BaseRepository'
368 be created.
368 be created.
369
369
370 If `src_url` is given, would try to clone repository from the
370 If `src_url` is given, would try to clone repository from the
371 location at given clone_point. Additionally it'll make update to
371 location at given clone_point. Additionally, it'll make update to
372 working copy accordingly to `do_workspace_checkout` flag.
372 working copy accordingly to `do_workspace_checkout` flag.
373 """
373 """
374 if create and os.path.exists(self.path):
374 if create and os.path.exists(self.path):
375 raise RepositoryError(
375 raise RepositoryError(
376 f"Cannot create repository at {self.path}, location already exist")
376 f"Cannot create repository at {self.path}, location already exist")
377
377
378 if src_url:
378 if create:
379 url = str(self._get_url(src_url))
379 if src_url:
380 MercurialRepository.check_url(url, self.config)
380 url = str(self._get_url(src_url))
381 MercurialRepository.check_url(url, self.config)
381
382
382 self._remote.clone(url, self.path, do_workspace_checkout)
383 self._remote.clone(url, self.path, do_workspace_checkout)
383
384
384 # Don't try to create if we've already cloned repo
385 # Don't try to create if we've already cloned repo
385 create = False
386 create = False
387 self._remote.localrepository(create)
388 else:
389 os.makedirs(self.path, mode=0o755)
390 create = True
391 self._remote.localrepository(create)
386
392
387 if create:
393 else:
388 os.makedirs(self.path, mode=0o755)
394 if not self._remote.assert_correct_path():
389
395 raise RepositoryError(
390 self._remote.localrepository(create)
396 f'Path "{self.path}" does not contain a Mercurial repository')
391
397
392 @LazyProperty
398 @LazyProperty
393 def in_memory_commit(self):
399 def in_memory_commit(self):
General Comments 0
You need to be logged in to leave comments. Login now