Skip to content

Commit

Permalink
Add mode and method of git step to renderables
Browse files Browse the repository at this point in the history
  • Loading branch information
vlefort committed Apr 25, 2014
1 parent 71e5674 commit 341da1a
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions master/buildbot/steps/source/git.py
Expand Up @@ -62,7 +62,7 @@ class Git(Source):

""" Class for Git with all the smarts """
name = 'git'
renderables = ["repourl", "reference", "branch", "codebase"]
renderables = ["repourl", "reference", "branch", "codebase", "mode", "method"]

def __init__(self, repourl=None, branch='HEAD', mode='incremental', method=None,
reference=None, submodules=False, shallow=False, progress=False, retryFetch=False,
Expand Down Expand Up @@ -126,16 +126,17 @@ def __init__(self, repourl=None, branch='HEAD', mode='incremental', method=None,
self.supportsBranch = True
self.srcdir = 'source'
Source.__init__(self, **kwargs)

if self.mode not in ['incremental', 'full']:
bbconfig.error("Git: mode must be 'incremental' or 'full'.")

if not self.repourl:
bbconfig.error("Git: must provide repourl.")
if (self.mode == 'full' and
self.method not in ['clean', 'fresh', 'clobber', 'copy', None]):
bbconfig.error("Git: invalid method for mode 'full'.")
if self.shallow and (self.mode != 'full' or self.method != 'clobber'):
bbconfig.error("Git: shallow only possible with mode 'full' and method 'clobber'.")
if isinstance(self.mode, str):
if self.mode not in ['incremental', 'full']:
bbconfig.error("Git: mode must be 'incremental' or 'full'.")
if isinstance(self.method, str):
if (self.mode == 'full' and self.method not in ['clean', 'fresh', 'clobber', 'copy', None]):
bbconfig.error("Git: invalid method for mode 'full'.")
if self.shallow and (self.mode != 'full' or self.method != 'clobber'):
bbconfig.error("Git: shallow only possible with mode 'full' and method 'clobber'.")
if not isinstance(self.getDescription, (bool, dict)):
bbconfig.error("Git: getDescription must be a boolean or a dict.")

Expand Down

0 comments on commit 341da1a

Please sign in to comment.