Skip to content

Commit

Permalink
Merge vlefort/buildbot:master (PR #1144)
Browse files Browse the repository at this point in the history
+autopep8
  • Loading branch information
djmitche committed Apr 28, 2014
2 parents b6d9847 + e488e5c commit 744d64a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 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 @@ -127,15 +127,16 @@ def __init__(self, repourl=None, branch='HEAD', mode='incremental', method=None,
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, basestring):
if self.mode not in ['incremental', 'full']:
bbconfig.error("Git: mode must be 'incremental' or 'full'.")
if isinstance(self.method, basestring):
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 744d64a

Please sign in to comment.