From warner at users.sourceforge.net Thu Nov 1 06:38:07 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 01 Nov 2007 06:38:07 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.978,1.979 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7073 Modified Files: ChangeLog Log Message: [project @ status/tinderbox: add 'columnName' argument, closes #120] Original author: warner at lothar.com Date: 2007-11-01 06:37:18+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.978 retrieving revision 1.979 diff -u -d -r1.978 -r1.979 --- ChangeLog 16 Oct 2007 16:34:25 -0000 1.978 +++ ChangeLog 1 Nov 2007 06:38:05 -0000 1.979 @@ -1,3 +1,8 @@ +2007-10-31 Brian Warner + + * buildbot/status/tinderbox.py (TinderboxMailNotifier): add + 'columnName' argument, from a patch by Ben Hearsum. Closes #120. + 2007-10-16 Brian Warner * buildbot/status/web/slaves.py (BuildSlavesResource.body): fix From warner at users.sourceforge.net Thu Nov 1 06:38:07 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 01 Nov 2007 06:38:07 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status tinderbox.py,1.7,1.8 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7073/buildbot/status Modified Files: tinderbox.py Log Message: [project @ status/tinderbox: add 'columnName' argument, closes #120] Original author: warner at lothar.com Date: 2007-11-01 06:37:18+00:00 Index: tinderbox.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/tinderbox.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- tinderbox.py 29 Sep 2007 22:58:15 -0000 1.7 +++ tinderbox.py 1 Nov 2007 06:38:05 -0000 1.8 @@ -8,6 +8,7 @@ from buildbot import interfaces from buildbot.status import mail from buildbot.status.builder import SUCCESS, WARNINGS +from buildbot.steps.shell import WithProperties import zlib, bz2, base64 @@ -33,12 +34,12 @@ compare_attrs = ["extraRecipients", "fromaddr", "categories", "builders", "addLogs", "relayhost", "subject", "binaryURL", "tree", - "logCompression", "errorparser"] + "logCompression", "errorparser", "columnName"] def __init__(self, fromaddr, tree, extraRecipients, categories=None, builders=None, relayhost="localhost", subject="buildbot %(result)s in %(builder)s", binaryURL="", - logCompression="", errorparser="unix"): + logCompression="", errorparser="unix", columnName=None): """ @type fromaddr: string @param fromaddr: the email address to be used in the 'From' header. @@ -87,6 +88,15 @@ @param errorparser: The error parser that the Tinderbox server should use when scanning the log file. Default is "unix". + + @type columnName: string + @param columnName: When columnName is None, use the buildername as + the Tinderbox column name. When columnName is a + string this exact string will be used for all + builders that this TinderboxMailNotifier cares + about (not recommended). When columnName is a + WithProperties instance it will be interpolated + as such. See WithProperties for more detail. """ mail.MailNotifier.__init__(self, fromaddr, categories=categories, @@ -98,6 +108,10 @@ self.binaryURL = binaryURL self.logCompression = logCompression self.errorparser = errorparser + assert columnName is None or type(columnName) is str \ + or isinstance(columnName, WithProperties), \ + "columnName must be None, a string, or a WithProperties instance" + self.columnName = columnName def buildStarted(self, name, build): builder = build.getBuilder() @@ -135,7 +149,17 @@ text += "\n"; - text += "%s build: %s\n" % (t, name) + if self.columnName is None: + # use the builder name + text = "%s build: %s\n" % (t, name) + elif type(self.columnName) is str: + # use the exact string given + text = "%s build: %s\n" % (t, self.columnName) + elif isinstance(self.columnName, WithProperties): + # interpolate the WithProperties instance, use that + text = "%s build: %s\n" % (t, self.columnName.render(build)) + else: + raise Exception("columnName is an unhandled value") text += "%s errorparser: %s\n" % (t, self.errorparser) # if the build just started... From warner at users.sourceforge.net Thu Nov 1 06:42:23 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 01 Nov 2007 06:42:23 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status words.py,1.51,1.52 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8728/buildbot/status Modified Files: words.py Log Message: [project @ status/words: handle builds which are waiting for a lock. Closes #96.] Original author: warner at lothar.com Date: 2007-11-01 06:41:50+00:00 Index: words.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/words.py,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- words.py 2 Aug 2007 00:07:18 -0000 1.51 +++ words.py 1 Nov 2007 06:42:21 -0000 1.52 @@ -306,7 +306,10 @@ t = [] for build in builds: step = build.getCurrentStep() - s = "(%s)" % " ".join(step.getText()) + if step: + s = "(%s)" % " ".join(step.getText()) + else: + s = "(no current step)" ETA = build.getETA() if ETA is not None: s += " [ETA %s]" % self.convertTime(ETA) From warner at users.sourceforge.net Thu Nov 1 06:42:23 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 01 Nov 2007 06:42:23 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.979,1.980 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8728 Modified Files: ChangeLog Log Message: [project @ status/words: handle builds which are waiting for a lock. Closes #96.] Original author: warner at lothar.com Date: 2007-11-01 06:41:50+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.979 retrieving revision 1.980 diff -u -d -r1.979 -r1.980 --- ChangeLog 1 Nov 2007 06:38:05 -0000 1.979 +++ ChangeLog 1 Nov 2007 06:42:21 -0000 1.980 @@ -1,5 +1,10 @@ 2007-10-31 Brian Warner + * buildbot/status/words.py (Contact.emit_status): if there's no + current step, don't try to display its description. This should + fix the crash when asking the irc bot about builds which are + waiting for a build-wide Lock. Closes #96. + * buildbot/status/tinderbox.py (TinderboxMailNotifier): add 'columnName' argument, from a patch by Ben Hearsum. Closes #120. From warner at users.sourceforge.net Thu Nov 1 08:27:23 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 01 Nov 2007 08:27:23 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status client.py,1.29,1.30 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17841/buildbot/status Modified Files: client.py Log Message: [project @ status/client: buildstep.getLogs() returns a list, not a dict. Closes #121.] Original author: warner at lothar.com Date: 2007-11-01 08:26:52+00:00 Index: client.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/client.py,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- client.py 11 Dec 2006 09:06:35 -0000 1.29 +++ client.py 1 Nov 2007 08:27:20 -0000 1.30 @@ -251,8 +251,8 @@ def remote_getLogs(self): logs = {} - for name,log in self.s.getLogs().items(): - logs[name] = IRemote(log) + for log in self.s.getLogs(): + logs[log.getName()] = IRemote(log) return logs def remote_isFinished(self): From warner at users.sourceforge.net Thu Nov 1 08:27:22 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 01 Nov 2007 08:27:22 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.980,1.981 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17841 Modified Files: ChangeLog Log Message: [project @ status/client: buildstep.getLogs() returns a list, not a dict. Closes #121.] Original author: warner at lothar.com Date: 2007-11-01 08:26:52+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.980 retrieving revision 1.981 diff -u -d -r1.980 -r1.981 --- ChangeLog 1 Nov 2007 06:42:21 -0000 1.980 +++ ChangeLog 1 Nov 2007 08:27:20 -0000 1.981 @@ -1,3 +1,9 @@ +2007-11-01 Brian Warner + + * buildbot/status/client.py (RemoteBuildStep.remote_getLogs): + IBuildStepStatus.getLogs() returns a list, not a dict. Patch from + Fabrice Crestois. Closes #121. + 2007-10-31 Brian Warner * buildbot/status/words.py (Contact.emit_status): if there's no From warner at users.sourceforge.net Thu Nov 1 08:33:39 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 01 Nov 2007 08:33:39 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web base.py,1.19,1.20 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20236/buildbot/status/web Modified Files: base.py Log Message: [project @ webstatus: tolerate results==None without exploding, Closes #118.] Original author: warner at lothar.com Date: 2007-11-01 08:32:54+00:00 Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/base.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- base.py 30 Sep 2007 19:12:48 -0000 1.19 +++ base.py 1 Nov 2007 08:33:37 -0000 1.20 @@ -313,10 +313,11 @@ if len(rev) > 20: rev = "version is too-long" root = self.path_to_root(req) - values = {'class': css_classes[results], + css_class = css_classes.get(results, "") + values = {'class': css_class, 'builder_name': builder_name, 'buildnum': build.getNumber(), - 'results': css_classes[results], + 'results': css_class, 'text': " ".join(build.getText()), 'buildurl': (root + "builders/%s/builds/%d" % (builder_name, From warner at users.sourceforge.net Thu Nov 1 08:33:39 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 01 Nov 2007 08:33:39 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.981,1.982 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20236 Modified Files: ChangeLog Log Message: [project @ webstatus: tolerate results==None without exploding, Closes #118.] Original author: warner at lothar.com Date: 2007-11-01 08:32:54+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.981 retrieving revision 1.982 diff -u -d -r1.981 -r1.982 --- ChangeLog 1 Nov 2007 08:27:20 -0000 1.981 +++ ChangeLog 1 Nov 2007 08:33:36 -0000 1.982 @@ -1,5 +1,10 @@ 2007-11-01 Brian Warner + * buildbot/status/web/base.py (OneLineMixin.make_line): tolerate + results == None (i.e. when the build hasn't finished yet); + previously this code exploded when trying to find a CSS class for + that results value. Patch from Greg Ward. Closes #118. + * buildbot/status/client.py (RemoteBuildStep.remote_getLogs): IBuildStepStatus.getLogs() returns a list, not a dict. Patch from Fabrice Crestois. Closes #121. From warner at users.sourceforge.net Thu Nov 1 08:44:48 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 01 Nov 2007 08:44:48 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web builder.py, 1.11, 1.12 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24498/buildbot/status/web Modified Files: builder.py Log Message: [project @ web/builder.py: tolerate builds without a current step. Closes #111.] Original author: warner at lothar.com Date: 2007-11-01 08:44:00+00:00 Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/builder.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- builder.py 30 Sep 2007 09:23:57 -0000 1.11 +++ builder.py 1 Nov 2007 08:44:46 -0000 1.12 @@ -33,7 +33,12 @@ when_time = time.strftime("%H:%M:%S", time.localtime(time.time() + when)) data += "ETA %ds (%s) " % (when, when_time) - data += "[%s]" % build.getCurrentStep().getName() + step = build.getCurrentStep() + if step: + data += "[%s]" % step.getName() + else: + data += "[waiting for Lock]" + # TODO: is this necessarily the case? return data def body(self, req): From warner at users.sourceforge.net Thu Nov 1 08:44:48 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 01 Nov 2007 08:44:48 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.982,1.983 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24498 Modified Files: ChangeLog Log Message: [project @ web/builder.py: tolerate builds without a current step. Closes #111.] Original author: warner at lothar.com Date: 2007-11-01 08:44:00+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.982 retrieving revision 1.983 diff -u -d -r1.982 -r1.983 --- ChangeLog 1 Nov 2007 08:33:36 -0000 1.982 +++ ChangeLog 1 Nov 2007 08:44:46 -0000 1.983 @@ -1,5 +1,9 @@ 2007-11-01 Brian Warner + * buildbot/status/web/builder.py (StatusResourceBuilder.build_line): + if there's no current step, don't try to display its description. + Same crash as in #96, this time in the web page. Closes #111. + * buildbot/status/web/base.py (OneLineMixin.make_line): tolerate results == None (i.e. when the build hasn't finished yet); previously this code exploded when trying to find a CSS class for From warner at users.sourceforge.net Wed Nov 21 09:22:06 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:22:06 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.985,1.986 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19223 Modified Files: ChangeLog Log Message: [project @ more #138 changes: add 'stop build' button next to the 'force build' form] Original author: warner at lothar.com Date: 2007-11-21 08:52:36+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.985 retrieving revision 1.986 diff -u -d -r1.985 -r1.986 --- ChangeLog 21 Nov 2007 09:21:16 -0000 1.985 +++ ChangeLog 21 Nov 2007 09:22:04 -0000 1.986 @@ -2,6 +2,10 @@ * buildbot/status/web/builder.py (StatusResourceBuilder.force): simplify some 'if' statements + (StatusResourceBuilder.build_line): add a 'Stop Build' button next + to the 'Force Build' button, so you can start and stop a build + from the same place. + * buildbot/slave/bot.py (Bot.remote_setBuilderList): don't consider the 'info' directory as a leftover directory. Patch from Benoit Sigoure, ticket #138. From warner at users.sourceforge.net Wed Nov 21 09:20:33 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:20:33 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.983,1.984 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18468 Modified Files: ChangeLog Log Message: [project @ bot: don't consider the 'info' directory as leftover. Included in #138.] Original author: warner at lothar.com Date: 2007-11-21 08:43:12+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.983 retrieving revision 1.984 diff -u -d -r1.983 -r1.984 --- ChangeLog 1 Nov 2007 08:44:46 -0000 1.983 +++ ChangeLog 21 Nov 2007 09:20:31 -0000 1.984 @@ -1,3 +1,9 @@ +2007-11-21 Brian Warner + + * buildbot/slave/bot.py (Bot.remote_setBuilderList): don't + consider the 'info' directory as a leftover directory. Patch from + Benoit Sigoure, ticket #138. + 2007-11-01 Brian Warner * buildbot/status/web/builder.py (StatusResourceBuilder.build_line): From warner at users.sourceforge.net Wed Nov 21 09:22:51 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:22:51 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.986,1.987 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19356 Modified Files: ChangeLog Log Message: [project @ more #138: after force/stop/ping, redirect back to waterfall, not index page] Original author: warner at lothar.com Date: 2007-11-21 08:56:10+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.986 retrieving revision 1.987 diff -u -d -r1.986 -r1.987 --- ChangeLog 21 Nov 2007 09:22:04 -0000 1.986 +++ ChangeLog 21 Nov 2007 09:22:48 -0000 1.987 @@ -5,6 +5,10 @@ (StatusResourceBuilder.build_line): add a 'Stop Build' button next to the 'Force Build' button, so you can start and stop a build from the same place. + (StatusResourceBuilder.force): redirect back to the waterfall, + rather than the index page + (StatusResourceBuilder.ping): same + * buildbot/status/web/build.py (StatusResourceBuild.stop): same * buildbot/slave/bot.py (Bot.remote_setBuilderList): don't consider the 'info' directory as a leftover directory. Patch from From warner at users.sourceforge.net Wed Nov 21 09:20:34 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:20:34 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave bot.py,1.27,1.28 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18468/buildbot/slave Modified Files: bot.py Log Message: [project @ bot: don't consider the 'info' directory as leftover. Included in #138.] Original author: warner at lothar.com Date: 2007-11-21 08:43:12+00:00 Index: bot.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/bot.py,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- bot.py 2 Aug 2007 00:07:18 -0000 1.27 +++ bot.py 21 Nov 2007 09:20:31 -0000 1.28 @@ -286,7 +286,7 @@ def remote_setBuilderList(self, wanted): retval = {} - wanted_dirs = [] + wanted_dirs = ["info"] for (name, builddir) in wanted: wanted_dirs.append(builddir) b = self.builders.get(name, None) From warner at users.sourceforge.net Wed Nov 21 09:23:36 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:23:36 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.987,1.988 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19774 Modified Files: ChangeLog Log Message: [project @ more #138: factor out force/stop-build form generation] Original author: warner at lothar.com Date: 2007-11-21 08:59:44+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.987 retrieving revision 1.988 diff -u -d -r1.987 -r1.988 --- ChangeLog 21 Nov 2007 09:22:48 -0000 1.987 +++ ChangeLog 21 Nov 2007 09:23:33 -0000 1.988 @@ -1,5 +1,10 @@ 2007-11-21 Brian Warner + * buildbot/status/web/builder.py (StatusResourceBuilder.body): + factor out force/stop form generation + * buildbot/status/web/base.py: same + * buildbot/status/web/build.py: same + * buildbot/status/web/builder.py (StatusResourceBuilder.force): simplify some 'if' statements (StatusResourceBuilder.build_line): add a 'Stop Build' button next From warner at users.sourceforge.net Wed Nov 21 09:21:18 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:21:18 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.984,1.985 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18873 Modified Files: ChangeLog Log Message: [project @ minor cleanup, from #138] Original author: warner at lothar.com Date: 2007-11-21 08:45:29+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.984 retrieving revision 1.985 diff -u -d -r1.984 -r1.985 --- ChangeLog 21 Nov 2007 09:20:31 -0000 1.984 +++ ChangeLog 21 Nov 2007 09:21:16 -0000 1.985 @@ -1,8 +1,11 @@ 2007-11-21 Brian Warner + * buildbot/status/web/builder.py (StatusResourceBuilder.force): + simplify some 'if' statements * buildbot/slave/bot.py (Bot.remote_setBuilderList): don't consider the 'info' directory as a leftover directory. Patch from Benoit Sigoure, ticket #138. + (others): remove trailing whitespace 2007-11-01 Brian Warner From warner at users.sourceforge.net Wed Nov 21 09:25:05 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:25:05 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.989,1.990 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20344 Modified Files: ChangeLog Log Message: [project @ OneBoxPerBuilder: add links to the per-Builder page] Original author: warner at lothar.com Date: 2007-11-21 09:14:24+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.989 retrieving revision 1.990 diff -u -d -r1.989 -r1.990 --- ChangeLog 21 Nov 2007 09:24:18 -0000 1.989 +++ ChangeLog 21 Nov 2007 09:25:03 -0000 1.990 @@ -4,6 +4,8 @@ and one_box_per_builder) to force/stop builds on all Builders at once. * buildbot/status/web/baseweb.py: same + (OneBoxPerBuilder.body): add links to the per-Builder page + * buildbot/status/web/builder.py: same * buildbot/status/web/builder.py (StatusResourceBuilder.body): From warner at users.sourceforge.net Wed Nov 21 09:22:06 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:22:06 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web builder.py, 1.13, 1.14 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19223/buildbot/status/web Modified Files: builder.py Log Message: [project @ more #138 changes: add 'stop build' button next to the 'force build' form] Original author: warner at lothar.com Date: 2007-11-21 08:52:36+00:00 Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/builder.py,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- builder.py 21 Nov 2007 09:21:16 -0000 1.13 +++ builder.py 21 Nov 2007 09:22:04 -0000 1.14 @@ -28,6 +28,7 @@ buildnum = build.getNumber() buildurl = req.childLink("builds/%d" % buildnum) data = '#%d ' % (buildurl, buildnum) + when = build.getETA() if when is not None: when_time = time.strftime("%H:%M:%S", @@ -39,6 +40,13 @@ else: data += "[waiting for Lock]" # TODO: is this necessarily the case? + + if self.builder_control is not None: + stopURL = urllib.quote(req.childLink("builds/%d/stop" % buildnum)) + data += ''' +
+ +
''' % stopURL return data def body(self, req): From warner at users.sourceforge.net Wed Nov 21 09:24:21 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:24:21 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.988,1.989 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20174 Modified Files: ChangeLog Log Message: [project @ more #138: add buttons to force/stop-builds on all Builders at once] Original author: warner at lothar.com Date: 2007-11-21 09:12:29+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.988 retrieving revision 1.989 diff -u -d -r1.988 -r1.989 --- ChangeLog 21 Nov 2007 09:23:33 -0000 1.988 +++ ChangeLog 21 Nov 2007 09:24:18 -0000 1.989 @@ -1,5 +1,11 @@ 2007-11-21 Brian Warner + * buildbot/status/web/base.py: add buttons (to one_line_per_build + and one_box_per_builder) to force/stop builds on all Builders at + once. + * buildbot/status/web/baseweb.py: same + * buildbot/status/web/builder.py: same + * buildbot/status/web/builder.py (StatusResourceBuilder.body): factor out force/stop form generation * buildbot/status/web/base.py: same From warner at users.sourceforge.net Wed Nov 21 09:24:21 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:24:21 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web base.py, 1.21, 1.22 baseweb.py, 1.31, 1.32 builder.py, 1.16, 1.17 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20174/buildbot/status/web Modified Files: base.py baseweb.py builder.py Log Message: [project @ more #138: add buttons to force/stop-builds on all Builders at once] Original author: warner at lothar.com Date: 2007-11-21 09:12:29+00:00 Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/base.py,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- base.py 21 Nov 2007 09:23:34 -0000 1.21 +++ base.py 21 Nov 2007 09:24:18 -0000 1.22 @@ -53,10 +53,15 @@ label = html.escape(label) return ROW_TEMPLATE % {"label": label, "field": field} -def make_stop_form(stopURL): - data = """
-

To stop this build, fill out the following fields and - click the 'Stop' button

\n""" % stopURL +def make_stop_form(stopURL, on_all=False): + if on_all: + data = """ +

To stop all builds, fill out the following fields and + push the 'Stop' button

\n""" % stopURL + else: + data = """ +

To stop this build, fill out the following fields and + push the 'Stop' button

\n""" % stopURL data += make_row("Your name:", "") data += make_row("Reason for stopping build:", @@ -64,10 +69,15 @@ data += '
\n' return data -def make_force_build_form(forceURL): - data = """
-

To force a build, fill out the following fields and - click the 'Force Build' button

""" % forceURL +def make_force_build_form(forceURL, on_all=False): + if on_all: + data = """ +

To force a build on all Builders, fill out the following fields + and push the 'Force Build' button

""" % forceURL + else: + data = """ +

To force a build, fill out the following fields and + push the 'Force Build' button

""" % forceURL return (data + make_row("Your name:", "") Index: baseweb.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/baseweb.py,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- baseweb.py 1 Oct 2007 01:06:51 -0000 1.31 +++ baseweb.py 21 Nov 2007 09:24:18 -0000 1.32 @@ -11,7 +11,8 @@ from buildbot.interfaces import IControl, IStatusReceiver from buildbot.status.web.base import HtmlResource, Box, \ - build_get_class, ICurrentBox, OneLineMixin, map_branches + build_get_class, ICurrentBox, OneLineMixin, map_branches, \ + make_stop_form, make_force_build_form from buildbot.status.web.waterfall import WaterfallStatusResource from buildbot.status.web.changes import ChangesResource from buildbot.status.web.builder import BuildersResource @@ -105,12 +106,28 @@ data += ("

of builders: %s

\n" % (", ".join(builders))) data += "
    \n" got = 0 + building = False + online = 0 for build in g: got += 1 data += "
  • " + self.make_line(req, build) + "
  • \n" + builder_status = build.getBuilder().getState()[0] + if builder_status == "building": + building = True + online += 1 + elif builder_status != "offline": + online += 1 if not got: data += "
  • No matching builds found
  • \n" data += "
\n" + + if building: + stopURL = "builders/_all/stop" + data += make_stop_form(stopURL, True) + if online: + forceURL = "builders/_all/force" + data += make_force_build_form(forceURL, True) + return data @@ -165,7 +182,7 @@ def body(self, req): status = self.getStatus(req) - + builders = req.args.get("builder", status.getBuilderNames()) branches = [b for b in req.args.get("branch", []) if b] @@ -173,6 +190,9 @@ data += "

Latest builds: %s

\n" % ", ".join(branches) data += "\n" + + building = False + online = 0 for bn in builders: builder = status.getBuilder(bn) data += "\n" @@ -200,7 +220,23 @@ data += '\n' current_box = ICurrentBox(builder).getBox(status) data += current_box.td(align="center") + + builder_status = builder.getState()[0] + if builder_status == "building": + building = True + online += 1 + elif builder_status != "offline": + online += 1 + data += "
no build
\n" + + if building: + stopURL = "builders/_all/stop" + data += make_stop_form(stopURL, True) + if online: + forceURL = "builders/_all/force" + data += make_force_build_form(forceURL, True) + return data @@ -254,6 +290,7 @@ /builders/BUILDERNAME/builds/NUM/steps/STEPNAME/logs/LOGNAME: a StatusLog /builders/BUILDERNAME/builds/NUM/tests : summarize test results /builders/BUILDERNAME/builds/NUM/tests/TEST.NAME: results of one test + /builders/_all/{force,stop}: force a build/stop building on all builders. /changes : summarize all ChangeSources /changes/CHANGENUM: a page describing a single Change /schedulers/SCHEDULERNAME: a page describing a Scheduler, including Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/builder.py,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- builder.py 21 Nov 2007 09:23:34 -0000 1.16 +++ builder.py 21 Nov 2007 09:24:18 -0000 1.17 @@ -11,7 +11,7 @@ from buildbot.process.base import BuildRequest from buildbot.sourcestamp import SourceStamp -from buildbot.status.web.build import BuildsResource +from buildbot.status.web.build import BuildsResource, StatusResourceBuild # /builders/$builder class StatusResourceBuilder(HtmlResource, OneLineMixin): @@ -204,6 +204,57 @@ return HtmlResource.getChild(self, path, req) +# /builders/_all +class StatusResourceAllBuilders(HtmlResource, OneLineMixin): + + def __init__(self, status, control): + HtmlResource.__init__(self) + self.status = status + self.control = control + + def getChild(self, path, req): + if path == "force": + return self.force(req) + if path == "stop": + return self.stop(req) + + return HtmlResource.getChild(self, path, req) + + def force(self, req): + for bname in self.status.getBuilderNames(): + builder_status = self.status.getBuilder(bname) + builder_control = None + c = self.getControl(req) + if c: + builder_control = c.getBuilder(bname) + build = StatusResourceBuilder(builder_status, builder_control) + build.force(req) + return Redirect("../../waterfall") + + def stop(self, req): + for bname in self.status.getBuilderNames(): + builder_status = self.status.getBuilder(bname) + builder_control = None + c = self.getControl(req) + if c: + builder_control = c.getBuilder(bname) + (state, current_builds) = builder_status.getState() + if state != "building": + continue + for b in current_builds: + build_status = builder_status.getBuild(b.number) + if not build_status: + continue + if builder_control: + build_control = builder_control.getBuild(b.number) + else: + build_control = None + build = StatusResourceBuild(build_status, build_control, + builder_control) + build.stop(req) + return Redirect("../../waterfall") + + # /builders class BuildersResource(HtmlResource): title = "Builders" @@ -235,6 +286,9 @@ if c: builder_control = c.getBuilder(path) return StatusResourceBuilder(builder_status, builder_control) + if path == "_all": + return StatusResourceAllBuilders(self.getStatus(req), + self.getControl(req)) return HtmlResource.getChild(self, path, req) From warner at users.sourceforge.net Wed Nov 21 09:25:50 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:25:50 +0000 Subject: [Buildbot-commits] buildbot/buildbot master.py,1.110,1.111 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20589/buildbot Modified Files: master.py Log Message: [project @ more #138: prohibit builder names that start with an underscore] Original author: warner at lothar.com Date: 2007-11-21 09:18:03+00:00 Index: master.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v retrieving revision 1.110 retrieving revision 1.111 diff -u -d -r1.110 -r1.111 --- master.py 12 Aug 2007 23:17:12 -0000 1.110 +++ master.py 21 Nov 2007 09:25:48 -0000 1.111 @@ -29,7 +29,7 @@ from buildbot import interfaces ######################################## - + class BotMaster(service.MultiService): """This is the master-side service which manages remote buildbot slaves. @@ -503,6 +503,13 @@ # required schedulers = config['schedulers'] builders = config['builders'] + for k in builders: + if k['name'].startswith("_"): + errmsg = ("builder names must not start with an " + "underscore: " + k['name']) + log.err(errmsg) + raise ValueError(errmsg) + slavePortnum = config['slavePortnum'] #slaves = config['slaves'] #change_source = config['change_source'] From warner at users.sourceforge.net Wed Nov 21 09:25:50 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:25:50 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.990,1.991 NEWS,1.64,1.65 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20589 Modified Files: ChangeLog NEWS Log Message: [project @ more #138: prohibit builder names that start with an underscore] Original author: warner at lothar.com Date: 2007-11-21 09:18:03+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.990 retrieving revision 1.991 diff -u -d -r1.990 -r1.991 --- ChangeLog 21 Nov 2007 09:25:03 -0000 1.990 +++ ChangeLog 21 Nov 2007 09:25:48 -0000 1.991 @@ -1,5 +1,10 @@ 2007-11-21 Brian Warner + * buildbot/master.py (BuildMaster.loadConfig): builder names that + begin with an underscore are now reserved, so prohibit them from + appearing in the config file. + * NEWS: announce this change. + * buildbot/status/web/base.py: add buttons (to one_line_per_build and one_box_per_builder) to force/stop builds on all Builders at once. Index: NEWS =================================================================== RCS file: /cvsroot/buildbot/buildbot/NEWS,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- NEWS 1 Oct 2007 02:45:40 -0000 1.64 +++ NEWS 21 Nov 2007 09:25:48 -0000 1.65 @@ -1,5 +1,16 @@ User visible changes in Buildbot. -*- outline -*- +* Release 0.?.? (?) + +** Things You Need To Know + +*** builder names must not start with an underscore (`_'). + +These are now reserved for internal buildbot purposes, such as the magic +"_all" pseudo-builder that the web pages use to allow force-build buttons +that start builds on all Builders at once. + + * Release 0.7.6 (30 Sep 2007) ** Things You Need To Know From warner at users.sourceforge.net Wed Nov 21 09:26:36 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:26:36 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.991,1.992 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20972 Modified Files: ChangeLog Log Message: [project @ update ChangeLog a bit] Original author: warner at lothar.com Date: 2007-11-21 09:19:09+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.991 retrieving revision 1.992 diff -u -d -r1.991 -r1.992 --- ChangeLog 21 Nov 2007 09:25:48 -0000 1.991 +++ ChangeLog 21 Nov 2007 09:26:34 -0000 1.992 @@ -1,5 +1,8 @@ 2007-11-21 Brian Warner + * lots: a whole batch of patches from Benoit Sigoure, referenced + in ticket #138. Thanks! + * buildbot/master.py (BuildMaster.loadConfig): builder names that begin with an underscore are now reserved, so prohibit them from appearing in the config file. From warner at users.sourceforge.net Wed Nov 21 09:25:05 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:25:05 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web baseweb.py, 1.32, 1.33 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20344/buildbot/status/web Modified Files: baseweb.py Log Message: [project @ OneBoxPerBuilder: add links to the per-Builder page] Original author: warner at lothar.com Date: 2007-11-21 09:14:24+00:00 Index: baseweb.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/baseweb.py,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- baseweb.py 21 Nov 2007 09:24:18 -0000 1.32 +++ baseweb.py 21 Nov 2007 09:25:03 -0000 1.33 @@ -193,18 +193,18 @@ building = False online = 0 + base_builders_url = self.path_to_root(req) + "builders/" for bn in builders: + base_builder_url = base_builders_url + urllib.quote(bn, safe='') builder = status.getBuilder(bn) data += "\n" - data += '%s\n' % html.escape(bn) + data += '%s\n' \ + % (base_builder_url, html.escape(bn)) builds = list(builder.generateFinishedBuilds(map_branches(branches), num_builds=1)) if builds: b = builds[0] - url = (self.path_to_root(req) + - "builders/" + - urllib.quote(bn, safe='') + - "/builds/%d" % b.getNumber()) + url = (base_builder_url + "/builds/%d" % b.getNumber()) try: label = b.getProperty("got_revision") except KeyError: From warner at users.sourceforge.net Wed Nov 21 09:21:18 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:21:18 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web builder.py, 1.12, 1.13 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18873/buildbot/status/web Modified Files: builder.py Log Message: [project @ minor cleanup, from #138] Original author: warner at lothar.com Date: 2007-11-21 08:45:29+00:00 Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/builder.py,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- builder.py 1 Nov 2007 08:44:46 -0000 1.12 +++ builder.py 21 Nov 2007 09:21:16 -0000 1.13 @@ -157,9 +157,9 @@ if not re.match(r'^[\w\.\-\/]*$', revision): log.msg("bad revision '%s'" % revision) return Redirect("..") - if branch == "": + if not branch: branch = None - if revision == "": + if not revision: revision = None # TODO: if we can authenticate that a particular User pushed the From warner at users.sourceforge.net Wed Nov 21 09:22:51 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:22:51 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web build.py, 1.14, 1.15 builder.py, 1.14, 1.15 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19356/buildbot/status/web Modified Files: build.py builder.py Log Message: [project @ more #138: after force/stop/ping, redirect back to waterfall, not index page] Original author: warner at lothar.com Date: 2007-11-21 08:56:10+00:00 Index: build.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/build.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- build.py 10 Oct 2007 08:23:06 -0000 1.14 +++ build.py 21 Nov 2007 09:22:49 -0000 1.15 @@ -187,10 +187,10 @@ c.stopBuild(reason) # we're at http://localhost:8080/svn-hello/builds/5/stop?[args] and # we want to go to: http://localhost:8080/svn-hello/builds/5 or - # http://localhost:8080/ + # http://localhost:8080/waterfall # #return Redirect("../%d" % self.build.getNumber()) - r = Redirect("../../..") # TODO: no longer correct + r = Redirect("../../../../waterfall") d = defer.Deferred() reactor.callLater(1, d.callback, r) return DeferredResource(d) Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/builder.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- builder.py 21 Nov 2007 09:22:04 -0000 1.14 +++ builder.py 21 Nov 2007 09:22:49 -0000 1.15 @@ -181,12 +181,12 @@ # TODO: tell the web user that their request could not be # honored pass - return Redirect("../..") + return Redirect("../../waterfall") def ping(self, req): log.msg("web ping of builder '%s'" % self.builder_status.getName()) self.builder_control.ping() # TODO: there ought to be an ISlaveControl - return Redirect("../..") + return Redirect("../../waterfall") def getChild(self, path, req): if path == "force": From warner at users.sourceforge.net Wed Nov 21 09:21:18 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:21:18 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave bot.py,1.28,1.29 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18873/buildbot/slave Modified Files: bot.py Log Message: [project @ minor cleanup, from #138] Original author: warner at lothar.com Date: 2007-11-21 08:45:29+00:00 Index: bot.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/bot.py,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- bot.py 21 Nov 2007 09:20:31 -0000 1.28 +++ bot.py 21 Nov 2007 09:21:16 -0000 1.29 @@ -37,7 +37,7 @@ """ def __init__(self, builder): self.builder = builder - + class SlaveBuilder(pb.Referenceable, service.Service): """This is the local representation of a single Builder: it handles a @@ -134,7 +134,7 @@ self.remoteStep = None if self.stopCommandOnShutdown: self.stopCommand() - + # the following are Commands that can be invoked by the master-side # Builder def remote_startBuild(self): @@ -257,8 +257,8 @@ def remote_shutdown(self): print "slave shutting down on command from master" reactor.stop() - - + + class Bot(pb.Referenceable, service.MultiService): """I represent the slave-side bot.""" usePTY = None From warner at users.sourceforge.net Wed Nov 21 09:23:36 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 21 Nov 2007 09:23:36 +0000 Subject: [Buildbot-commits] buildbot/buildbot/status/web base.py, 1.20, 1.21 build.py, 1.15, 1.16 builder.py, 1.15, 1.16 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19774/buildbot/status/web Modified Files: base.py build.py builder.py Log Message: [project @ more #138: factor out force/stop-build form generation] Original author: warner at lothar.com Date: 2007-11-21 08:59:44+00:00 Index: base.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/base.py,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- base.py 1 Nov 2007 08:33:37 -0000 1.20 +++ base.py 21 Nov 2007 09:23:34 -0000 1.21 @@ -53,6 +53,32 @@ label = html.escape(label) return ROW_TEMPLATE % {"label": label, "field": field} +def make_stop_form(stopURL): + data = """ +

To stop this build, fill out the following fields and + click the 'Stop' button

\n""" % stopURL + data += make_row("Your name:", + "") + data += make_row("Reason for stopping build:", + "") + data += '\n' + return data + +def make_force_build_form(forceURL): + data = """
+

To force a build, fill out the following fields and + click the 'Force Build' button

""" % forceURL + return (data + + make_row("Your name:", + "") + + make_row("Reason for build:", + "") + + make_row("Branch to build:", + "") + + make_row("Revision to build:", + "") + + '
\n') + colormap = { 'green': '#72ff75', } @@ -149,7 +175,7 @@ if parms.has_key('show_idle'): del parms['show_idle'] self.show_idle = 1 - + self.parms = parms # parms is a dict of HTML parameters for the element that will # represent this Event in the waterfall display. Index: build.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/build.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- build.py 21 Nov 2007 09:22:49 -0000 1.15 +++ build.py 21 Nov 2007 09:23:34 -0000 1.16 @@ -5,8 +5,8 @@ import urllib, time from twisted.python import log -from buildbot.status.web.base import HtmlResource, make_row, css_classes, \ - path_to_builder +from buildbot.status.web.base import HtmlResource, make_row, make_stop_form, \ + css_classes, path_to_builder from buildbot.status.web.tests import TestsResource from buildbot.status.web.step import StepsResource @@ -48,17 +48,7 @@ if self.build_control is not None: stopURL = urllib.quote(req.childLink("stop")) - data += """ -
-

To stop this build, fill out the following fields and - push the 'Stop' button

\n""" % stopURL - data += make_row("Your name:", - "") - data += make_row("Reason for stopping build:", - "") - data += """ -
- """ + data += make_stop_form(stopURL) if b.isFinished(): results = b.getResults() Index: builder.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/builder.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- builder.py 21 Nov 2007 09:22:49 -0000 1.15 +++ builder.py 21 Nov 2007 09:23:34 -0000 1.16 @@ -6,7 +6,8 @@ import re, urllib, time from twisted.python import log from buildbot import interfaces -from buildbot.status.web.base import HtmlResource, make_row, OneLineMixin +from buildbot.status.web.base import HtmlResource, make_row, \ + make_force_build_form, OneLineMixin from buildbot.process.base import BuildRequest from buildbot.sourcestamp import SourceStamp @@ -106,23 +107,7 @@ if control is not None and connected_slaves: forceURL = urllib.quote(req.childLink("force")) - data += ( - """ -
-

To force a build, fill out the following fields and - push the 'Force Build' button

""" - + make_row("Your name:", - "") - + make_row("Reason for build:", - "") - + make_row("Branch to build:", - "") - + make_row("Revision to build:", - "") - + """ - -
- """) % {"forceURL": forceURL} + data += make_force_build_form(forceURL) elif control is not None: data += """

All buildslaves appear to be offline, so it's not possible From warner at users.sourceforge.net Thu Nov 22 00:20:15 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 22 Nov 2007 00:20:15 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_web.py,1.51,1.52 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17319/buildbot/test Modified Files: test_web.py Log Message: [project @ waterfall: fix DST calculation. Closes #137.] Original author: warner at lothar.com Date: 2007-11-22 00:18:06+00:00 Index: test_web.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_web.py,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- test_web.py 10 Oct 2007 08:32:59 -0000 1.51 +++ test_web.py 22 Nov 2007 00:20:12 -0000 1.52 @@ -232,7 +232,7 @@ self.failUnless(page) self.failUnlessIn("current activity", page) self.failUnlessIn(" Update of /cvsroot/buildbot/buildbot/buildbot/status/web In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17319/buildbot/status/web Modified Files: waterfall.py Log Message: [project @ waterfall: fix DST calculation. Closes #137.] Original author: warner at lothar.com Date: 2007-11-22 00:18:06+00:00 Index: waterfall.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/waterfall.py,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- waterfall.py 30 Sep 2007 21:16:41 -0000 1.25 +++ waterfall.py 22 Nov 2007 00:20:12 -0000 1.26 @@ -500,7 +500,7 @@ data += " \n" data += " \n" - TZ = time.tzname[time.daylight] + TZ = time.tzname[time.localtime()[-1]] data += td("time (%s)" % TZ, align="center", class_="Time") data += td('changes' % request.childLink("../changes"), align="center", class_="Change") From warner at users.sourceforge.net Thu Nov 22 00:20:14 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 22 Nov 2007 00:20:14 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.992,1.993 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17319 Modified Files: ChangeLog Log Message: [project @ waterfall: fix DST calculation. Closes #137.] Original author: warner at lothar.com Date: 2007-11-22 00:18:06+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.992 retrieving revision 1.993 diff -u -d -r1.992 -r1.993 --- ChangeLog 21 Nov 2007 09:26:34 -0000 1.992 +++ ChangeLog 22 Nov 2007 00:20:12 -0000 1.993 @@ -1,5 +1,12 @@ 2007-11-21 Brian Warner + * buildbot/status/web/waterfall.py (WaterfallStatusResource.body): + fix timezone calculation, we were always emitting DST, even in + winter. Thanks to Charles Lepple and John Saxton for the patch. + Closes #137. + * buildbot/test/test_web.py (Waterfall.test_waterfall._check1): same + + * lots: a whole batch of patches from Benoit Sigoure, referenced in ticket #138. Thanks! From warner at users.sourceforge.net Thu Nov 22 00:26:34 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 22 Nov 2007 00:26:34 +0000 Subject: [Buildbot-commits] buildbot/buildbot/changes p4poller.py, 1.11, 1.12 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/changes In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19609/buildbot/changes Modified Files: p4poller.py Log Message: [project @ p4poller: keep polling even after a single failure. Closes #135.] Original author: warner at lothar.com Date: 2007-11-22 00:24:51+00:00 Index: p4poller.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/p4poller.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- p4poller.py 17 Apr 2007 06:38:50 -0000 1.11 +++ p4poller.py 22 Nov 2007 00:26:32 -0000 1.12 @@ -111,6 +111,7 @@ # If there's a failure, log it so it isn't lost. if isinstance(res, failure.Failure): log.msg('P4 poll failed: %s' % res) + return None return res def _get_changes(self): From warner at users.sourceforge.net Thu Nov 22 00:26:34 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 22 Nov 2007 00:26:34 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.993,1.994 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19609 Modified Files: ChangeLog Log Message: [project @ p4poller: keep polling even after a single failure. Closes #135.] Original author: warner at lothar.com Date: 2007-11-22 00:24:51+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.993 retrieving revision 1.994 diff -u -d -r1.993 -r1.994 --- ChangeLog 22 Nov 2007 00:20:12 -0000 1.993 +++ ChangeLog 22 Nov 2007 00:26:32 -0000 1.994 @@ -1,5 +1,9 @@ 2007-11-21 Brian Warner + * buildbot/changes/p4poller.py (P4Source._finished): don't let a + failure cause us to stop polling. Thanks to John Backstrand for + the patch. Closes #135. + * buildbot/status/web/waterfall.py (WaterfallStatusResource.body): fix timezone calculation, we were always emitting DST, even in winter. Thanks to Charles Lepple and John Saxton for the patch. From warner at users.sourceforge.net Thu Nov 22 01:04:36 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 22 Nov 2007 01:04:36 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.995,1.996 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32481 Modified Files: ChangeLog 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: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.995 retrieving revision 1.996 diff -u -d -r1.995 -r1.996 --- ChangeLog 22 Nov 2007 01:04:26 -0000 1.995 +++ ChangeLog 22 Nov 2007 01:04:33 -0000 1.996 @@ -1,5 +1,20 @@ 2007-11-21 Brian Warner + * lots: improve Git support, AMAZING patch from Haavard + Skinnemoen, complete with unit tests and docs, thanks! Closes #130. + * buildbot/scripts/tryclient.py (GitExtractor): add 'try' support + * buildbot/slave/commands.py (Git): accept branch and revisions, + and use 'git' instead of the 'cogito' wrapper + * buildbot/steps/source.py (Git.__init__): same + * buildbot/test/test_vc.py (BaseHelper.runCommand): offer control + over env= + (BaseHelper.do): same + (BaseHelper.dovc): same + (Git): unit tests for Git support. Wow! + * docs/buildbot.texinfo (Git): docs for Git support. Double Wow! + * contrib/git_buildbot.py: commit-hook script for git + + * buildbot/changes/p4poller.py (P4Source._finished): don't let a failure cause us to stop polling. Thanks to John Backstrand for the patch. Closes #135. From warner at users.sourceforge.net Thu Nov 22 01:04:35 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 22 Nov 2007 01:04:35 +0000 Subject: [Buildbot-commits] buildbot/contrib git_buildbot.py,NONE,1.1 Message-ID: Update of /cvsroot/buildbot/buildbot/contrib In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32481/contrib Added Files: git_buildbot.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 --- NEW FILE: git_buildbot.py --- #! /usr/bin/env python # This script is meant to run from hooks/post-receive in the git # repository. It expects one line for each new revision on the form # # # For example: # aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master # # Each of these changes will be passed to the buildbot server along # with any other change information we manage to extract from the # repository. # # Largely based on contrib/hooks/post-receive-email from git. import commands, logging, os, re, sys from twisted.spread import pb from twisted.cred import credentials from twisted.internet import reactor from buildbot.scripts import runner from optparse import OptionParser # Modify this to fit your setup master = "localhost:9989" # The GIT_DIR environment variable must have been set up so that any # git commands that are executed will operate on the repository we're # installed in. changes = [] def connectFailed(error): logging.error("Could not connect to %s: %s" % (master, error.getErrorMessage())) return error def addChange(dummy, remote, changei): logging.debug("addChange %s, %s" % (repr(remote), repr(changei))) try: c = changei.next() except StopIteration: remote.broker.transport.loseConnection() return None logging.info("New revision: %s" % c['revision'][:8]) for key, value in c.iteritems(): logging.debug(" %s: %s" % (key, value)) d = remote.callRemote('addChange', c) d.addCallback(addChange, remote, changei) return d def connected(remote): return addChange(None, remote, changes.__iter__()) def grab_commit_info(c, rev): # Extract information about committer and files using git-show f = os.popen("git-show --raw --pretty=full %s" % rev, 'r') files = [] while True: line = f.readline() if not line: break m = re.match(r"^:.*[MAD]\s+(.+)$", line) if m: logging.debug("Got file: %s" % m.group(1)) files.append(m.group(1)) continue m = re.match(r"^Commit:\s+(.+)$", line) if m: logging.debug("Got committer: %s" % m.group(1)) c['who'] = m.group(1) c['files'] = files status = f.close() if status: logging.warning("git-show exited with status %d" % status) def gen_changes(input, branch): while True: line = input.readline() if not line: break logging.debug("Change: %s" % line) m = re.match(r"^([0-9a-f]+) (.*)$", line.strip()) c = { 'revision': m.group(1), 'comments': m.group(2), 'branch': branch } grab_commit_info(c, m.group(1)) changes.append(c) def gen_create_branch_changes(newrev, refname, branch): # A new branch has been created. Generate changes for everything # up to `newrev' which does not exist in any branch but `refname'. # # Note that this may be inaccurate if two new branches are created # at the same time, pointing to the same commit, or if there are # commits that only exists in a common subset of the new branches. logging.info("Branch `%s' created" % branch) f = os.popen("git-rev-parse --not --branches" + "| grep -v $(git-rev-parse %s)" % refname + "| git-rev-list --reverse --pretty=oneline --stdin %s" % newrev, 'r') gen_changes(f, branch) status = f.close() if status: logging.warning("git-rev-list exited with status %d" % status) def gen_update_branch_changes(oldrev, newrev, refname, branch): # A branch has been updated. If it was a fast-forward update, # generate Change events for everything between oldrev and newrev. # # In case of a forced update, first generate a "fake" Change event # rewinding the branch to the common ancestor of oldrev and # newrev. Then, generate Change events for each commit between the # common ancestor and newrev. logging.info("Branch `%s' updated %s .. %s" % (branch, oldrev[:8], newrev[:8])) baserev = commands.getoutput("git-merge-base %s %s" % (oldrev, newrev)) logging.debug("oldrev=%s newrev=%s baserev=%s" % (oldrev, newrev, baserev)) if baserev != oldrev: c = { 'revision': baserev, 'comments': "Rewind branch", 'branch': branch, 'who': "dummy" } logging.info("Branch %s was rewound to %s" % (branch, baserev[:8])) files = [] f = os.popen("git-diff --raw %s..%s" % (oldrev, baserev), 'r') while True: line = f.readline() if not line: break file = re.match(r"^:.*[MAD]\s*(.+)$", line).group(1) logging.debug(" Rewound file: %s" % file) files.append(file) status = f.close() if status: logging.warning("git-diff exited with status %d" % status) if files: c['files'] = files changes.append(c) if newrev != baserev: # Not a pure rewind f = os.popen("git-rev-list --reverse --pretty=oneline %s..%s" % (baserev, newrev), 'r') gen_changes(f, branch) status = f.close() if status: logging.warning("git-rev-list exited with status %d" % status) def cleanup(res): reactor.stop() def process_changes(): # Read branch updates from stdin and generate Change events while True: line = sys.stdin.readline() if not line: break [oldrev, newrev, refname] = line.split(None, 2) # We only care about regular heads, i.e. branches m = re.match(r"^refs\/heads\/(.+)$", refname) if not m: logging.info("Ignoring refname `%s': Not a branch" % refname) continue branch = m.group(1) # Find out if the branch was created, deleted or updated. Branches # being deleted aren't really interesting. if re.match(r"^0*$", newrev): logging.info("Branch `%s' deleted, ignoring" % branch) continue elif re.match(r"^0*$", oldrev): gen_create_branch_changes(newrev, refname, branch) else: gen_update_branch_changes(oldrev, newrev, refname, branch) # Submit the changes, if any if not changes: logging.warning("No changes found") return host, port = master.split(':') port = int(port) f = pb.PBClientFactory() d = f.login(credentials.UsernamePassword("change", "changepw")) reactor.connectTCP(host, port, f) d.addErrback(connectFailed) d.addCallback(connected) d.addBoth(cleanup) reactor.run() def parse_options(): parser = OptionParser() parser.add_option("-l", "--logfile", action="store", type="string", help="Log to the specified file") parser.add_option("-v", "--verbose", action="count", help="Be more verbose. Ignored if -l is not specified.") options, args = parser.parse_args() return options # Log errors and critical messages to stderr. Optionally log # information to a file as well (we'll set that up later.) stderr = logging.StreamHandler(sys.stderr) fmt = logging.Formatter("git_buildbot: %(levelname)s: %(message)s") stderr.setLevel(logging.ERROR) stderr.setFormatter(fmt) logging.getLogger().addHandler(stderr) logging.getLogger().setLevel(logging.DEBUG) try: options = parse_options() level = logging.WARNING if options.verbose: level -= 10 * options.verbose if level < 0: level = 0 if options.logfile: logfile = logging.FileHandler(options.logfile) logfile.setLevel(level) fmt = logging.Formatter("%(asctime)s %(levelname)s: %(message)s") logfile.setFormatter(fmt) logging.getLogger().addHandler(logfile) process_changes() except: logging.exception("Unhandled exception") sys.exit(1) From warner at users.sourceforge.net Thu Nov 22 01:04:36 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 22 Nov 2007 01:04:36 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_vc.py,1.78,1.79 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32481/buildbot/test Modified Files: test_vc.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: test_vc.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 --- test_vc.py 7 Aug 2007 19:21:40 -0000 1.78 +++ test_vc.py 22 Nov 2007 01:04:34 -0000 1.79 @@ -342,7 +342,8 @@ self.branch.append(rev) self.allrevs.append(rev) - def runCommand(self, basedir, command, failureIsOk=False, stdin=None): + def runCommand(self, basedir, command, failureIsOk=False, + stdin=None, env=None): # all commands passed to do() should be strings or lists. If they are # strings, none of the arguments may have spaces. This makes the # commands less verbose at the expense of restricting what they can @@ -355,7 +356,9 @@ print " in basedir %s" % basedir if stdin: print " STDIN:\n", stdin, "\n--STDIN DONE" - env = os.environ.copy() + + if not env: + env = os.environ.copy() env['LC_ALL'] = "C" d = myGetProcessOutputAndValue(command[0], command[1:], env=env, path=basedir, @@ -379,19 +382,19 @@ d.addCallback(check) return d - def do(self, basedir, command, failureIsOk=False, stdin=None): + def do(self, basedir, command, failureIsOk=False, stdin=None, env=None): d = self.runCommand(basedir, command, failureIsOk=failureIsOk, - stdin=stdin) + stdin=stdin, env=env) return waitForDeferred(d) - def dovc(self, basedir, command, failureIsOk=False, stdin=None): + def dovc(self, basedir, command, failureIsOk=False, stdin=None, env=None): """Like do(), but the VC binary will be prepended to COMMAND.""" if isinstance(command, (str, unicode)): command = self.vcexe + " " + command else: # command is a list command = [self.vcexe] + command - return self.do(basedir, command, failureIsOk, stdin) + return self.do(basedir, command, failureIsOk, stdin, env) class VCBase(SignalMixin): metadir = None @@ -2466,6 +2469,136 @@ VCS.registerVC(Mercurial.vc_name, MercurialHelper()) +class GitHelper(BaseHelper): + branchname = "branch" + try_branchname = "branch" + + def capable(self): + gitpaths = which('git') + if gitpaths: + self.vcexe = gitpaths[0] + return (True, None) + return (False, "GIT is not installed") + + def createRepository(self): + self.createBasedir() + self.gitrepo = os.path.join(self.repbase, + "GIT-Repository") + tmp = os.path.join(self.repbase, "gittmp") + + env = os.environ.copy() + env['GIT_DIR'] = self.gitrepo + w = self.dovc(self.repbase, "init", env=env) + yield w; w.getResult() + + self.populate(tmp) + w = self.dovc(tmp, "init") + yield w; w.getResult() + w = self.dovc(tmp, ["add", "."]) + yield w; w.getResult() + w = self.dovc(tmp, ["commit", "-m", "initial_import"]) + yield w; w.getResult() + + w = self.dovc(tmp, ["checkout", "-b", self.branchname]) + yield w; w.getResult() + self.populate_branch(tmp) + w = self.dovc(tmp, ["commit", "-a", "-m", "commit_on_branch"]) + yield w; w.getResult() + + w = self.dovc(tmp, ["rev-parse", "master", self.branchname]) + yield w; out = w.getResult() + revs = out.splitlines() + self.addTrunkRev(revs[0]) + self.addBranchRev(revs[1]) + + w = self.dovc(tmp, ["push", self.gitrepo, "master", self.branchname]) + yield w; w.getResult() + + rmdirRecursive(tmp) + createRepository = deferredGenerator(createRepository) + + def vc_revise(self): + tmp = os.path.join(self.repbase, "gittmp") + rmdirRecursive(tmp) + log.msg("vc_revise" + self.gitrepo) + w = self.dovc(self.repbase, ["clone", self.gitrepo, "gittmp"]) + yield w; w.getResult() + + self.version += 1 + version_c = VERSION_C % self.version + open(os.path.join(tmp, "version.c"), "w").write(version_c) + + w = self.dovc(tmp, ["commit", "-m", "revised_to_%d" % self.version, + "version.c"]) + yield w; w.getResult() + w = self.dovc(tmp, ["rev-parse", "master"]) + yield w; out = w.getResult() + self.addTrunkRev(out.strip()) + + w = self.dovc(tmp, ["push", self.gitrepo, "master"]) + yield w; out = w.getResult() + rmdirRecursive(tmp) + vc_revise = deferredGenerator(vc_revise) + + def vc_try_checkout(self, workdir, rev, branch=None): + assert os.path.abspath(workdir) == workdir + if os.path.exists(workdir): + rmdirRecursive(workdir) + + w = self.dovc(self.repbase, ["clone", self.gitrepo, workdir]) + yield w; w.getResult() + + if branch is not None: + w = self.dovc(workdir, ["checkout", "-b", branch, + "origin/%s" % branch]) + yield w; w.getResult() + + # Hmm...why do nobody else bother to check out the correct + # revision? + w = self.dovc(workdir, ["reset", "--hard", rev]) + yield w; w.getResult() + + try_c_filename = os.path.join(workdir, "subdir", "subdir.c") + open(try_c_filename, "w").write(TRY_C) + vc_try_checkout = deferredGenerator(vc_try_checkout) + + def vc_try_finish(self, workdir): + rmdirRecursive(workdir) + +class Git(VCBase, unittest.TestCase): + vc_name = "git" + + # No 'export' mode yet... + # metadir = ".git" + vctype = "source.Git" + vctype_try = "git" + has_got_revision = True + + def testCheckout(self): + self.helper.vcargs = { 'repourl': self.helper.gitrepo } + d = self.do_vctest() + return d + + def testPatch(self): + self.helper.vcargs = { 'repourl': self.helper.gitrepo, + 'branch': "master" } + d = self.do_patch() + return d + + def testCheckoutBranch(self): + self.helper.vcargs = { 'repourl': self.helper.gitrepo, + 'branch': "master" } + d = self.do_branch() + return d + + def testTry(self): + self.helper.vcargs = { 'repourl': self.helper.gitrepo, + 'branch': "master" } + d = self.do_getpatch() + return d + +VCS.registerVC(Git.vc_name, GitHelper()) + class Sources(unittest.TestCase): # TODO: this needs serious rethink From warner at users.sourceforge.net Thu Nov 22 01:04:36 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 22 Nov 2007 01:04:36 +0000 Subject: [Buildbot-commits] buildbot/buildbot/scripts tryclient.py, 1.19, 1.20 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/scripts In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32481/buildbot/scripts Modified Files: tryclient.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: tryclient.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/tryclient.py,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- tryclient.py 6 Feb 2007 20:36:09 -0000 1.19 +++ tryclient.py 22 Nov 2007 01:04:34 -0000 1.20 @@ -203,6 +203,32 @@ d.addCallback(self.readPatch, self.patchlevel) return d +class GitExtractor(SourceStampExtractor): + patchlevel = 1 + vcexe = "git" + + def getBaseRevision(self): + d = self.dovc(["branch", "--no-color", "-v", "--no-abbrev"]) + d.addCallback(self.parseStatus) + return d + + def parseStatus(self, res): + # The current branch is marked by '*' at the start of the + # line, followed by the branch name and the SHA1. + # + # Branch names may contain pretty much anything but whitespace. + m = re.search(r'^\* (\S+)\s+([0-9a-f]{40})', res, re.MULTILINE) + if m: + self.branch = m.group(1) + self.baserev = m.group(2) + return + raise IndexError("Could not find current GIT branch: %s" % res) + + def getPatch(self, res): + d = self.dovc(["diff", self.baserev]) + d.addCallback(self.readPatch, self.patchlevel) + return d + def getSourceStamp(vctype, treetop, branch=None): if vctype == "cvs": e = CVSExtractor(treetop, branch) @@ -218,6 +244,8 @@ e = MercurialExtractor(treetop, branch) elif vctype == "darcs": e = DarcsExtractor(treetop, branch) + elif vctype == "git": + e = GitExtractor(treetop, branch) else: raise KeyError("unknown vctype '%s'" % vctype) return e.get() From warner at users.sourceforge.net Thu Nov 22 01:04:36 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 22 Nov 2007 01:04:36 +0000 Subject: [Buildbot-commits] buildbot/docs buildbot.texinfo,1.127,1.128 Message-ID: Update of /cvsroot/buildbot/buildbot/docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32481/docs Modified Files: buildbot.texinfo 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: buildbot.texinfo =================================================================== RCS file: /cvsroot/buildbot/buildbot/docs/buildbot.texinfo,v retrieving revision 1.127 retrieving revision 1.128 diff -u -d -r1.127 -r1.128 --- buildbot.texinfo 10 Oct 2007 08:15:30 -0000 1.127 +++ buildbot.texinfo 22 Nov 2007 01:04:34 -0000 1.128 @@ -196,6 +196,7 @@ * Bazaar:: * Bzr:: * P4:: +* Git:: Simple ShellCommand Subclasses @@ -1268,9 +1269,9 @@ systems provide more complexity than this: in particular the local views that P4 and ClearCase can assemble out of various source directories are more complex than we're prepared to take advantage of -here}. The SHA1 revision ID used by Monotone and Mercurial is also a -kind of revision stamp, in that it specifies a unique copy of the -source tree, as does a Darcs ``context'' file. +here}. The SHA1 revision ID used by Monotone, Mercurial, and Git is +also a kind of revision stamp, in that it specifies a unique copy of +the source tree, as does a Darcs ``context'' file. When we aren't intending to make any changes to the sources we check out (at least not any that need to be committed back upstream), there are two @@ -1468,6 +1469,16 @@ same way as with Darcs. The ``revision'', however, is the hash identifier returned by @command{hg identify}. + at uref{http://git.or.cz/, Git} also follows a decentralized model, and +each repository can have several branches and tags. The source Step is +configured with a static @code{repourl} which specifies the location +of the repository. In addition, an optional @code{branch} parameter +can be specified to check out code from a specific branch instead of +the default ``master'' branch. The ``revision'' is specified as a SHA1 +hash as returned by e.g. @command{git rev-parse}. No attempt is made +to ensure that the specified revision is actually a subset of the +specified branch. + @node Attributes of Changes, , How Different VC Systems Specify Sources, Version Control Systems @subsection Attributes of Changes @@ -1526,6 +1537,9 @@ @code{revision} is the full revision ID (ending in --patch-%d) @item P4 @code{revision} is an int, the transaction number + at item Git + at code{revision} is a short string (a SHA1 hash), the output of e.g. + at code{git rev-parse} @end table @heading Branches @@ -1534,14 +1548,15 @@ that all of the Change's files are in the same named branch. The Schedulers get to decide whether the branch should be built or not. -For VC systems like CVS, Arch, and Monotone, the @code{branch} name is -unrelated to the filename. (that is, the branch name and the filename -inhabit unrelated namespaces). For SVN, branches are expressed as -subdirectories of the repository, so the file's ``svnurl'' is a -combination of some base URL, the branch name, and the filename within -the branch. (In a sense, the branch name and the filename inhabit the -same namespace). Darcs branches are subdirectories of a base URL just -like SVN. Mercurial branches are the same as Darcs. +For VC systems like CVS, Arch, Monotone, and Git, the @code{branch} +name is unrelated to the filename. (that is, the branch name and the +filename inhabit unrelated namespaces). For SVN, branches are +expressed as subdirectories of the repository, so the file's +``svnurl'' is a combination of some base URL, the branch name, and the +filename within the branch. (In a sense, the branch name and the +filename inhabit the same namespace). Darcs branches are +subdirectories of a base URL just like SVN. Mercurial branches are the +same as Darcs. @table @samp @item CVS @@ -1554,6 +1569,8 @@ branch='warner-newfeature', files=['src/foo.c'] @item Arch/Bazaar branch='buildbot--usebranches--0', files=['buildbot/master.py'] + at item Git +branch='warner-newfeature', files=['src/foo.c'] @end table @heading Links @@ -2716,6 +2733,12 @@ @code{contrib/arch_buildbot.py} run in a commit hook) @end itemize + at item Git + at itemize @bullet + at item pb.PBChangeSource (listening for connections from + at code{contrib/git_buildbot.py} run in the post-receive hook) + at end itemize + @end table All VC systems can be driven by a PBChangeSource and the @@ -2965,6 +2988,12 @@ http://www.selenic.com/mercurial/wiki/index.cgi/NotifyExtension @end table + at item Git + at table @samp + at item post-receive-email +http://git.kernel.org/?p=git/git.git;a=blob;f=contrib/hooks/post-receive-email;hb=HEAD + at end table + @end table @@ -3801,6 +3830,7 @@ * Bazaar:: * Bzr:: * P4:: +* Git:: @end menu @node CVS, SVN, Source Checkout, Source Checkout @@ -4134,7 +4164,7 @@ - at node P4, , Bzr, Source Checkout + at node P4, Git, Bzr, Source Checkout @subsubsection P4 @cindex Perforce Update @@ -4175,6 +4205,29 @@ builder name. The default is "buildbot_%(slave)s_%(build)s". @end table + at node Git, , P4, Source Checkout + at subsubsection Git + + at cindex Git Checkout + at bsindex buildbot.steps.source.Git + + +The @code{Git} build step clones or updates a @uref{http://git.or.cz/, +Git} repository and checks out the specified branch or revision. + +The Git step takes the following arguments: + + at table @code + at item repourl +(required): the URL of the upstream Git repository. + + at item branch +(optional): this specifies the name of the branch to use when a Build +does not provide one of its own. If this this parameter is not +specified, and the Build does not provide a branch, the ``master'' +branch will be used. + at end table + @node ShellCommand, Simple ShellCommand Subclasses, Source Checkout, Build Steps @subsection ShellCommand @@ -6914,7 +6967,7 @@ @code{try_topfile} approach instead. Other VC systems which work on full projects instead of individual -directories (tla, baz, darcs, monotone, mercurial) do not require +directories (tla, baz, darcs, monotone, mercurial, git) do not require @command{try} to know the top directory, so the @option{--try-topfile} and @option{--try-topdir} arguments will be ignored. @c is this true? I think I currently require topdirs all the time. @@ -6993,7 +7046,20 @@ have patches that are available from the same remotely-available repository that the build process' @code{step.Mercurial} will use. - at c TODO: monotone, git + at item Git + at code{git branch -v} lists all the branches available in the local +repository along with the revision ID it points to and a short summary +of the last commit. The line containing the currently checked out +branch begins with '* ' (star and space) while all the others start +with ' ' (two spaces). @command{try} scans for this line and extracts +the branch name and revision from it. Then it generates a diff against +the base revision. + at c TODO: I'm not sure if this actually works the way it's intended + at c since the extracted base revision might not actually exist in the + at c upstream repository. Perhaps we need to add a --remote option to + at c specify the remote tracking branch to generate a diff against. + + at c TODO: monotone @end table @heading waiting for results From warner at users.sourceforge.net Thu Nov 22 01:04:28 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 22 Nov 2007 01:04:28 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.994,1.995 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32459 Modified Files: ChangeLog Log Message: [project @ test_p4poller.py: update test to match ignore-failures change in #135] Original author: warner at lothar.com Date: 2007-11-22 01:03:07+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.994 retrieving revision 1.995 diff -u -d -r1.994 -r1.995 --- ChangeLog 22 Nov 2007 00:26:32 -0000 1.994 +++ ChangeLog 22 Nov 2007 01:04:26 -0000 1.995 @@ -3,6 +3,9 @@ * buildbot/changes/p4poller.py (P4Source._finished): don't let a failure cause us to stop polling. Thanks to John Backstrand for the patch. Closes #135. + * buildbot/test/test_p4poller.py (TestP4Poller.testFailedChanges): + change this to match + (TestP4Poller.testFailedDescribe): same * buildbot/status/web/waterfall.py (WaterfallStatusResource.body): fix timezone calculation, we were always emitting DST, even in From warner at users.sourceforge.net Thu Nov 22 01:04:28 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 22 Nov 2007 01:04:28 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_p4poller.py, 1.7, 1.8 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32459/buildbot/test Modified Files: test_p4poller.py Log Message: [project @ test_p4poller.py: update test to match ignore-failures change in #135] Original author: warner at lothar.com Date: 2007-11-22 01:03:07+00:00 Index: test_p4poller.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_p4poller.py,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- test_p4poller.py 17 Apr 2007 06:38:51 -0000 1.7 +++ test_p4poller.py 22 Nov 2007 01:04:26 -0000 1.8 @@ -153,22 +153,21 @@ return when def testFailedChanges(self): - """'p4 changes' failure is properly reported""" + """'p4 changes' failure is properly ignored""" self.t = MockP4Source(p4changes=['Perforce client error:\n...'], p4change={}, p4port=None, p4user=None) self.t.parent = self d = self.t.checkp4() - d.addBoth(self._testFailedChanges2) + d.addCallback(self._testFailedChanges2) return d def _testFailedChanges2(self, f): - self.assert_(isinstance(f, failure.Failure)) - self.failUnlessIn('Perforce client error', str(f)) + self.failUnlessEqual(f, None) self.assert_(not self.t.working) def testFailedDescribe(self): - """'p4 describe' failure is properly reported""" + """'p4 describe' failure is properly ignored""" c = dict(p4change) c[3] = 'Perforce client error:\n...' self.t = MockP4Source(p4changes=[first_p4changes, second_p4changes], @@ -180,11 +179,10 @@ def _testFailedDescribe2(self, res): # first time finds nothing; check again. - return self.t.checkp4().addBoth(self._testFailedDescribe3) + return self.t.checkp4().addCallback(self._testFailedDescribe3) def _testFailedDescribe3(self, f): - self.assert_(isinstance(f, failure.Failure)) - self.failUnlessIn('Perforce client error', str(f)) + self.failUnlessEqual(f, None) self.assert_(not self.t.working) self.assertEquals(self.t.last_change, 2) From warner at users.sourceforge.net Thu Nov 22 01:04:36 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 22 Nov 2007 01:04:36 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.85,1.86 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32481/buildbot/slave Modified Files: commands.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: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- commands.py 30 Sep 2007 07:24:40 -0000 1.85 +++ commands.py 22 Nov 2007 01:04:34 -0000 1.86 @@ -15,7 +15,7 @@ # this used to be a CVS $-style "Revision" auto-updated keyword, but since I # moved to Darcs as the primary repository, this is updated manually each # time this file is changed. The last cvs_ver that was here was 1.51 . -command_version = "2.3" +command_version = "2.4" # version history: # >=1.17: commands are interruptable @@ -35,6 +35,7 @@ # (release 0.7.4) # >= 2.2: added monotone, uploadFile, and downloadFile (release 0.7.5) # >= 2.3: added bzr +# >= 2.4: Git understands 'revision' and branches class CommandInterrupted(Exception): pass @@ -707,7 +708,7 @@ self.rc = 0 def start(self): - if self.debug: + if self.debug: log.msg('SlaveFileUploadCommand started') # Open file @@ -819,7 +820,7 @@ self.rc = 0 def start(self): - if self.debug: + if self.debug: log.msg('SlaveFileDownloadCommand starting') # Open file @@ -1718,7 +1719,9 @@ """Git specific VC operation. In addition to the arguments handled by SourceBase, this command reads the following keys: - ['repourl'] (required): the Cogito repository string + ['repourl'] (required): the upstream GIT repository string + ['branch'] (optional): which version (i.e. branch or tag) to + retrieve. Default: "master". """ header = "git operation" @@ -1726,31 +1729,75 @@ def setup(self, args): SourceBase.setup(self, args) self.repourl = args['repourl'] - #self.sourcedata = "" # TODO + self.branch = args.get('branch') + if not self.branch: + self.branch = "master" + self.sourcedata = "%s %s\n" % (self.repourl, self.branch) + + def _fullSrcdir(self): + return os.path.join(self.builder.basedir, self.srcdir) + + def _commitSpec(self): + if self.revision: + return self.revision + return self.branch def sourcedirIsUpdateable(self): - if os.path.exists(os.path.join(self.builder.basedir, - self.srcdir, ".buildbot-patched")): + if os.path.exists(os.path.join(self._fullSrcdir(), + ".buildbot-patched")): return False - return os.path.isdir(os.path.join(self.builder.basedir, - self.srcdir, ".git")) + return os.path.isdir(os.path.join(self._fullSrcdir(), ".git")) - def doVCUpdate(self): - d = os.path.join(self.builder.basedir, self.srcdir) - command = ['cg-update'] - c = ShellCommand(self.builder, command, d, + def _didFetch(self, res): + if self.revision: + head = self.revision + else: + head = 'FETCH_HEAD' + + command = ['git-reset', '--hard', head] + c = ShellCommand(self.builder, command, self._fullSrcdir(), sendRC=False, timeout=self.timeout) self.command = c return c.start() + def doVCUpdate(self): + command = ['git-fetch', self.repourl, self.branch] + self.sendStatus({"header": "fetching branch %s from %s\n" + % (self.branch, self.repourl)}) + c = ShellCommand(self.builder, command, self._fullSrcdir(), + sendRC=False, timeout=self.timeout) + self.command = c + d = c.start() + d.addCallback(self._abandonOnFailure) + d.addCallback(self._didFetch) + return d + + def _didInit(self, res): + return self.doVCUpdate() + def doVCFull(self): - d = os.path.join(self.builder.basedir, self.srcdir) - os.mkdir(d) - command = ['cg-clone', '-s', self.repourl] - c = ShellCommand(self.builder, command, d, + os.mkdir(self._fullSrcdir()) + c = ShellCommand(self.builder, ['git-init'], self._fullSrcdir(), sendRC=False, timeout=self.timeout) self.command = c - return c.start() + d = c.start() + d.addCallback(self._abandonOnFailure) + d.addCallback(self._didInit) + return d + + def parseGotRevision(self): + command = ['git-rev-parse', 'HEAD'] + c = ShellCommand(self.builder, command, self._fullSrcdir(), + sendRC=False, keepStdout=True) + c.usePTY = False + d = c.start() + def _parse(res): + hash = c.stdout.strip() + if len(hash) != 40: + return None + return hash + d.addCallback(_parse) + return d registerSlaveCommand("git", Git, command_version) From warner at users.sourceforge.net Thu Nov 22 01:04:36 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 22 Nov 2007 01:04:36 +0000 Subject: [Buildbot-commits] buildbot/buildbot/steps source.py,1.9,1.10 Message-ID: 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 From warner at users.sourceforge.net Wed Nov 28 01:37:07 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 28 Nov 2007 01:37:07 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.996,1.997 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25927 Modified Files: ChangeLog Log Message: [project @ test_vc.Git: use 'git init-db' instead of 'git init' to accomodate older versions of git] Original author: warner at lothar.com Date: 2007-11-28 01:36:14+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.996 retrieving revision 1.997 diff -u -d -r1.996 -r1.997 --- ChangeLog 22 Nov 2007 01:04:33 -0000 1.996 +++ ChangeLog 28 Nov 2007 01:37:05 -0000 1.997 @@ -1,3 +1,10 @@ +2007-11-27 Brian Warner + + * buildbot/test/test_vc.py (GitHelper.createRepository): use 'git + init-db' instead of 'git init', since older versions of git (such + as the one that shipped with Dapper) don't know about the newer + alias. + 2007-11-21 Brian Warner * lots: improve Git support, AMAZING patch from Haavard From warner at users.sourceforge.net Wed Nov 28 01:37:08 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 28 Nov 2007 01:37:08 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_vc.py,1.79,1.80 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25927/buildbot/test Modified Files: test_vc.py Log Message: [project @ test_vc.Git: use 'git init-db' instead of 'git init' to accomodate older versions of git] Original author: warner at lothar.com Date: 2007-11-28 01:36:14+00:00 Index: test_vc.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- test_vc.py 22 Nov 2007 01:04:34 -0000 1.79 +++ test_vc.py 28 Nov 2007 01:37:05 -0000 1.80 @@ -2488,11 +2488,11 @@ env = os.environ.copy() env['GIT_DIR'] = self.gitrepo - w = self.dovc(self.repbase, "init", env=env) + w = self.dovc(self.repbase, "init-db", env=env) yield w; w.getResult() self.populate(tmp) - w = self.dovc(tmp, "init") + w = self.dovc(tmp, "init-db") yield w; w.getResult() w = self.dovc(tmp, ["add", "."]) yield w; w.getResult() From warner at users.sourceforge.net Wed Nov 28 02:10:48 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 28 Nov 2007 02:10:48 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_vc.py,1.80,1.81 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6325/buildbot/test Modified Files: test_vc.py Log Message: [project @ test_vc.Git: skip git tests when Git is older than 1.2.x, since 1.1.3 fails] Original author: warner at lothar.com Date: 2007-11-28 02:09:02+00:00 Index: test_vc.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v retrieving revision 1.80 retrieving revision 1.81 diff -u -d -r1.80 -r1.81 --- test_vc.py 28 Nov 2007 01:37:05 -0000 1.80 +++ test_vc.py 28 Nov 2007 02:10:46 -0000 1.81 @@ -2475,10 +2475,33 @@ def capable(self): gitpaths = which('git') - if gitpaths: - self.vcexe = gitpaths[0] - return (True, None) - return (False, "GIT is not installed") + if not gitpaths: + return (False, "GIT is not installed") + d = utils.getProcessOutput(gitpaths[0], ["--version"], env=os.environ) + d.addCallback(self._capable, gitpaths[0]) + return d + + def _capable(self, v, vcexe): + m = re.search(r'\b([\d\.]+)\b', v) + if not m: + log.msg("couldn't identify git version number in output:") + log.msg("'''%s'''" % v) + log.msg("skipping tests") + return (False, + "Found git (%s) but couldn't identify its version" % vcexe) + ver_s = m.group(1) + ver = tuple([int(num) for num in ver_s.split(".")]) + + # git-1.1.3 (as shipped with Dapper) doesn't understand 'git + # init' (it wants 'git init-db'), and fails unit tests that + # involve branches. git-1.5.3.6 (on my debian/unstable system) + # works. I don't know where the dividing point is: if someone can + # figure it out (or figure out how to make buildbot support more + # versions), please update this check. + if ver < (1,2): + return (False, "Found git (%s) but it is older than 1.2.x" % vcexe) + self.vcexe = vcexe + return (True, None) def createRepository(self): self.createBasedir() @@ -2488,11 +2511,11 @@ env = os.environ.copy() env['GIT_DIR'] = self.gitrepo - w = self.dovc(self.repbase, "init-db", env=env) + w = self.dovc(self.repbase, "init", env=env) yield w; w.getResult() self.populate(tmp) - w = self.dovc(tmp, "init-db") + w = self.dovc(tmp, "init") yield w; w.getResult() w = self.dovc(tmp, ["add", "."]) yield w; w.getResult() From warner at users.sourceforge.net Wed Nov 28 02:10:48 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 28 Nov 2007 02:10:48 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.997,1.998 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6325 Modified Files: ChangeLog Log Message: [project @ test_vc.Git: skip git tests when Git is older than 1.2.x, since 1.1.3 fails] Original author: warner at lothar.com Date: 2007-11-28 02:09:02+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.997 retrieving revision 1.998 diff -u -d -r1.997 -r1.998 --- ChangeLog 28 Nov 2007 01:37:05 -0000 1.997 +++ ChangeLog 28 Nov 2007 02:10:46 -0000 1.998 @@ -1,9 +1,12 @@ 2007-11-27 Brian Warner - * buildbot/test/test_vc.py (GitHelper.createRepository): use 'git - init-db' instead of 'git init', since older versions of git (such - as the one that shipped with Dapper) don't know about the newer - alias. + * buildbot/test/test_vc.py (GitHelper.capable): skip Git tests if + the version of Git installed is older than 1.2.x . Git 1.1.3 + doesn't accept 'git init' (it wants 'git init-db' instead) and the + branch tests fail. I know that Git 1.5.3.6 works. I don't know + what the dividing line is.. if someone can figure it out, please + update this check. Also, if someone can make buildbot's git + support handle older versions, please do that too! Addresses #130. 2007-11-21 Brian Warner From warner at users.sourceforge.net Wed Nov 28 02:49:45 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 28 Nov 2007 02:49:45 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_vc.py,1.81,1.82 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19461/buildbot/test Modified Files: test_vc.py Log Message: [project @ hg: checkout-to-specific-revision on older hg, closes #122 and #103.] Original author: warner at lothar.com Date: 2007-11-28 02:48:02+00:00 Index: test_vc.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v retrieving revision 1.81 retrieving revision 1.82 diff -u -d -r1.81 -r1.82 --- test_vc.py 28 Nov 2007 02:10:46 -0000 1.81 +++ test_vc.py 28 Nov 2007 02:49:43 -0000 1.82 @@ -587,6 +587,25 @@ return d def _do_vctest_clobber_2(self, res): self.shouldNotExist(self.workdir, "newfile") + # do a checkout to a specific version. Mercurial-over-HTTP (when + # either client or server is older than hg-0.9.2) cannot do this + # directly, so it must checkout HEAD and then update back to the + # requested revision. + d = self.doBuild(ss=SourceStamp(revision=self.helper.trunk[0])) + d.addCallback(self._do_vctest_clobber_3) + return d + def _do_vctest_clobber_3(self, bs): + self.shouldExist(self.workdir, "main.c") + self.shouldExist(self.workdir, "version.c") + self.shouldExist(self.workdir, "subdir", "subdir.c") + if self.metadir: + self.shouldExist(self.workdir, self.metadir) + self.failUnlessEqual(bs.getProperty("revision"), self.helper.trunk[0]) + self.failUnlessEqual(bs.getProperty("branch"), None) + self.checkGotRevision(bs, self.helper.trunk[0]) + # leave the tree at HEAD + return self.doBuild() + def _do_vctest_update(self, res): log.msg("_do_vctest_update") @@ -2419,6 +2438,13 @@ def vc_try_finish(self, workdir): rmdirRecursive(workdir) +class MercurialServerPP(protocol.ProcessProtocol): + def outReceived(self, data): + #print "HG-SERVE-STDOUT:", data + log.msg("hg-serve-stdout: %s" % (data,)) + def errReceived(self, data): + print "HG-SERVE-STDERR:", data + log.msg("hg-serve-stderr: %s" % (data,)) class Mercurial(VCBase, unittest.TestCase): vc_name = "hg" @@ -2428,6 +2454,7 @@ vctype = "source.Mercurial" vctype_try = "hg" has_got_revision = True + _hg_server = None def testCheckout(self): self.helper.vcargs = { 'repourl': self.helper.rep_trunk } @@ -2449,17 +2476,43 @@ d = self.do_branch() return d + def serveHTTP(self): + # the easiest way to publish hg over HTTP is by running 'hg serve' as + # a child process while the test is running. (you can also use a CGI + # script, which sounds difficult, or you can publish the files + # directly, which isn't well documented). + + # grr.. 'hg serve' doesn't let you use --port=0 to mean "pick a free + # port", instead it uses it as a signal to use the default (port + # 8000). This means there is no way to make it choose a free port, so + # we are forced to make it use a statically-defined one, making it + # harder to avoid collisions. + self.httpPort = 8300 + (os.getpid() % 200) + args = [self.helper.vcexe, + "serve", "--port", str(self.httpPort), "--verbose"] + pp = MercurialServerPP() # logs+discards everything + # this serves one tree at a time, so we serve trunk. TODO: test hg's + # in-repo branches, for which a single tree will hold all branches. + self._hg_server = reactor.spawnProcess(pp, self.helper.vcexe, args, + os.environ, + self.helper.rep_trunk) + time.sleep(1) # give it a moment to get started + + def tearDown(self): + if self._hg_server: + try: + self._hg_server.signalProcess("KILL") + except error.ProcessExitedAlready: + pass + self._hg_server = None + return VCBase.tearDown(self) + def testCheckoutHTTP(self): self.serveHTTP() - repourl = "http://localhost:%d/Mercurial-Repository/trunk/.hg" % self.httpPort + repourl = "http://localhost:%d/" % self.httpPort self.helper.vcargs = { 'repourl': repourl } d = self.do_vctest(testRetry=False) return d - # TODO: The easiest way to publish hg over HTTP is by running 'hg serve' - # as a child process while the test is running. (you can also use a CGI - # script, which sounds difficult, or you can publish the files directly, - # which isn't well documented). - testCheckoutHTTP.skip = "not yet implemented, use 'hg serve'" def testTry(self): self.helper.vcargs = { 'baseURL': self.helper.hg_base + "/", From warner at users.sourceforge.net Wed Nov 28 02:49:45 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 28 Nov 2007 02:49:45 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.998,1.999 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19461 Modified Files: ChangeLog Log Message: [project @ hg: checkout-to-specific-revision on older hg, closes #122 and #103.] Original author: warner at lothar.com Date: 2007-11-28 02:48:02+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.998 retrieving revision 1.999 diff -u -d -r1.998 -r1.999 --- ChangeLog 28 Nov 2007 02:10:46 -0000 1.998 +++ ChangeLog 28 Nov 2007 02:49:43 -0000 1.999 @@ -1,5 +1,23 @@ 2007-11-27 Brian Warner + * buildbot/slave/commands.py (Mercurial._maybeFallback): when hg + is doing a 'clone' operation, to a remote repository (e.g. over + HTTP), and either the server or the client is hg-0.9.1 or older, + 'hg clone' cannot accept a --rev argument: instead, you have to + clone the tip and then update back to the desired revision. Added + code to detect this failure mode and fall back to the clone+update + scheme. Closes #122 and #103. + (ShellCommand.__init__): add a keepStderr= flag to support this + + * buildbot/test/test_vc.py (VCBase._do_vctest_clobber_2): add a + test that does a checkout to a specific version, to exercise the + mercurial limitation workaround. + (Mercurial.serveHTTP): add code to test hg checkout over HTTP, + using mercurial's built-in 'hg serve' command. Because of + limitations in hg, this code uses a randomly-selected TCP + port (rather than claiming a free one), so every once in a while + this test is going to fail because of a port-number collision. + * buildbot/test/test_vc.py (GitHelper.capable): skip Git tests if the version of Git installed is older than 1.2.x . Git 1.1.3 doesn't accept 'git init' (it wants 'git init-db' instead) and the From warner at users.sourceforge.net Wed Nov 28 02:49:45 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 28 Nov 2007 02:49:45 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.86,1.87 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19461/buildbot/slave Modified Files: commands.py Log Message: [project @ hg: checkout-to-specific-revision on older hg, closes #122 and #103.] Original author: warner at lothar.com Date: 2007-11-28 02:48:02+00:00 Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- commands.py 22 Nov 2007 01:04:34 -0000 1.86 +++ commands.py 28 Nov 2007 02:49:43 -0000 1.87 @@ -15,7 +15,7 @@ # this used to be a CVS $-style "Revision" auto-updated keyword, but since I # moved to Darcs as the primary repository, this is updated manually each # time this file is changed. The last cvs_ver that was here was 1.51 . -command_version = "2.4" +command_version = "2.5" # version history: # >=1.17: commands are interruptable @@ -34,8 +34,9 @@ # keepStdinOpen=) and no longer accepts stdin=) # (release 0.7.4) # >= 2.2: added monotone, uploadFile, and downloadFile (release 0.7.5) -# >= 2.3: added bzr +# >= 2.3: added bzr (release 0.7.6) # >= 2.4: Git understands 'revision' and branches +# >= 2.5: workaround added for remote 'hg clone --rev REV' when hg<0.9.2 class CommandInterrupted(Exception): pass @@ -226,7 +227,7 @@ workdir, environ=None, sendStdout=True, sendStderr=True, sendRC=True, timeout=None, initialStdin=None, keepStdinOpen=False, - keepStdout=False, + keepStdout=False, keepStderr=False, logfiles={}): """ @@ -234,6 +235,7 @@ that we've seen. This copy is available in self.stdout, which can be read after the command has finished. + @param keepStderr: same, for stderr """ @@ -270,6 +272,7 @@ self.timeout = timeout self.timer = None self.keepStdout = keepStdout + self.keepStderr = keepStderr # usePTY=True is a convenience for cleaning up all children and # grandchildren of a hung command. Fall back to usePTY=False on @@ -299,6 +302,8 @@ # completes if self.keepStdout: self.stdout = "" + if self.keepStderr: + self.stderr = "" self.deferred = defer.Deferred() try: self._startCommand() @@ -419,6 +424,8 @@ def addStderr(self, data): if self.sendStderr: self.sendStatus({'stderr': data}) + if self.keepStderr: + self.stderr += data if self.timer: self.timer.reset(self.timeout) @@ -2171,14 +2178,56 @@ return res def doVCFull(self): - d = os.path.join(self.builder.basedir, self.srcdir) + newdir = os.path.join(self.builder.basedir, self.srcdir) command = [self.vcexe, 'clone'] if self.args['revision']: command.extend(['--rev', self.args['revision']]) - command.extend([self.repourl, d]) + command.extend([self.repourl, newdir]) + c = ShellCommand(self.builder, command, self.builder.basedir, + sendRC=False, keepStdout=True, keepStderr=True, + timeout=self.timeout) + self.command = c + d = c.start() + d.addCallback(self._maybeFallback, c) + return d + + def _maybeFallback(self, res, c): + # if either the client or the server is older than hg-0.9.2, and the + # repository being cloned was reached over HTTP, and we tried to do + # an 'hg clone -r REV' (i.e. check out a specific revision), the + # operation will fail: support for this sort of operation was added + # to mercurial relatively late. In this case, we need to do a + # checkout of HEAD (spelled 'tip' in hg parlance) and then 'hg + # update' *backwards* to the desired revision. + e = "abort: clone by revision not supported yet for remote repositories" + if res == 0: + return res + # the error message might be in stdout if we're using PTYs, which + # merge stdout and stderr. + if (e not in c.stdout and e not in c.stderr): + return # some other error + + # ok, do the fallback + newdir = os.path.join(self.builder.basedir, self.srcdir) + command = [self.vcexe, 'clone'] + command.extend([self.repourl, newdir]) c = ShellCommand(self.builder, command, self.builder.basedir, sendRC=False, timeout=self.timeout) self.command = c + d = c.start() + d.addCallback(self._updateToDesiredRevision) + return d + + def _updateToDesiredRevision(self, res): + assert self.args['revision'] + newdir = os.path.join(self.builder.basedir, self.srcdir) + # hg-0.9.1 and earlier (which need this fallback) also want to see + # 'hg update REV' instead of 'hg update --rev REV'. Note that this is + # the only place we use 'hg update', since what most VC tools mean + # by, say, 'cvs update' is expressed as 'hg pull --update' instead. + command = [self.vcexe, 'update', self.args['revision']] + c = ShellCommand(self.builder, command, newdir, + sendRC=False, timeout=self.timeout) return c.start() def parseGotRevision(self): From warner at users.sourceforge.net Wed Nov 28 03:50:50 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 28 Nov 2007 03:50:50 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.999,1.1000 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10677 Modified Files: ChangeLog Log Message: [project @ test_p4poller.py: hush pyflakes warning] Original author: warner at lothar.com Date: 2007-11-28 03:50:02+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.999 retrieving revision 1.1000 diff -u -d -r1.999 -r1.1000 --- ChangeLog 28 Nov 2007 02:49:43 -0000 1.999 +++ ChangeLog 28 Nov 2007 03:50:48 -0000 1.1000 @@ -1,5 +1,7 @@ 2007-11-27 Brian Warner + * buildbot/test/test_p4poller.py: hush pyflakes warning + * buildbot/slave/commands.py (Mercurial._maybeFallback): when hg is doing a 'clone' operation, to a remote repository (e.g. over HTTP), and either the server or the client is hg-0.9.1 or older, From warner at users.sourceforge.net Wed Nov 28 03:50:50 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Wed, 28 Nov 2007 03:50:50 +0000 Subject: [Buildbot-commits] buildbot/buildbot/test test_p4poller.py, 1.8, 1.9 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10677/buildbot/test Modified Files: test_p4poller.py Log Message: [project @ test_p4poller.py: hush pyflakes warning] Original author: warner at lothar.com Date: 2007-11-28 03:50:02+00:00 Index: test_p4poller.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_p4poller.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- test_p4poller.py 22 Nov 2007 01:04:26 -0000 1.8 +++ test_p4poller.py 28 Nov 2007 03:50:48 -0000 1.9 @@ -1,6 +1,5 @@ import time -from twisted.python import failure from twisted.internet import defer from twisted.trial import unittest From warner at users.sourceforge.net Thu Nov 29 09:35:22 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 29 Nov 2007 09:35:22 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.88,1.89 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27312/buildbot/slave Modified Files: commands.py Log Message: [project @ mercurial: another fallback improvement, if the checkout fails, don't try the update -r] Original author: warner at lothar.com Date: 2007-11-29 09:34:20+00:00 Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- commands.py 29 Nov 2007 07:53:52 -0000 1.88 +++ commands.py 29 Nov 2007 09:35:20 -0000 1.89 @@ -2221,6 +2221,7 @@ sendRC=False, timeout=self.timeout) self.command = c d = c.start() + d.addCallback(self._abandonOnFailure) d.addCallback(self._updateToDesiredRevision) return d From warner at users.sourceforge.net Thu Nov 29 07:53:54 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 29 Nov 2007 07:53:54 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.87,1.88 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19957/buildbot/slave Modified Files: commands.py Log Message: [project @ mercurial: fix the fallback so it works with new hg on the client side] Original author: warner at lothar.com Date: 2007-11-29 07:52:43+00:00 Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.87 retrieving revision 1.88 diff -u -d -r1.87 -r1.88 --- commands.py 28 Nov 2007 02:49:43 -0000 1.87 +++ commands.py 29 Nov 2007 07:53:52 -0000 1.88 @@ -2192,20 +2192,26 @@ return d def _maybeFallback(self, res, c): - # if either the client or the server is older than hg-0.9.2, and the - # repository being cloned was reached over HTTP, and we tried to do - # an 'hg clone -r REV' (i.e. check out a specific revision), the - # operation will fail: support for this sort of operation was added - # to mercurial relatively late. In this case, we need to do a - # checkout of HEAD (spelled 'tip' in hg parlance) and then 'hg - # update' *backwards* to the desired revision. - e = "abort: clone by revision not supported yet for remote repositories" + # to do 'hg clone -r REV' (i.e. to check out a specific revision) + # from a remote (HTTP) repository, both the client and the server + # need to be hg-0.9.2 or newer. If this caused a checkout failure, we + # fall back to doing a checkout of HEAD (spelled 'tip' in hg + # parlance) and then 'hg update' *backwards* to the desired revision. if res == 0: return res + + # hg-0.9.1 and earlier says this + e1 = ("abort: clone by revision not supported yet for " + "remote repositories") + # hg-0.9.2 and later say this when the other end is too old + e2 = ("abort: src repository does not support revision lookup " + "and so doesn't support clone by revision") + # the error message might be in stdout if we're using PTYs, which # merge stdout and stderr. - if (e not in c.stdout and e not in c.stderr): - return # some other error + allout = c.stdout + c.stderr + if not (e1 in allout or e2 in allout): + return # must be some other error # ok, do the fallback newdir = os.path.join(self.builder.basedir, self.srcdir) From warner at users.sourceforge.net Thu Nov 29 07:53:54 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 29 Nov 2007 07:53:54 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.1000,1.1001 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19957 Modified Files: ChangeLog Log Message: [project @ mercurial: fix the fallback so it works with new hg on the client side] Original author: warner at lothar.com Date: 2007-11-29 07:52:43+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.1000 retrieving revision 1.1001 diff -u -d -r1.1000 -r1.1001 --- ChangeLog 28 Nov 2007 03:50:48 -0000 1.1000 +++ ChangeLog 29 Nov 2007 07:53:52 -0000 1.1001 @@ -1,3 +1,9 @@ +2007-11-28 Brian Warner + + * buildbot/slave/commands.py (Mercurial._maybeFallback): improve + hg fallback so that it works when the client hg is new and the + server hg is old (the error message is different in this case). + 2007-11-27 Brian Warner * buildbot/test/test_p4poller.py: hush pyflakes warning From warner at users.sourceforge.net Thu Nov 29 10:05:53 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 29 Nov 2007 10:05:53 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.1002,1.1003 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6805 Modified Files: ChangeLog Log Message: [project @ mercurial: more fixes: handle back to ancient hg-0.7] Original author: warner at lothar.com Date: 2007-11-29 10:04:35+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.1002 retrieving revision 1.1003 diff -u -d -r1.1002 -r1.1003 --- ChangeLog 29 Nov 2007 09:35:19 -0000 1.1002 +++ ChangeLog 29 Nov 2007 10:05:51 -0000 1.1003 @@ -3,6 +3,11 @@ * buildbot/slave/commands.py (Mercurial._maybeFallback): add an _abandonOnFailure call to the fallback, to skip the 'update' step if the checkout fails. + (Mercurial._maybeFallback): More fixes: look for error messages + generated by every version of hg from 0.7 to the current 0.9.5, + including development versions as of rev 92991422a847. Also make + sure to return the exit code of non-fallbackable errors so that + other steps can attempt a workaround. 2007-11-28 Brian Warner From warner at users.sourceforge.net Thu Nov 29 09:35:22 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 29 Nov 2007 09:35:22 +0000 Subject: [Buildbot-commits] buildbot ChangeLog,1.1001,1.1002 Message-ID: Update of /cvsroot/buildbot/buildbot In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27312 Modified Files: ChangeLog Log Message: [project @ mercurial: another fallback improvement, if the checkout fails, don't try the update -r] Original author: warner at lothar.com Date: 2007-11-29 09:34:20+00:00 Index: ChangeLog =================================================================== RCS file: /cvsroot/buildbot/buildbot/ChangeLog,v retrieving revision 1.1001 retrieving revision 1.1002 diff -u -d -r1.1001 -r1.1002 --- ChangeLog 29 Nov 2007 07:53:52 -0000 1.1001 +++ ChangeLog 29 Nov 2007 09:35:19 -0000 1.1002 @@ -1,3 +1,9 @@ +2007-11-29 Brian Warner + + * buildbot/slave/commands.py (Mercurial._maybeFallback): add an + _abandonOnFailure call to the fallback, to skip the 'update' step + if the checkout fails. + 2007-11-28 Brian Warner * buildbot/slave/commands.py (Mercurial._maybeFallback): improve From warner at users.sourceforge.net Thu Nov 29 10:05:53 2007 From: warner at users.sourceforge.net (Brian Warner) Date: Thu, 29 Nov 2007 10:05:53 +0000 Subject: [Buildbot-commits] buildbot/buildbot/slave commands.py,1.89,1.90 Message-ID: Update of /cvsroot/buildbot/buildbot/buildbot/slave In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6805/buildbot/slave Modified Files: commands.py Log Message: [project @ mercurial: more fixes: handle back to ancient hg-0.7] Original author: warner at lothar.com Date: 2007-11-29 10:04:35+00:00 Index: commands.py =================================================================== RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v retrieving revision 1.89 retrieving revision 1.90 diff -u -d -r1.89 -r1.90 --- commands.py 29 Nov 2007 09:35:20 -0000 1.89 +++ commands.py 29 Nov 2007 10:05:51 -0000 1.90 @@ -2200,18 +2200,29 @@ if res == 0: return res - # hg-0.9.1 and earlier says this - e1 = ("abort: clone by revision not supported yet for " - "remote repositories") - # hg-0.9.2 and later say this when the other end is too old - e2 = ("abort: src repository does not support revision lookup " - "and so doesn't support clone by revision") + errmsgs = [ + # hg-0.6 didn't even have the 'clone' command + # hg-0.7 + "hg clone: option --rev not recognized", + # hg-0.8, 0.8.1, 0.9 + "abort: clone -r not supported yet for remote repositories.", + # hg-0.9.1 + ("abort: clone by revision not supported yet for " + "remote repositories"), + # hg-0.9.2 and later say this when the other end is too old + ("abort: src repository does not support revision lookup " + "and so doesn't support clone by revision"), + ] - # the error message might be in stdout if we're using PTYs, which - # merge stdout and stderr. - allout = c.stdout + c.stderr - if not (e1 in allout or e2 in allout): - return # must be some other error + fallback_is_useful = False + for errmsg in errmsgs: + # the error message might be in stdout if we're using PTYs, which + # merge stdout and stderr. + if errmsg in c.stdout or errmsg in c.stderr: + fallback_is_useful = True + break + if not fallback_is_useful: + return res # must be some other error # ok, do the fallback newdir = os.path.join(self.builder.basedir, self.srcdir)