[Buildbot-commits] buildbot/buildbot/steps source.py,1.9,1.10

Brian Warner warner at users.sourceforge.net
Thu Nov 22 01:04:36 UTC 2007


Update of /cvsroot/buildbot/buildbot/buildbot/steps
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32481/buildbot/steps

Modified Files:
	source.py 
Log Message:
[project @ improve Git support, plus docs and tests. Thanks to Haavard Skinnemoen for the amazing patch. Closes #130.]

Original author: warner at lothar.com
Date: 2007-11-22 01:03:37+00:00

Index: source.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/steps/source.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- source.py	30 Sep 2007 21:16:32 -0000	1.9
+++ source.py	22 Nov 2007 01:04:34 -0000	1.10
@@ -571,15 +571,25 @@
 
     name = "git"
 
-    def __init__(self, repourl, **kwargs):
+    def __init__(self, repourl, branch="master", **kwargs):
         """
         @type  repourl: string
         @param repourl: the URL which points at the git repository
+
+        @type  branch: string
+        @param branch: The branch or tag to check out by default. If
+                       a build specifies a different branch, it will
+                       be used instead of this.
         """
-        self.branch = None # TODO
         Source.__init__(self, **kwargs)
-        self.addFactoryArguments(repourl=repourl)
-        self.args['repourl'] = repourl
+        self.addFactoryArguments(repourl=repourl, branch=branch)
+        self.args.update({'repourl': repourl,
+                          'branch': branch})
+
+    def computeSourceRevision(self, changes):
+        if not changes:
+            return None
+        return changes[-1].revision
 
     def startVC(self, branch, revision, patch):
         self.args['branch'] = branch





More information about the Commits mailing list