Skip to content

Commit

Permalink
rename createSourceStamp to addSourceStamp
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed May 10, 2011
1 parent a311234 commit 2e0a9c7
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion master/buildbot/db/sourcestamps.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SourceStampsConnectorComponent(base.DBConnectorComponent):
A DBConnectorComponent to handle source stamps in the database
"""

def createSourceStamp(self, branch, revision, repository, project,
def addSourceStamp(self, branch, revision, repository, project,
patch_body=None, patch_level=0, patch_subdir=None,
changeids=[]):
"""
Expand Down
4 changes: 2 additions & 2 deletions master/buildbot/schedulers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def addBuildsetForLatest(self, reason='', external_idstring=None,
@type properties: L{buildbot.process.properties.Properties}
@returns: (buildset ID, buildrequest IDs) via Deferred
"""
d = self.master.db.sourcestamps.createSourceStamp(
d = self.master.db.sourcestamps.addSourceStamp(
branch=branch, revision=None, repository=repository,
project=project)
d.addCallback(self.addBuildsetForSourceStamp, reason=reason,
Expand Down Expand Up @@ -303,7 +303,7 @@ def chdict2change(chdict):
return changes.Change.fromChdict(self.master, chdict)
d.addCallback(chdict2change)
def create_sourcestamp(change):
return self.master.db.sourcestamps.createSourceStamp(
return self.master.db.sourcestamps.addSourceStamp(
branch=change.branch,
revision=change.revision,
repository=change.repository,
Expand Down
4 changes: 2 additions & 2 deletions master/buildbot/schedulers/trysched.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def handleJobFile(self, filename, f):
log.msg("incoming Try job did not specify any allowed builder names")
return defer.succeed(None)

d = self.master.db.sourcestamps.createSourceStamp(
d = self.master.db.sourcestamps.addSourceStamp(
branch=parsed_job['branch'],
revision=parsed_job['baserev'],
patch_body=parsed_job['patch_body'],
Expand Down Expand Up @@ -195,7 +195,7 @@ def perspective_try(self, branch, revision, patch, repository, project,
return

wfd = defer.waitForDeferred(
db.sourcestamps.createSourceStamp(branch=branch, revision=revision,
db.sourcestamps.addSourceStamp(branch=branch, revision=revision,
repository=repository, project=project, patch_level=patch[0],
patch_body=patch[1], patch_subdir=''))
# note: no way to specify patch subdir - #1769
Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/sourcestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def getSourceStampId(self, master):
patch_level = None
if self.patch:
patch_level, patch_body = self.patch
d = master.db.sourcestamps.createSourceStamp(
d = master.db.sourcestamps.addSourceStamp(
branch=self.branch, revision=self.revision,
repository=self.repository, project=self.project,
patch_body=patch_body, patch_level=patch_level,
Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/status/web/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def force(self, req, auth_ok=False):
revision = None

master = self.getBuildmaster(req)
d = master.db.sourcestamps.createSourceStamp(branch=branch,
d = master.db.sourcestamps.addSourceStamp(branch=branch,
revision=revision, project=project, repository=repository)
def make_buildset(ssid):
r = ("The web-page 'force build' button was pressed by '%s': %s\n"
Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/steps/trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def start(self):

master = self.build.builder.botmaster.parent # seriously?!
if self.sourceStamp:
d = master.db.sourcestamps.createSourceStamp(**properties.render(self.sourceStamp))
d = master.db.sourcestamps.addSourceStamp(**properties.render(self.sourceStamp))
elif self.alwaysUseLatest:
d = defer.succeed(None)
else:
Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/test/fake/fakedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def insertTestData(self, rows):

# component methods

def createSourceStamp(self, branch, revision, repository, project,
def addSourceStamp(self, branch, revision, repository, project,
patch_body=None, patch_level=0, patch_subdir=None,
changeids=[]):
id = len(self.sourcestamps) + 100
Expand Down
12 changes: 6 additions & 6 deletions master/buildbot/test/unit/test_db_sourcestamps.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def tearDown(self):

# tests

def test_createSourceStamp_simple(self):
def test_addSourceStamp_simple(self):
d = defer.succeed(None)
d.addCallback(lambda _ :
self.db.sourcestamps.createSourceStamp('production', 'abdef',
self.db.sourcestamps.addSourceStamp('production', 'abdef',
'test://repo', 'stamper'))
def check(ssid):
def thd(conn):
Expand All @@ -65,15 +65,15 @@ def thd(conn):
d.addCallback(check)
return d

def test_createSourceStamp_changes(self):
def test_addSourceStamp_changes(self):
# add some sample changes for referential integrity
d = self.insertTestData([
fakedb.Change(changeid=3),
fakedb.Change(changeid=4),
])

d.addCallback(lambda _ :
self.db.sourcestamps.createSourceStamp('production', 'abdef',
self.db.sourcestamps.addSourceStamp('production', 'abdef',
'test://repo', 'stamper', changeids=[3,4]))
def check(ssid):
def thd(conn):
Expand All @@ -95,10 +95,10 @@ def thd(conn):
d.addCallback(check)
return d

def test_createSourceStamp_patch(self):
def test_addSourceStamp_patch(self):
d = defer.succeed(None)
d.addCallback(lambda _ :
self.db.sourcestamps.createSourceStamp('production', 'abdef',
self.db.sourcestamps.addSourceStamp('production', 'abdef',
'test://repo', 'stamper', patch_body='my patch', patch_level=3,
patch_subdir='master/'))
def check(ssid):
Expand Down

0 comments on commit 2e0a9c7

Please sign in to comment.