##// END OF EJS Templates
vcs-core: add a shadow-repo extractor for pull-requests, and git objects.
marcink -
r1363:c1fd3916 default
parent child Browse files
Show More
@@ -747,6 +747,9 b' class GitRepository(BaseRepository):'
747
747
748 return heads
748 return heads
749
749
750 def _get_shadow_instance(self, shadow_repository_path, enable_hooks=False):
751 return GitRepository(shadow_repository_path)
752
750 def _local_pull(self, repository_path, branch_name):
753 def _local_pull(self, repository_path, branch_name):
751 """
754 """
752 Pull a branch from a local repository.
755 Pull a branch from a local repository.
@@ -3328,6 +3328,18 b' class PullRequest(Base, _PullRequestBase'
3328 from rhodecode.model.changeset_status import ChangesetStatusModel
3328 from rhodecode.model.changeset_status import ChangesetStatusModel
3329 return ChangesetStatusModel().reviewers_statuses(self)
3329 return ChangesetStatusModel().reviewers_statuses(self)
3330
3330
3331 @property
3332 def workspace_id(self):
3333 from rhodecode.model.pull_request import PullRequestModel
3334 return PullRequestModel()._workspace_id(self)
3335
3336 def get_shadow_repo(self):
3337 workspace_id = self.workspace_id
3338 vcs_obj = self.target_repo.scm_instance()
3339 shadow_repository_path = vcs_obj._get_shadow_repository_path(
3340 workspace_id)
3341 return vcs_obj._get_shadow_instance(shadow_repository_path)
3342
3331
3343
3332 class PullRequestVersion(Base, _PullRequestBase):
3344 class PullRequestVersion(Base, _PullRequestBase):
3333 __tablename__ = 'pull_request_versions'
3345 __tablename__ = 'pull_request_versions'
General Comments 0
You need to be logged in to leave comments. Login now