Show More
@@ -368,13 +368,14 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 create: | |||
378 | if src_url: |
|
379 | if src_url: | |
379 | url = str(self._get_url(src_url)) |
|
380 | url = str(self._get_url(src_url)) | |
380 | MercurialRepository.check_url(url, self.config) |
|
381 | MercurialRepository.check_url(url, self.config) | |
@@ -383,11 +384,16 b' class MercurialRepository(BaseRepository' | |||||
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 | |
386 |
|
387 | self._remote.localrepository(create) | ||
387 |
|
|
388 | else: | |
388 | os.makedirs(self.path, mode=0o755) |
|
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 | @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