##// END OF EJS Templates
ssh: allow clone by ID via SSH operations.
milka -
r4644:17476173 default
parent child Browse files
Show More
@@ -89,6 +89,14 b' class SshWrapper(object):'
89 89
90 90 return conn
91 91
92 def maybe_translate_repo_uid(self, repo_name):
93 if repo_name.startswith('_'):
94 from rhodecode.model.repo import RepoModel
95 by_id_match = RepoModel().get_repo_by_id(repo_name)
96 if by_id_match:
97 repo_name = by_id_match.repo_name
98 return repo_name
99
92 100 def get_repo_details(self, mode):
93 101 vcs_type = mode if mode in ['svn', 'hg', 'git'] else None
94 102 repo_name = None
@@ -97,14 +105,14 b' class SshWrapper(object):'
97 105 hg_match = re.match(hg_pattern, self.command)
98 106 if hg_match is not None:
99 107 vcs_type = 'hg'
100 repo_name = hg_match.group(1).strip('/')
108 repo_name = self.maybe_translate_repo_uid(hg_match.group(1).strip('/'))
101 109 return vcs_type, repo_name, mode
102 110
103 111 git_pattern = r'^git-(receive-pack|upload-pack)\s\'[/]?(\S+?)(|\.git)\'$'
104 112 git_match = re.match(git_pattern, self.command)
105 113 if git_match is not None:
106 114 vcs_type = 'git'
107 repo_name = git_match.group(2).strip('/')
115 repo_name = self.maybe_translate_repo_uid(git_match.group(2).strip('/'))
108 116 mode = git_match.group(1)
109 117 return vcs_type, repo_name, mode
110 118
General Comments 0
You need to be logged in to leave comments. Login now