##// END OF EJS Templates
shadow-repos: check if path to shadow repo existing before trying to call SCM object....
marcink -
r2797:169efce7 default
parent child Browse files
Show More
@@ -433,12 +433,14 b' class RepoPullRequestsView(RepoAppView, '
433 source_scm = source_repo.scm_instance()
433 source_scm = source_repo.scm_instance()
434 target_scm = target_repo.scm_instance()
434 target_scm = target_repo.scm_instance()
435
435
436 # try first shadow repo, fallback to regular repo
436 shadow_scm = None
437 try:
437 try:
438 commits_source_repo = pull_request_latest.get_shadow_repo()
438 shadow_scm = pull_request_latest.get_shadow_repo()
439 except Exception:
439 except Exception:
440 log.debug('Failed to get shadow repo', exc_info=True)
440 log.debug('Failed to get shadow repo', exc_info=True)
441 commits_source_repo = source_scm
441 # try first the existing source_repo, and then shadow
442 # repo if we can obtain one
443 commits_source_repo = source_scm or shadow_scm
442
444
443 c.commits_source_repo = commits_source_repo
445 c.commits_source_repo = commits_source_repo
444 c.ancestor = None # set it to None, to hide it from PR view
446 c.ancestor = None # set it to None, to hide it from PR view
@@ -3763,6 +3763,7 b' class PullRequest(Base, _PullRequestBase'
3763 vcs_obj = self.target_repo.scm_instance()
3763 vcs_obj = self.target_repo.scm_instance()
3764 shadow_repository_path = vcs_obj._get_shadow_repository_path(
3764 shadow_repository_path = vcs_obj._get_shadow_repository_path(
3765 workspace_id)
3765 workspace_id)
3766 if os.path.isdir(shadow_repository_path):
3766 return vcs_obj._get_shadow_instance(shadow_repository_path)
3767 return vcs_obj._get_shadow_instance(shadow_repository_path)
3767
3768
3768
3769
General Comments 0
You need to be logged in to leave comments. Login now