[cig-commits] r21901 - in cs/buildbot/trunk/buildbot: slave steps
brad at geodynamics.org
brad at geodynamics.org
Thu Apr 18 15:26:22 PDT 2013
Author: brad
Date: 2013-04-18 15:26:22 -0700 (Thu, 18 Apr 2013)
New Revision: 21901
Modified:
cs/buildbot/trunk/buildbot/slave/commands.py
cs/buildbot/trunk/buildbot/steps/source.py
Log:
Updated git to look like mercurial. Update to current git commands.
Modified: cs/buildbot/trunk/buildbot/slave/commands.py
===================================================================
--- cs/buildbot/trunk/buildbot/slave/commands.py 2013-04-18 21:07:15 UTC (rev 21900)
+++ cs/buildbot/trunk/buildbot/slave/commands.py 2013-04-18 22:26:22 UTC (rev 21901)
@@ -1744,7 +1744,7 @@
def doVCUpdate(self):
d = os.path.join(self.builder.basedir, self.srcdir)
- command = ['cg-update']
+ command = ['git pull']
c = ShellCommand(self.builder, command, d,
sendRC=False, timeout=self.timeout)
self.command = c
@@ -1753,7 +1753,7 @@
def doVCFull(self):
d = os.path.join(self.builder.basedir, self.srcdir)
os.mkdir(d)
- command = ['cg-clone', '-s', self.repourl]
+ command = ['git clone', self.repourl]
c = ShellCommand(self.builder, command, d,
sendRC=False, timeout=self.timeout)
self.command = c
Modified: cs/buildbot/trunk/buildbot/steps/source.py
===================================================================
--- cs/buildbot/trunk/buildbot/steps/source.py 2013-04-18 21:07:15 UTC (rev 21900)
+++ cs/buildbot/trunk/buildbot/steps/source.py 2013-04-18 22:26:22 UTC (rev 21901)
@@ -565,22 +565,80 @@
@type repourl: string
@param repourl: the URL which points at the git repository
"""
+ self.root = None # TODO
self.branch = None # TODO
Source.__init__(self, **kwargs)
self.args['repourl'] = repourl
- def startVC(self, branch, revision, patch):
- self.args['branch'] = branch
- self.args['revision'] = revision
- self.args['patch'] = patch
+class Git(Source):
+ """
+ Check out a source tree from a git repository 'repourl'.
+
+ Revised by Brad Aagaard on 2013-04-15
+ Original Git class appears to be incomplete. Use Mercurial as
+ a starting point.
+ """
+
+ name = "git"
+
+ def __init__(self, repourl=None, baseURL=None,
+ root=None, defaultBranch=None,
+ **kwargs):
+ """
+ @type repourl: string
+ @param repourl: the URL which points at the Git repository.
+ This is used as the default branch. Using C{repourl}
+ does not enable builds of alternate branches: use
+ C{baseURL} to enable this. Use either C{repourl} or
+ C{baseURL}, not both.
+
+ @param baseURL: if branches are enabled, this is the base URL to
+ which a branch name will be appended. It should
+ probably end in a slash. Use exactly one of
+ C{repourl} and C{baseURL}.
+
+ @param defaultBranch: if branches are enabled, this is the branch
+ to use if the Build does not specify one
+ explicitly. It will simply be appended to
+ C{baseURL} and the result handed to the
+ 'hg clone' command.
+ """
+ self.repourl = repourl
+ self.baseURL = baseURL
+ self.root = root
+ self.branch = defaultBranch
+ Source.__init__(self, **kwargs)
+ if (not repourl and not baseURL) or (repourl and baseURL):
+ raise ValueError("you must provide exactly one of repourl and"
+ " baseURL")
+
+ def startVC(self, root, branch, revision, patch):
slavever = self.slaveVersion("git")
if not slavever:
raise BuildSlaveTooOldError("slave is too old, does not know "
"about git")
+
+ if self.repourl:
+ assert not branch # we need baseURL= to use branches
+ self.args['repourl'] = self.repourl
+ else:
+ self.args['repourl'] = self.baseURL + root + branch
+ self.args['revision'] = revision
+ self.args['patch'] = patch
+
+ revstuff = []
+ if branch is not None and branch != self.branch:
+ revstuff.append("[branch]")
+ self.description.extend(revstuff)
+ self.descriptionDone.extend(revstuff)
+
cmd = LoggedRemoteCommand("git", self.args)
self.startCommand(cmd)
+
+
+
class Arch(Source):
"""Check out a source tree from an Arch repository named 'archive'
available at 'url'. 'version' specifies which version number (development
More information about the CIG-COMMITS
mailing list