[Buildbot-devel] [PATCH] Initial cogito support

Brandon Philips brandon at osuosl.org
Tue May 10 00:06:43 UTC 2005


Hi Brian,

Attached is a patch that adds support for the cogito version control
system.  This is the system that is beginning to get used by the Linux
Kernel development team.  More information can be found here:

http://kernel.org/git/

I may have fixes and patches in the coming weeks as I am sure something
will break between versions of cogito.

Thanks,

Brandon

--
http://osuosl.org

---

diff -utr --exclude=.git a/buildbot/process/step.py b/buildbot/process/step.py
--- a/buildbot/process/step.py	2005-04-25 18:43:19.000000000 -0700
+++ b/buildbot/process/step.py	2005-05-09 16:17:20.000000000 -0700
@@ -1162,6 +1162,7 @@
         self.cmd = LoggedRemoteCommand("svn", self.args)
         ShellCommand.start(self, errorMessage)
 
+
 class Darcs(Source):
     """Check out a source tree from a Darcs repository at 'repourl'.
 
@@ -1190,6 +1191,25 @@
         self.cmd = LoggedRemoteCommand("darcs", self.args)
         ShellCommand.start(self)
 
+class Git(Source):
+    """Check out a source tree from a git repository 'repourl'."""
+
+    name = "git"
+
+    def __init__(self, repourl, **kwargs):
+        """
+        @type  repourl: string
+        @param repourl: the URL which points at the git repository
+        """
+        Source.__init__(self, **kwargs)
+        self.args['repourl'] = repourl
+
+    def startVC(self):
+        slavever = self.slaveVersion("git")
+        assert slavever, "slave is too old, does not know about git"
+        self.cmd = LoggedRemoteCommand("git", self.args)
+        ShellCommand.start(self)
+
 class Arch(Source):
     """Check out a source tree from an Arch repository at 'url'. 'version'
     specifies which version number (development line) will be used for the
diff -utr --exclude=.git a/buildbot/slave/commands.py b/buildbot/slave/commands.py
--- a/buildbot/slave/commands.py	2005-04-26 14:37:16.000000000 -0700
+++ b/buildbot/slave/commands.py	2005-05-09 16:47:51.000000000 -0700
@@ -810,6 +810,45 @@
 
 registerSlaveCommand("darcs", Darcs, cvs_ver)
 
+class Git(SourceBase):
+    """Git specific VC operation. In addition to the arguments
+    handled by SourceBase, this command reads the following keys:
+
+    ['repourl'] (required): the Darcs repository string
+    """
+
+    header = "git operation"
+
+    def setup(self, args):
+        SourceBase.setup(self, args)
+        self.repourl = args['repourl']
+
+    def sourcedirIsUpdateable(self):
+        if os.path.exists(os.path.join(self.builder.basedir,
+                                       self.srcdir, ".buildbot-patched")):
+            return False
+        return os.path.isdir(os.path.join(self.builder.basedir,
+                                          self.srcdir, ".git"))
+
+    def doVCUpdate(self):
+        d = os.path.join(self.builder.basedir, self.srcdir)
+        command = ['cg-update']
+        c = ShellCommand(self.builder, command, d,
+                         sendRC=False, timeout=self.timeout)
+        self.command = c
+        return c.start()
+
+    def doVCFull(self):
+        d = os.path.join(self.builder.basedir, self.srcdir)
+        os.mkdir(d)
+        command = ['cg-clone', self.repourl]
+        c = ShellCommand(self.builder, command, d,
+                         sendRC=False, timeout=self.timeout)
+        self.command = c
+        return c.start()
+
+registerSlaveCommand("git", Git, cvs_ver)
+
 class Arch(SourceBase):
     """Arch-specific (tla-specific) VC operation. In addition to the
     arguments handled by SourceBase, this command reads the following keys:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://buildbot.net/pipermail/devel/attachments/20050509/6a0606fd/attachment.bin>


More information about the devel mailing list