Show More
@@ -94,10 +94,10 b' class SimpleVCS(object):' | |||
|
94 | 94 | # we use this regex which will match only on URLs pointing to shadow |
|
95 | 95 | # repositories. |
|
96 | 96 | shadow_repo_re = re.compile( |
|
97 | '(?P<groups>(?:{slug_pat})(?:/{slug_pat})*)' # repo groups | |
|
98 |
' |
|
|
99 |
' |
|
|
100 |
' |
|
|
97 | '(?P<groups>(?:{slug_pat})(?:/{slug_pat})*/)?' # repo groups | |
|
98 | '(?P<target>{slug_pat})/' # target repo | |
|
99 | 'pull-request/(?P<pr_id>\d+)/' # pull request | |
|
100 | 'repository$' # shadow repo | |
|
101 | 101 | .format(slug_pat=SLUG_RE.pattern)) |
|
102 | 102 | |
|
103 | 103 | def __init__(self, application, config, registry): |
@@ -143,15 +143,17 b' class SimpleVCS(object):' | |||
|
143 | 143 | match_dict = match.groupdict() |
|
144 | 144 | |
|
145 | 145 | # Build acl repo name from regex match. |
|
146 | acl_repo_name = safe_unicode( | |
|
147 | '{groups}/{target}'.format(**match_dict)) | |
|
146 | acl_repo_name = safe_unicode('{groups}{target}'.format( | |
|
147 | groups=match_dict['groups'] or '', | |
|
148 | target=match_dict['target'])) | |
|
148 | 149 | |
|
149 | 150 | # Retrieve pull request instance by ID from regex match. |
|
150 | 151 | pull_request = PullRequest.get(match_dict['pr_id']) |
|
151 | 152 | |
|
152 | 153 | # Only proceed if we got a pull request and if acl repo name from |
|
153 | 154 | # URL equals the target repo name of the pull request. |
|
154 |
if pull_request and acl_repo_name == |
|
|
155 | if pull_request and (acl_repo_name == | |
|
156 | pull_request.target_repo.repo_name): | |
|
155 | 157 | # Get file system path to shadow repository. |
|
156 | 158 | workspace_id = PullRequestModel()._workspace_id(pull_request) |
|
157 | 159 | target_vcs = pull_request.target_repo.scm_instance() |
General Comments 0
You need to be logged in to leave comments.
Login now