Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/ddunbar/buildbot
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin J. Mitchell committed Dec 21, 2009
2 parents c28838e + e092d24 commit 668c83e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 4 additions & 2 deletions buildbot/locks.py
Expand Up @@ -150,7 +150,7 @@ def getLock(self, slavebuilder):
return self.locks[slavename]


class LockAccess:
class LockAccess(util.ComparableMixin):
""" I am an object representing a way to access a lock.
@param lockid: LockId instance that should be accessed.
Expand All @@ -159,6 +159,8 @@ class LockAccess:
@param mode: Mode of accessing the lock.
@type mode: A string, either 'counting' or 'exclusive'.
"""

compare_attrs = ['lockid', 'mode']
def __init__(self, lockid, mode):
self.lockid = lockid
self.mode = mode
Expand Down Expand Up @@ -234,7 +236,7 @@ class SlaveLock(BaseLockId):
"""

compare_attrs = ['name', 'maxCount', '_maxCountForSlaveList']
compare_attrs = ['name', 'maxCount', 'maxCountForSlave', '_maxCountForSlaveList']
lockClass = RealSlaveLock
def __init__(self, name, maxCount=1, maxCountForSlave={}):
self.name = name
Expand Down
8 changes: 2 additions & 6 deletions buildbot/process/builder.py
Expand Up @@ -439,12 +439,8 @@ def compareToSetup(self, setup):
% (self.slavebuilddir, setup['slavebuilddir']))
if setup['factory'] != self.buildFactory: # compare objects
diffs.append('factory changed')
oldlocks = [(lock.__class__, lock.name)
for lock in self.locks]
newlocks = [(lock.__class__, lock.name)
for lock in setup.get('locks',[])]
if oldlocks != newlocks:
diffs.append('locks changed from %s to %s' % (oldlocks, newlocks))
if setup.get('locks', []) != self.locks:
diffs.append('locks changed from %s to %s' % (self.locks, setup.get('locks')))
if setup.get('nextSlave') != self.nextSlave:
diffs.append('nextSlave changed from %s to %s' % (self.nextSlave, setup['nextSlave']))
if setup.get('nextBuild') != self.nextBuild:
Expand Down

0 comments on commit 668c83e

Please sign in to comment.