17
17
# Grabbed from https://github.com/buildbot/buildbot/pull/2585, mid-review. The
18
18
# only changes here a few bug fixes that are pending there.
19
19
20
+
20
21
from __future__ import absolute_import
21
22
from __future__ import print_function
22
23
@@ -64,11 +65,11 @@ def checkConfig(self,
64
65
project = '' ,
65
66
pullrequest_filter = True ,
66
67
token = None ,
67
- repository_link = "https" ,
68
+ repository_type = "https" ,
68
69
** kwargs ):
69
- if repository_link not in ["https" , "svn" , "git" , "ssh" ]:
70
+ if repository_type not in ["https" , "svn" , "git" , "ssh" ]:
70
71
config .error (
71
- "repository_link must be one of {https, svn, git, ssh}" )
72
+ "repository_type must be one of {https, svn, git, ssh}" )
72
73
base .ReconfigurablePollingChangeSource .checkConfig (
73
74
self , name = self .name , ** kwargs )
74
75
@@ -84,7 +85,7 @@ def reconfigService(self,
84
85
pullrequest_filter = True ,
85
86
token = None ,
86
87
pollAtLaunch = False ,
87
- repository_link = "https" ,
88
+ repository_type = "https" ,
88
89
** kwargs ):
89
90
yield base .ReconfigurablePollingChangeSource .reconfigService (
90
91
self , name = self .name , ** kwargs )
@@ -101,16 +102,13 @@ def reconfigService(self,
101
102
self ._http = yield httpclientservice .HTTPClientService .getService (
102
103
self .master , baseURL , headers = http_headers )
103
104
104
- if not branches :
105
- branches = ['master' ]
106
-
107
105
self .token = token
108
106
self .owner = owner
109
107
self .repo = repo
110
108
self .branches = branches
111
109
self .project = project
112
110
self .pollInterval = pollInterval
113
- self .repository_link = link_urls [repository_link ]
111
+ self .repository_type = link_urls [repository_type ]
114
112
115
113
if callable (pullrequest_filter ):
116
114
self .pullrequest_filter = pullrequest_filter
@@ -184,7 +182,7 @@ def _processChanges(self, github_result):
184
182
revision = pr ['head' ]['sha' ]
185
183
186
184
# Check to see if the branch is set or matches
187
- if base_branch not in self .branches :
185
+ if self . branches is not None and base_branch not in self .branches :
188
186
continue
189
187
if (self .pullrequest_filter is not None and
190
188
not self .pullrequest_filter (pr )):
@@ -194,7 +192,7 @@ def _processChanges(self, github_result):
194
192
# Access title, repo, html link, and comments
195
193
branch = pr ['head' ]['ref' ]
196
194
title = pr ['title' ]
197
- repo = pr ['head' ]['repo' ][self .repository_link ]
195
+ repo = pr ['head' ]['repo' ][self .repository_type ]
198
196
revlink = pr ['html_url' ]
199
197
comments = pr ['body' ]
200
198
updated = datetime .strptime (pr ['updated_at' ],
0 commit comments