Skip to content

Commit

Permalink
Merge branch 'tweaks' of git://github.com/Jc2k/buildbot
Browse files Browse the repository at this point in the history
* 'tweaks' of git://github.com/Jc2k/buildbot:
  If Builder env config changes, make sure we detect it
  Support an unlimited number of properties getting passed from web form
  Added project settings to SVNPoller
  • Loading branch information
Dustin J. Mitchell committed Jul 6, 2010
2 parents 710cdcf + 5833e60 commit 7b7f606
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
16 changes: 13 additions & 3 deletions master/buildbot/changes/svnpoller.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class SVNPoller(base.ChangeSource, util.ComparableMixin):
def __init__(self, svnurl, split_file=None,
svnuser=None, svnpasswd=None,
pollinterval=10*60, histmax=100,
svnbin='svn', revlinktmpl='', category=None):
svnbin='svn', revlinktmpl='', category=None, project=None):
"""
@type svnurl: string
@param svnurl: the SVN URL that describes the repository and
Expand Down Expand Up @@ -172,6 +172,11 @@ def __init__(self, svnurl, split_file=None,
@param category: A single category associated with the changes that
could be used by schedulers watch for branches of a
certain name AND category.
@type project string
@param project A single project that the changes are associated with
the repository, added to the changes, for the use in
change filters
"""

if svnurl.endswith("/"):
Expand All @@ -193,6 +198,7 @@ def __init__(self, svnurl, split_file=None,
self.overrun_counter = 0
self.loop = LoopingCall(self.checksvn)
self.category = category
self.project = project

def split_file(self, path):
# use getattr() to avoid turning this function into a bound method,
Expand Down Expand Up @@ -255,7 +261,10 @@ def checksvn(self):
return defer.succeed(None)
self.working = True

log.msg("SVNPoller polling")
if self.project:
log.msg("SVNPoller polling " + self.project)
else:
log.msg("SVNPoller polling")
if not self._prefix:
# this sets self._prefix when it finishes. It fires with
# self._prefix as well, because that makes the unit tests easier
Expand Down Expand Up @@ -461,7 +470,8 @@ def create_changes(self, new_logentries):
branch=branch,
revlink=revlink,
category=self.category,
repository=self.svnurl)
repository=self.svnurl,
project = self.project)
changes.append(c)

return changes
Expand Down
2 changes: 2 additions & 0 deletions master/buildbot/process/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ def compareToSetup(self, setup):
diffs.append('factory changed')
if setup.get('locks', []) != self.locks:
diffs.append('locks changed from %s to %s' % (self.locks, setup.get('locks')))
if setup.get('env', {}) != self.env:
diffs.append('env changed from %s to %s' % (self.env, setup.get('env', {})))
if setup.get('nextSlave') != self.nextSlave:
diffs.append('nextSlave changed from %s to %s' % (self.nextSlave, setup.get('nextSlave')))
if setup.get('nextBuild') != self.nextBuild:
Expand Down
18 changes: 11 additions & 7 deletions master/buildbot/status/web/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,19 @@ def getAndCheckProperties(req):
Return a new Properties object containing each property found in req.
"""
properties = Properties()
for i in (1,2,3):
i = 1
while True:
pname = req.args.get("property%dname" % i, [""])[0]
pvalue = req.args.get("property%dvalue" % i, [""])[0]
if pname and pvalue:
if not re.match(r'^[\w\.\-\/\~:]*$', pname) \
or not re.match(r'^[\w\.\-\/\~:]*$', pvalue):
log.msg("bad property name='%s', value='%s'" % (pname, pvalue))
return None
properties.setProperty(pname, pvalue, "Force Build Form")
if not pname or not pvalue:
break
if not re.match(r'^[\w\.\-\/\~:]*$', pname) \
or not re.match(r'^[\w\.\-\/\~:]*$', pvalue):
log.msg("bad property name='%s', value='%s'" % (pname, pvalue))
return None
properties.setProperty(pname, pvalue, "Force Build Form")
i = i + 1

return properties

def build_get_class(b):
Expand Down

0 comments on commit 7b7f606

Please sign in to comment.