monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Help request with buildbot for monotone


From: Markus Schiltknecht
Subject: Re: [Monotone-devel] Help request with buildbot for monotone
Date: Mon, 09 Jul 2007 15:08:13 +0200
User-agent: Icedove 1.5.0.10 (X11/20070329)

Richard Levitte wrote:
It's possible that I restarted the master only at some point without
restarting the slave.  I'm not sure if that's relevant.

Looks like it *was* relevant, at least your slave now tries to build:

   2007/07/09 14:36 +0200 [Broker,client] <SlaveBuilder 'i386-debian-testing' at 
-1217984756>.startBuild

Now the build log, step 'monotone' at:
http://monotone.ca:8010/i386-debian-testing/builds/0/step-monotone/1
shows the following error:

startVC() takes exactly 1 argument (4 given)


Ah.. I remember having similar problems, and having done some patching, as the buildbot code itself was updated, but not the monotone specific parts. :-( (Sorry, I forgot...)

I'm attaching what 'cvs diff' currently spits out from my buildbot working directory. I cannot guarantee anything, it's pretty much hacked together. But I simply don't have the time to think into it much more.

However, it would be nice to get this stuff into mainline buildbot and keep maintaining that. Support for 'mtn automate' would also be appreciated. I'd vote for extending a day to 36 hours... at least!

I'm attaching the slave's buildbot.tac and the master's master.cfg
(with the bot password cleared after having verified that it's spelled
the same in both files;-)).

Looks good from here...

address@hidden:~/wrk$ apt-show-versions buildbot
buildbot/testing uptodate 0.7.5-1.1

The patch probably applies to that version as well.

Regards

Markus
Index: buildbot/changes/monotone.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/monotone.py,v
retrieving revision 1.2
diff -u -r1.2 monotone.py
--- buildbot/changes/monotone.py        23 Jan 2007 21:04:40 -0000      1.2
+++ buildbot/changes/monotone.py        9 Jul 2007 12:56:41 -0000
@@ -3,6 +3,7 @@
 import os
 from cStringIO import StringIO
 
+from zope.interface import implements
 from twisted.python import log
 from twisted.application import service
 from twisted.internet import defer, protocol, error, reactor
@@ -11,6 +12,7 @@
 from buildbot import util
 from buildbot.interfaces import IChangeSource
 from buildbot.changes.changes import Change
+from buildbot.changes import base
 
 class _MTProtocol(protocol.ProcessProtocol):
 
@@ -73,7 +75,7 @@
         return self._run_monotone(["pull", server, pattern])
 
     def get_revision(self, rid):
-        return self._run_monotone(["cat", "revision", rid])
+        return self._run_monotone(["automate", "get_revision", rid])
 
     def get_heads(self, branch, rcfile=""):
         cmd = ["automate", "heads", branch]
@@ -104,10 +106,10 @@
             depth_arg = ["--last=%i" % (depth,)]
         else:
             depth_arg = []
-        return self._run_monotone(["log", "-r", rev] + depth_arg)
+        return self._run_monotone(["log", "--no-graph", "--from", rev, 
"--last", "20"] + depth_arg)
 
 
-class MonotoneSource(service.Service, util.ComparableMixin):
+class MonotoneSource(base.ChangeSource):
     """This source will poll a monotone server for changes and submit them to
     the change master.
 
@@ -123,7 +125,8 @@
     @param monotone_exec: path to monotone executable, defaults to "monotone"
     """
 
-    __implements__ = IChangeSource, service.Service.__implements__
+    implements(IChangeSource)
+
     compare_attrs = ["server_addr", "trusted_keys", "db_path",
                      "pollinterval", "branch", "monotone_exec"]
 
Index: buildbot/slave/commands.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v
retrieving revision 1.83
diff -u -r1.83 commands.py
--- buildbot/slave/commands.py  4 Jul 2007 05:52:04 -0000       1.83
+++ buildbot/slave/commands.py  9 Jul 2007 12:56:41 -0000
@@ -1648,10 +1648,11 @@
 
     def _doUpdate(self):
         # update: possible for mode in ('copy', 'update')
+        revision = self.revision or 'h:'
         command = [self.monotone, "update",
-                   "-r", self.revision,
+                   "-r", revision,
                    "-b", self.branch]
-        c = ShellCommand(self.builder, command, self.full_srcdir,
+        c = ShellCommand(self.builder, command, self.builder.basedir,
                          sendRC=False, timeout=self.timeout)
         self.command = c
         return c.start()
@@ -1660,13 +1661,15 @@
         return self._withFreshDb(self._doFull)
 
     def _doFull(self):
+        revision = self.revision or 'h:'
         command = [self.monotone, "--db=" + self.full_db_path,
                    "checkout",
-                   "-r", self.revision,
+                   "-r", revision,
                    "-b", self.branch,
                    self.full_srcdir]
         c = ShellCommand(self.builder, command, self.builder.basedir,
-                         sendRC=False, timeout=self.timeout)
+                         sendRC=False, timeout=self.timeout,
+                         keepStdout=True)
         self.command = c
         return c.start()
 
Index: buildbot/steps/source.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/steps/source.py,v
retrieving revision 1.7
diff -u -r1.7 source.py
--- buildbot/steps/source.py    3 Jul 2007 19:17:49 -0000       1.7
+++ buildbot/steps/source.py    9 Jul 2007 12:56:41 -0000
@@ -1026,8 +1026,7 @@
     name = "monotone"
 
     def __init__(self, server_addr, branch, db_path="monotone.db",
-                 monotone="monotone",
-                 **kwargs):
+                 monotone="mtn", **kwargs):
         Source.__init__(self, **kwargs)
         self.addFactoryArguments(server_addr=server_addr,
                                  branch=branch,
@@ -1044,9 +1043,11 @@
             return None
         return changes[-1].revision
 
-    def startVC(self):
+    def startVC(self, branch, revision, patch):
         slavever = self.slaveVersion("monotone")
         assert slavever, "slave is too old, does not know about monotone"
+        self.args['revision'] = revision
+        self.args['patch'] = patch
         cmd = LoggedRemoteCommand("monotone", self.args)
         self.startCommand(cmd)
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]