Skip to content

Commit

Permalink
Add support for patch_subdir to SourceStamp
Browse files Browse the repository at this point in the history
  • Loading branch information
maruel committed Oct 24, 2011
1 parent 7d0ff32 commit f8b43ee
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions master/buildbot/sourcestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ def _make_ss(cls, ssid, ssdict, master):

sourcestamp.patch = None
if ssdict['patch_body']:
# note that this class does not store the patch_subdir
sourcestamp.patch = (ssdict['patch_level'],
ssdict['patch_body'])
sourcestamp.patch = (ssdict['patch_level'], ssdict['patch_body'],
ssdict.get('patch_subdir'))
sourcestamp.patch_info = (ssdict['patch_author'],
ssdict['patch_comment'])

Expand Down Expand Up @@ -137,7 +136,7 @@ def __init__(self, branch=None, revision=None, patch=None,
return

if patch is not None:
assert len(patch) == 2
assert 2 <= len(patch) <= 3
assert int(patch[0]) != -1
self.branch = branch
self.patch = patch
Expand Down Expand Up @@ -271,8 +270,12 @@ def getSourceStampId(self, master):
# add it to the DB
patch_body = None
patch_level = None
patch_subdir = None
if self.patch:
patch_level, patch_body = self.patch
patch_level = self.patch[0]
patch_body = self.patch[1]
if len(self.patch) > 2:
patch_subdir = self.patch[2]

patch_author = None
patch_comment = None
Expand All @@ -284,7 +287,8 @@ def getSourceStampId(self, master):
repository=self.repository, project=self.project,
patch_body=patch_body, patch_level=patch_level,
patch_author=patch_author, patch_comment=patch_comment,
patch_subdir=None, changeids=[c.number for c in self.changes])
patch_subdir=patch_subdir,
changeids=[c.number for c in self.changes])
def set_ssid(ssid):
self.ssid = ssid
return ssid
Expand Down

0 comments on commit f8b43ee

Please sign in to comment.