##// 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,13 +368,14 b' class MercurialRepository(BaseRepository'
368 368 be created.
369 369
370 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 372 working copy accordingly to `do_workspace_checkout` flag.
373 373 """
374 374 if create and os.path.exists(self.path):
375 375 raise RepositoryError(
376 376 f"Cannot create repository at {self.path}, location already exist")
377 377
378 if create:
378 379 if src_url:
379 380 url = str(self._get_url(src_url))
380 381 MercurialRepository.check_url(url, self.config)
@@ -383,11 +384,16 b' class MercurialRepository(BaseRepository'
383 384
384 385 # Don't try to create if we've already cloned repo
385 386 create = False
386
387 if create:
387 self._remote.localrepository(create)
388 else:
388 389 os.makedirs(self.path, mode=0o755)
390 create = True
391 self._remote.localrepository(create)
389 392
390 self._remote.localrepository(create)
393 else:
394 if not self._remote.assert_correct_path():
395 raise RepositoryError(
396 f'Path "{self.path}" does not contain a Mercurial repository')
391 397
392 398 @LazyProperty
393 399 def in_memory_commit(self):
General Comments 0
You need to be logged in to leave comments. Login now