diff --git a/master/buildbot/changes/monotone.py b/master/buildbot/changes/monotone.py deleted file mode 100644 index 302c1c5654a..00000000000 --- a/master/buildbot/changes/monotone.py +++ /dev/null @@ -1,305 +0,0 @@ - -import tempfile -import os -from cStringIO import StringIO - -from twisted.python import log -from twisted.application import service -from twisted.internet import defer, protocol, error, reactor -from twisted.internet.task import LoopingCall - -from buildbot import util -from buildbot.interfaces import IChangeSource -from buildbot.changes.changes import Change - -class _MTProtocol(protocol.ProcessProtocol): - - def __init__(self, deferred, cmdline): - self.cmdline = cmdline - self.deferred = deferred - self.s = StringIO() - - def errReceived(self, text): - log.msg("stderr: %s" % text) - - def outReceived(self, text): - log.msg("stdout: %s" % text) - self.s.write(text) - - def processEnded(self, reason): - log.msg("Command %r exited with value %s" % (self.cmdline, reason)) - if isinstance(reason.value, error.ProcessDone): - self.deferred.callback(self.s.getvalue()) - else: - self.deferred.errback(reason) - -class Monotone: - """All methods of this class return a Deferred.""" - - def __init__(self, bin, db): - self.bin = bin - self.db = db - - def _run_monotone(self, args): - d = defer.Deferred() - cmdline = (self.bin, "--db=" + self.db) + tuple(args) - p = _MTProtocol(d, cmdline) - log.msg("Running command: %r" % (cmdline,)) - log.msg("wd: %s" % os.getcwd()) - reactor.spawnProcess(p, self.bin, cmdline) - return d - - def _process_revision_list(self, output): - if output: - return output.strip().split("\n") - else: - return [] - - def get_interface_version(self): - d = self._run_monotone(["automate", "interface_version"]) - d.addCallback(self._process_interface_version) - return d - - def _process_interface_version(self, output): - return tuple(map(int, output.strip().split("."))) - - def db_init(self): - return self._run_monotone(["db", "init"]) - - def db_migrate(self): - return self._run_monotone(["db", "migrate"]) - - def pull(self, server, pattern): - return self._run_monotone(["pull", server, pattern]) - - def get_revision(self, rid): - return self._run_monotone(["cat", "revision", rid]) - - def get_heads(self, branch, rcfile=""): - cmd = ["automate", "heads", branch] - if rcfile: - cmd += ["--rcfile=" + rcfile] - d = self._run_monotone(cmd) - d.addCallback(self._process_revision_list) - return d - - def erase_ancestors(self, revs): - d = self._run_monotone(["automate", "erase_ancestors"] + revs) - d.addCallback(self._process_revision_list) - return d - - def ancestry_difference(self, new_rev, old_revs): - d = self._run_monotone(["automate", "ancestry_difference", new_rev] - + old_revs) - d.addCallback(self._process_revision_list) - return d - - def descendents(self, rev): - d = self._run_monotone(["automate", "descendents", rev]) - d.addCallback(self._process_revision_list) - return d - - def log(self, rev, depth=None): - if depth is not None: - depth_arg = ["--last=%i" % (depth,)] - else: - depth_arg = [] - return self._run_monotone(["log", "-r", rev] + depth_arg) - - -class MonotoneSource(service.Service, util.ComparableMixin): - """This source will poll a monotone server for changes and submit them to - the change master. - - @param server_addr: monotone server specification (host:portno) - - @param branch: monotone branch to watch - - @param trusted_keys: list of keys whose code you trust - - @param db_path: path to monotone database to pull into - - @param pollinterval: interval in seconds between polls, defaults to 10 minutes - @param monotone_exec: path to monotone executable, defaults to "monotone" - """ - - __implements__ = IChangeSource, service.Service.__implements__ - compare_attrs = ["server_addr", "trusted_keys", "db_path", - "pollinterval", "branch", "monotone_exec"] - - parent = None # filled in when we're added - done_revisions = [] - last_revision = None - loop = None - d = None - tmpfile = None - monotone = None - volatile = ["loop", "d", "tmpfile", "monotone"] - - def __init__(self, server_addr, branch, trusted_keys, db_path, - pollinterval=60 * 10, monotone_exec="monotone"): - self.server_addr = server_addr - self.branch = branch - self.trusted_keys = trusted_keys - self.db_path = db_path - self.pollinterval = pollinterval - self.monotone_exec = monotone_exec - self.monotone = Monotone(self.monotone_exec, self.db_path) - - def startService(self): - self.loop = LoopingCall(self.start_poll) - self.loop.start(self.pollinterval) - service.Service.startService(self) - - def stopService(self): - self.loop.stop() - return service.Service.stopService(self) - - def describe(self): - return "monotone_source %s %s" % (self.server_addr, - self.branch) - - def start_poll(self): - if self.d is not None: - log.msg("last poll still in progress, skipping next poll") - return - log.msg("starting poll") - self.d = self._maybe_init_db() - self.d.addCallback(self._do_netsync) - self.d.addCallback(self._get_changes) - self.d.addErrback(self._handle_error) - - def _handle_error(self, failure): - log.err(failure) - self.d = None - - def _maybe_init_db(self): - if not os.path.exists(self.db_path): - log.msg("init'ing db") - return self.monotone.db_init() - else: - log.msg("db already exists, migrating") - return self.monotone.db_migrate() - - def _do_netsync(self, output): - return self.monotone.pull(self.server_addr, self.branch) - - def _get_changes(self, output): - d = self._get_new_head() - d.addCallback(self._process_new_head) - return d - - def _get_new_head(self): - # This function returns a deferred that resolves to a good pick of new - # head (or None if there is no good new head.) - - # First need to get all new heads... - rcfile = """function get_revision_cert_trust(signers, id, name, val) - local trusted_signers = { %s } - local ts_table = {} - for k, v in pairs(trusted_signers) do ts_table[v] = 1 end - for k, v in pairs(signers) do - if ts_table[v] then - return true - end - end - return false - end - """ - trusted_list = ", ".join(['"' + key + '"' for key in self.trusted_keys]) - # mktemp is unsafe, but mkstemp is not 2.2 compatible. - tmpfile_name = tempfile.mktemp() - f = open(tmpfile_name, "w") - f.write(rcfile % trusted_list) - f.close() - d = self.monotone.get_heads(self.branch, tmpfile_name) - d.addCallback(self._find_new_head, tmpfile_name) - return d - - def _find_new_head(self, new_heads, tmpfile_name): - os.unlink(tmpfile_name) - # Now get the old head's descendents... - if self.last_revision is not None: - d = self.monotone.descendents(self.last_revision) - else: - d = defer.succeed(new_heads) - d.addCallback(self._pick_new_head, new_heads) - return d - - def _pick_new_head(self, old_head_descendents, new_heads): - for r in new_heads: - if r in old_head_descendents: - return r - return None - - def _process_new_head(self, new_head): - if new_head is None: - log.msg("No new head") - self.d = None - return None - # Okay, we have a new head; we need to get all the revisions since - # then and create change objects for them. - # Step 1: simplify set of processed revisions. - d = self._simplify_revisions() - # Step 2: get the list of new revisions - d.addCallback(self._get_new_revisions, new_head) - # Step 3: add a change for each - d.addCallback(self._add_changes_for_revisions) - # Step 4: all done - d.addCallback(self._finish_changes, new_head) - return d - - def _simplify_revisions(self): - d = self.monotone.erase_ancestors(self.done_revisions) - d.addCallback(self._reset_done_revisions) - return d - - def _reset_done_revisions(self, new_done_revisions): - self.done_revisions = new_done_revisions - return None - - def _get_new_revisions(self, blah, new_head): - if self.done_revisions: - return self.monotone.ancestry_difference(new_head, - self.done_revisions) - else: - # Don't force feed the builder with every change since the - # beginning of time when it's first started up. - return defer.succeed([new_head]) - - def _add_changes_for_revisions(self, revs): - d = defer.succeed(None) - for rid in revs: - d.addCallback(self._add_change_for_revision, rid) - return d - - def _add_change_for_revision(self, blah, rid): - d = self.monotone.log(rid, 1) - d.addCallback(self._add_change_from_log, rid) - return d - - def _add_change_from_log(self, log, rid): - d = self.monotone.get_revision(rid) - d.addCallback(self._add_change_from_log_and_revision, log, rid) - return d - - def _add_change_from_log_and_revision(self, revision, log, rid): - # Stupid way to pull out everything inside quotes (which currently - # uniquely identifies filenames inside a changeset). - pieces = revision.split('"') - files = [] - for i in range(len(pieces)): - if (i % 2) == 1: - files.append(pieces[i]) - # Also pull out author key and date - author = "unknown author" - pieces = log.split('\n') - for p in pieces: - if p.startswith("Author:"): - author = p.split()[1] - self.parent.addChange(Change(author, files, log, revision=rid)) - - def _finish_changes(self, blah, new_head): - self.done_revisions.append(new_head) - self.last_revision = new_head - self.d = None diff --git a/master/buildbot/clients/tryclient.py b/master/buildbot/clients/tryclient.py index 0461e1148ad..fa5f2641e1a 100644 --- a/master/buildbot/clients/tryclient.py +++ b/master/buildbot/clients/tryclient.py @@ -29,8 +29,8 @@ def dovc(self, cmd): return d def _didvc(self, res, cmd): (stdout, stderr, code) = res - # 'bzr diff' sets rc=1 if there were any differences. tla, baz, and - # cvs do something similar, so don't bother requring rc=0. + # 'bzr diff' sets rc=1 if there were any differences. + # cvs does something similar, so don't bother requring rc=0. return stdout def get(self): @@ -113,45 +113,6 @@ def getPatch(self, res): d.addCallback(self.readPatch, self.patchlevel) return d -class BazExtractor(SourceStampExtractor): - patchlevel = 1 - vcexe = "baz" - def getBaseRevision(self): - d = self.dovc(["tree-id"]) - d.addCallback(self.parseStatus) - return d - def parseStatus(self, res): - tid = res.strip() - slash = tid.index("/") - dd = tid.rindex("--") - self.branch = tid[slash+1:dd] - self.baserev = tid[dd+2:] - def getPatch(self, res): - d = self.dovc(["diff"]) - d.addCallback(self.readPatch, self.patchlevel) - return d - -class TlaExtractor(SourceStampExtractor): - patchlevel = 1 - vcexe = "tla" - def getBaseRevision(self): - # 'tla logs --full' gives us ARCHIVE/BRANCH--REVISION - # 'tla logs' gives us REVISION - d = self.dovc(["logs", "--full", "--reverse"]) - d.addCallback(self.parseStatus) - return d - def parseStatus(self, res): - tid = res.split("\n")[0].strip() - slash = tid.index("/") - dd = tid.rindex("--") - self.branch = tid[slash+1:dd] - self.baserev = tid[dd+2:] - - def getPatch(self, res): - d = self.dovc(["changes", "--diffs"]) - d.addCallback(self.readPatch, self.patchlevel) - return d - class BzrExtractor(SourceStampExtractor): patchlevel = 0 vcexe = "bzr" @@ -310,12 +271,8 @@ def getSourceStamp(vctype, treetop, branch=None): e = CVSExtractor(treetop, branch) elif vctype == "svn": e = SVNExtractor(treetop, branch) - elif vctype == "baz": - e = BazExtractor(treetop, branch) elif vctype == "bzr": e = BzrExtractor(treetop, branch) - elif vctype == "tla": - e = TlaExtractor(treetop, branch) elif vctype == "hg": e = MercurialExtractor(treetop, branch) elif vctype == "p4": diff --git a/master/buildbot/scripts/runner.py b/master/buildbot/scripts/runner.py index 6b1a324333d..c154ed3be84 100644 --- a/master/buildbot/scripts/runner.py +++ b/master/buildbot/scripts/runner.py @@ -868,7 +868,7 @@ class TryOptions(OptionsWithOptionsFile): "Base revision to use instead of scanning a local tree."], ["vc", None, None, - "The VC system in use, one of: cvs,svn,tla,baz,darcs,p4"], + "The VC system in use, one of: cvs,svn,bzr,darcs,p4"], ["branch", None, None, "The branch in use, for VC systems that can't figure it out" " themselves"], diff --git a/master/buildbot/steps/source.py b/master/buildbot/steps/source.py index b2106f83eee..bcb7959c187 100644 --- a/master/buildbot/steps/source.py +++ b/master/buildbot/steps/source.py @@ -818,175 +818,6 @@ def startVC(self, branch, revision, patch): self.startCommand(cmd) -class Arch(Source): - """Check out a source tree from an Arch repository named 'archive' - available at 'url'. 'version' specifies which version number (development - line) will be used for the checkout: this is mostly equivalent to a - branch name. This version uses the 'tla' tool to do the checkout, to use - 'baz' see L{Bazaar} instead. - """ - - name = "arch" - # TODO: slaves >0.6.6 will accept args['build-config'], so use it - - def __init__(self, url=None, version=None, archive=None, **kwargs): - """ - @type url: string - @param url: the Arch coordinates of the repository. This is - typically an http:// URL, but could also be the absolute - pathname of a local directory instead. - - @type version: string - @param version: the category--branch--version to check out. This is - the default branch. If a build specifies a different - branch, it will be used instead of this. - - @type archive: string - @param archive: The archive name. If provided, it must match the one - that comes from the repository. If not, the - repository's default will be used. - """ - warn("Support for Arch will be removed in 0.8.2", DeprecationWarning) - self.branch = version - self.url = url - Source.__init__(self, **kwargs) - self.addFactoryArguments(url=url, - version=version, - archive=archive, - ) - assert version, "version should be provided" - self.args.update({'archive': archive}) - - def computeSourceRevision(self, changes): - # in Arch, fully-qualified revision numbers look like: - # arch@buildbot.sourceforge.net--2004/buildbot--dev--0--patch-104 - # For any given builder, all of this is fixed except the patch-104. - # The Change might have any part of the fully-qualified string, so we - # just look for the last part. We return the "patch-NN" string. - if not changes: - return None - lastChange = None - for c in changes: - if not c.revision: - continue - if c.revision.endswith("--base-0"): - rev = 0 - else: - i = c.revision.rindex("patch") - rev = int(c.revision[i+len("patch-"):]) - lastChange = max(lastChange, rev) - if lastChange is None: - return None - if lastChange == 0: - return "base-0" - return "patch-%d" % lastChange - - def checkSlaveVersion(self, cmd, branch): - warnings = [] - slavever = self.slaveVersion(cmd) - if not slavever: - m = "slave is too old, does not know about %s" % cmd - raise BuildSlaveTooOldError(m) - - # slave 1.28 and later understand 'revision' - if self.slaveVersionIsOlderThan(cmd, "1.28"): - if not self.alwaysUseLatest: - # we don't know whether our requested revision is the latest - # or not. If the tree does not change very quickly, this will - # probably build the right thing, so emit a warning rather - # than refuse to build at all - m = "WARNING, buildslave is too old to use a revision" - log.msg(m) - warnings.append(m + "\n") - - if self.slaveVersionIsOlderThan(cmd, "1.39"): - # the slave doesn't know to avoid re-using the same sourcedir - # when the branch changes. We have no way of knowing which branch - # the last build used, so if we're using a non-default branch and - # either 'update' or 'copy' modes, it is safer to refuse to - # build, and tell the user they need to upgrade the buildslave. - if (branch != self.branch - and self.args['mode'] in ("update", "copy")): - m = ("This buildslave (%s) does not know about multiple " - "branches, and using mode=%s would probably build the " - "wrong tree. " - "Refusing to build. Please upgrade the buildslave to " - "buildbot-0.7.0 or newer." % (self.build.slavename, - self.args['mode'])) - log.msg(m) - raise BuildSlaveTooOldError(m) - - return warnings - - def startVC(self, branch, revision, patch): - self.args['url'] = self.computeRepositoryURL(self.url), - self.args['version'] = branch - self.args['revision'] = revision - self.args['patch'] = patch - warnings = self.checkSlaveVersion("arch", branch) - - revstuff = [] - if branch is not None and branch != self.branch: - revstuff.append("[branch]") - if revision is not None: - revstuff.append("patch%s" % revision) - self.description.extend(revstuff) - self.descriptionDone.extend(revstuff) - - cmd = LoggedRemoteCommand("arch", self.args) - self.startCommand(cmd, warnings) - - -class Bazaar(Arch): - """Bazaar is an alternative client for Arch repositories. baz is mostly - compatible with tla, but archive registration is slightly different.""" - - # TODO: slaves >0.6.6 will accept args['build-config'], so use it - - def __init__(self, url, version, archive, **kwargs): - """ - @type url: string - @param url: the Arch coordinates of the repository. This is - typically an http:// URL, but could also be the absolute - pathname of a local directory instead. - - @type version: string - @param version: the category--branch--version to check out - - @type archive: string - @param archive: The archive name (required). This must always match - the one that comes from the repository, otherwise the - buildslave will attempt to get sources from the wrong - archive. - """ - self.branch = version - self.url = url - Source.__init__(self, **kwargs) - self.addFactoryArguments(url=url, - version=version, - archive=archive, - ) - self.args.update({'archive': archive, - }) - - def startVC(self, branch, revision, patch): - self.args['url'] = self.computeRepositoryURL(url), - self.args['version'] = branch - self.args['revision'] = revision - self.args['patch'] = patch - warnings = self.checkSlaveVersion("bazaar", branch) - - revstuff = [] - if branch is not None and branch != self.branch: - revstuff.append("[branch]") - if revision is not None: - revstuff.append("patch%s" % revision) - self.description.extend(revstuff) - self.descriptionDone.extend(revstuff) - - cmd = LoggedRemoteCommand("bazaar", self.args) - self.startCommand(cmd, warnings) - class Bzr(Source): """Check out a source tree from a bzr (Bazaar) repository at 'repourl'. @@ -1297,42 +1128,3 @@ def startVC(self, branch, revision, patch): assert slavever, "slave is too old, does not know about p4" cmd = LoggedRemoteCommand("p4sync", self.args) self.startCommand(cmd) - -class Monotone(Source): - """Check out a revision from a monotone server at 'server_addr', - branch 'branch'. 'revision' specifies which revision id to check - out. - - This step will first create a local database, if necessary, and then pull - the contents of the server into the database. Then it will do the - checkout/update from this database.""" - - name = "monotone" - - def __init__(self, server_addr=None, branch=None, db_path="monotone.db", - monotone=None, - **kwargs): - warn("Support for Monotone will be removed in 0.8.2", DeprecationWarning) - Source.__init__(self, **kwargs) - self.addFactoryArguments(server_addr=server_addr, - branch=branch, - db_path=db_path, - monotone=monotone, - ) - assert branch, "branch must be specified" - self.args.update({"branch": branch, - "db_path": db_path}) - if monotone: - self.args["monotone"] = monotone - - def computeSourceRevision(self, changes): - if not changes: - return None - return changes[-1].revision - - def startVC(self): - self.args["server_addr"] = self.computeRepositoryURL(server_addr), - slavever = self.slaveVersion("monotone") - assert slavever, "slave is too old, does not know about monotone" - cmd = LoggedRemoteCommand("monotone", self.args) - self.startCommand(cmd) diff --git a/master/contrib/arch_buildbot.py b/master/contrib/arch_buildbot.py deleted file mode 100755 index 7af796e4af8..00000000000 --- a/master/contrib/arch_buildbot.py +++ /dev/null @@ -1,76 +0,0 @@ -#! /usr/bin/python - -# this script is meant to run as an Arch post-commit hook (and also as a -# pre-commit hook), using the "arch-meta-hook" framework. See -# http://wiki.gnuarch.org/NdimMetaHook for details. The pre-commit hook -# creates a list of files (and log comments), while the post-commit hook -# actually notifies the buildmaster. - -# this script doesn't handle partial commits quite right: it will tell the -# buildmaster that everything changed, not just the filenames you give to -# 'tla commit'. - -import os -import commands -import cStringIO - -from buildbot.scripts import runner - -# Just modify the appropriate values below and then put this file in two -# places: ~/.arch-params/hooks/ARCHIVE/=precommit/90buildbot.py and -# ~/.arch-params/hooks/ARCHIVE/=commit/10buildbot.py - -master = "localhost:9989" -username = "myloginname" - -# Remember that for this to work, your buildmaster's master.cfg needs to have -# a c['change_source'] list which includes a pb.PBChangeSource instance. - -os.chdir(os.getenv("ARCH_TREE_ROOT")) -filelist = ",,bb-files" -commentfile = ",,bb-comments" - -if os.getenv("ARCH_HOOK_ACTION") == "precommit": - files = [] - out = commands.getoutput("tla changes") - for line in cStringIO.StringIO(out).readlines(): - if line[0] in "AMD": # add, modify, delete - files.append(line[3:]) - if files: - f = open(filelist, "w") - f.write("".join(files)) - f.close() - # comments - logfiles = [f for f in os.listdir(".") if f.startswith("++log.")] - if len(logfiles) > 1: - print ("Warning, multiple ++log.* files found, getting comments " - "from the first one") - if logfiles: - open(commentfile, "w").write(open(logfiles[0], "r").read()) - -elif os.getenv("ARCH_HOOK_ACTION") == "commit": - revision = os.getenv("ARCH_REVISION") - - files = [] - if os.path.exists(filelist): - f = open(filelist, "r") - for line in f.readlines(): - files.append(line.rstrip()) - if not files: - # buildbot insists upon having at least one modified file (otherwise - # the prefix-stripping mechanism will ignore the change) - files = ["dummy"] - - if os.path.exists(commentfile): - comments = open(commentfile, "r").read() - else: - comments = "commit from arch" - - c = {'master': master, 'username': username, - 'revision': revision, 'comments': comments, 'files': files} - runner.sendchange(c, True) - - if os.path.exists(filelist): - os.unlink(filelist) - if os.path.exists(commentfile): - os.unlink(commentfile) diff --git a/master/docs/cfg-buildsteps.texinfo b/master/docs/cfg-buildsteps.texinfo index 164049d3e02..7963e8556bf 100644 --- a/master/docs/cfg-buildsteps.texinfo +++ b/master/docs/cfg-buildsteps.texinfo @@ -440,13 +440,10 @@ arguments are described on the following pages. * SVN:: * Darcs:: * Mercurial:: -* Arch:: -* Bazaar:: * Bzr:: * P4:: * Git:: * BitKeeper:: -* Monotone:: @end menu @node CVS @@ -761,59 +758,6 @@ update to the branch. @end table -@node Arch -@subsubsection Arch - -@cindex Arch Checkout -@bsindex buildbot.steps.source.Arch - -Because Arch is now deprecated in favor of bzr, this step is slated to be -removed in Buildbot-0.8.2. - -The @code{Arch} build step performs an @uref{http://gnuarch.org/, -Arch} checkout or update using the @code{tla} client. - -The step takes the following arguments: - -@table @code -@item url -(required): this specifies the URL at which the Arch source archive is -available. - -@item version -(required): this specifies which ``development line'' (like a branch) -should be used. This provides the default branch name, but individual -builds may specify a different one. - -@item archive -(optional): Each repository knows its own archive name. If this -parameter is provided, it must match the repository's archive name. -The parameter is accepted for compatibility with the @code{Bazaar} -step, below. - -@end table - -@node Bazaar -@subsubsection Bazaar - -@cindex Bazaar Checkout -@bsindex buildbot.steps.source.Bazaar - - -@code{Bazaar} is an alternate implementation of the Arch VC system, -which uses a client named @code{baz}. The checkout semantics are just -different enough from @code{tla} that there is a separate BuildStep for -it. - -Because Arch is now deprecated in favor of bzr, this step is slated to be -removed in Buildbot-0.8.2. - -It takes exactly the same arguments as @code{Arch}, except that the -@code{archive=} parameter is required. (baz does not emit the archive -name when you do @code{baz register-archive}, so we must provide it -ourselves). - - @node Bzr @subsubsection Bzr @@ -962,37 +906,6 @@ slash. @end table -@node Monotone -@subsubsection Monotone - -@cindex Monotone Checkout -@bsindex buildbot.steps.source.Monotone - -The @code{Monotone} build step gets source from a @uref{http://monotone.ca/, Monotone} -repository. Note that Monotone support in Buildbot is not currently maintained, has some -serious deficiencies, and is slated to be removed in Buildbot-0.8.2. If a maintainer steps -forward, this removal may be avoided. - -Note that this step is incapable of building the "latest" commit on any branch, -and will crash if made to do so. It must always be given an explicit revision. - -The step takes the following arguments: - -@table @code -@item server_addr -(required): the address of the server to pull from - -@item branch -(required): the branch to check out - -@item db_path -(required): the local database path to use - an absolute path - -@item monotone -the path to the @code{mtn} executable on the slave - -@end table - @node ShellCommand @subsection ShellCommand diff --git a/master/docs/cfg-changesources.texinfo b/master/docs/cfg-changesources.texinfo index 727e1b39a45..219bc73d901 100644 --- a/master/docs/cfg-changesources.texinfo +++ b/master/docs/cfg-changesources.texinfo @@ -92,14 +92,6 @@ hook) @item @code{contrib/googlecode_atom.py}'s GoogleCodeAtomPoller (polling the commit feed for a GoogleCode Mercurial repository) @end itemize -@item Arch/Bazaar -@itemize @bullet -@item pb.PBChangeSource (listening for connections from -@code{contrib/arch_buildbot.py} run in a commit hook) -@item change_hook in WebStatus ( -@code{status.web.change_hook}) -@end itemize - @item Bzr (the newer Bazaar) @itemize @bullet @item pb.PBChangeSource (listening for connections from diff --git a/master/docs/cmdline.texinfo b/master/docs/cmdline.texinfo index d0cdf1c3b2d..92bd82c0def 100644 --- a/master/docs/cmdline.texinfo +++ b/master/docs/cmdline.texinfo @@ -224,14 +224,14 @@ The @command{try} command also needs to know how to take the developer's current tree and extract the (revision, patch) source-stamp pair. Each VC system uses a different process, so you start by telling the @command{try} command which VC system you are -using, with an argument like @option{--vc=cvs} or @option{--vc=tla}. +using, with an argument like @option{--vc=cvs} or @option{--vc=git}. This can also be provided as @code{try_vc} in @file{.buildbot/options}. @c The order of this list comes from the end of scripts/tryclient.py -The following names are recognized: @code{cvs} @code{svn} @code{baz} -@code{tla} @code{bzr} @code{hg} @code{darcs} @code{git} @code{p4} +The following names are recognized: @code{cvs} @code{svn} +@code{bzr} @code{hg} @code{darcs} @code{git} @code{p4} @heading finding the top of the tree @@ -258,7 +258,7 @@ for each tree you use, so it may be more convenient to use the @code{try_topfile} approach instead. Other VC systems which work on full projects instead of individual -directories (tla, baz, darcs, monotone, mercurial, git) do not require +directories (darcs, 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. @@ -269,8 +269,7 @@ abort with an error message. @heading determining the branch name Some VC systems record the branch information in a way that ``try'' -can locate it, in particular Arch (both @command{tla} and -@command{baz}). For the others, if you are using something other than +can locate it. For the others, if you are using something other than the default branch, you will have to tell the buildbot which branch your tree is using. You can do this with either the @option{--branch} argument, or a @option{try_branch} entry in the @@ -304,19 +303,6 @@ the latest revision, then @emph{backwards} patches applied to bring it code changes), but this will still result in the correct tree being used for the build. -@item baz -@command{try} does a @code{baz tree-id} to determine the -fully-qualified version and patch identifier for the tree -(ARCHIVE/VERSION--patch-NN), and uses the VERSION--patch-NN component -as the base revision. It then does a @code{baz diff} to obtain the -patch. - -@item tla -@command{try} does a @code{tla tree-version} to get the -fully-qualified version identifier (ARCHIVE/VERSION), then takes the -first line of @code{tla logs --reverse} to figure out the base -revision. Then it does @code{tla changes --diffs} to obtain the patch. - @item bzr @command{try} does a @code{bzr revision-info} to find the base revision, then a @code{bzr diff -r$base..} to obtain the patch. @@ -361,7 +347,6 @@ the base revision. @c upstream repository. Perhaps we need to add a --remote option to @c specify the remote tracking branch to generate a diff against. -@c TODO: monotone @end table @heading waiting for results diff --git a/master/docs/concepts.texinfo b/master/docs/concepts.texinfo index 7c87a2319ed..f3d9201d90d 100644 --- a/master/docs/concepts.texinfo +++ b/master/docs/concepts.texinfo @@ -54,11 +54,11 @@ multiple branch tags, but there is always a default branch. The timestamp may be an actual timestamp (such as the -D option to CVS), or it may be a monotonically-increasing transaction number (such as the change number used by SVN and P4, or the revision number used by -Arch/Baz/Bazaar, or a labeled tag used in CVS)@footnote{many VC +Bazaar, or a labeled tag used in CVS)@footnote{many VC 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, Mercurial, and Git is +here}. The SHA1 revision ID used by 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. @@ -113,10 +113,7 @@ attributes of the builder and do not change over time. Others are more variable: each build will have a different value. The repository is changed over time by a sequence of Changes, each of which represents a single developer making changes to some set of files. These Changes -are cumulative@footnote{Monotone's @emph{multiple heads} feature -violates this assumption of cumulative Changes, but in most situations -the changes don't occur frequently enough for this to be a significant -problem}. +are cumulative. For normal builds, the Buildbot wants to get well-defined source trees that contain specific Changes, and exclude other Changes that may have @@ -184,28 +181,6 @@ depot-wide. When branches are used, the @code{p4base} and @code{defaultBranch} are concatenated together to produce the depot path. -@uref{http://wiki.gnuarch.org/, Arch} and -@uref{http://bazaar.canonical.com/, Bazaar} specify a repository by -URL, as well as a @code{version} which is kind of like a branch name. -Arch uses the word @code{archive} to represent the repository. Arch -lets you push changes from one archive to another, removing the strict -centralization required by CVS and SVN. It retains the distinction -between repository and working directory that most other VC systems -use. For complex multi-module directory structures, Arch has a -built-in @code{build config} layer with which the checkout process has -two steps. First, an initial bootstrap checkout is performed to -retrieve a set of build-config files. Second, one of these files is -used to figure out which archives/modules should be used to populate -subdirectories of the initial checkout. - -Builders which use Arch and Bazaar therefore have a static archive -@code{url}, and a default ``branch'' (which is a string that specifies -a complete category--branch--version triple). Each build can have its -own branch (the category--branch--version string) to override the -default, as well as a revision number (which is turned into a ---patch-NN suffix when performing the checkout). - - @uref{http://bazaar-vcs.org, Bzr} (which is a descendant of Arch/Bazaar, and is frequently referred to as ``Bazaar'') has the same sort of repository-vs-workspace model as Arch, but the repository data @@ -274,15 +249,12 @@ specified branch. @heading Who -Each Change has a @code{who} attribute, which specifies which -developer is responsible for the change. This is a string which comes -from a namespace controlled by the VC repository. Frequently this -means it is a username on the host which runs the repository, but not -all VC systems require this (Arch, for example, uses a fully-qualified -@code{Arch ID}, which looks like an email address, as does Darcs). -Each StatusNotifier will map the @code{who} attribute into something -appropriate for their particular means of communication: an email -address, an IRC handle, etc. +Each Change has a @code{who} attribute, which specifies which developer is +responsible for the change. This is a string which comes from a namespace +controlled by the VC repository. Frequently this means it is a username on the +host which runs the repository, but not all VC systems require this. Each +StatusNotifier will map the @code{who} attribute into something appropriate for +their particular means of communication: an email address, an IRC handle, etc. @heading Files @@ -354,8 +326,6 @@ consumed by the @code{computeSourceRevision} method in the appropriate @code{revision} is a large string, the output of @code{darcs changes --context} @item Mercurial @code{revision} is a short string (a hash ID), the output of @code{hg identify} -@item Arch/Bazaar -@code{revision} is the full revision ID (ending in --patch-%d) @item P4 @code{revision} is an int, the transaction number @item Git @@ -369,7 +339,7 @@ The Change might also have a @code{branch} attribute. This indicates 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, Monotone, and Git, the @code{branch} +For VC systems like CVS, 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 @@ -388,8 +358,6 @@ branch='branches/warner-newfeature', files=['src/foo.c'] branch='warner-newfeature', files=['src/foo.c'] @item Mercurial branch='warner-newfeature', files=['src/foo.c'] -@item Arch/Bazaar -branch='buildbot--usebranches--0', files=['buildbot/master.py'] @item Git branch='warner-newfeature', files=['src/foo.c'] @end table @@ -684,7 +652,7 @@ email address is a simple matter of appending despite the repository host being named ``cvs.project.org''), and some VC systems have full separation between the concept of a user and that of an account on the repository host (like Perforce). Some systems -(like Arch) put a full contact email address in every change. +(like Git) put a full contact email address in every change. To convert these names to addresses, the MailNotifier uses an EmailLookup object. This provides a .getAddress method which accepts a name and diff --git a/master/docs/examples/hello.cfg b/master/docs/examples/hello.cfg index d6642a247a5..2f25f3f9e54 100644 --- a/master/docs/examples/hello.cfg +++ b/master/docs/examples/hello.cfg @@ -3,7 +3,7 @@ from buildbot import master from buildbot.buildslave import BuildSlave from buildbot.process import factory -from buildbot.steps.source import CVS, SVN, Darcs, Arch +from buildbot.steps.source import CVS, SVN, Darcs from buildbot.steps.shell import Configure, Compile, Test from buildbot.status import html, client from buildbot.changes.pb import PBChangeSource @@ -61,23 +61,6 @@ if True: } c['builders'].append(b1) -if True: - f = factory.BuildFactory() - f.addStep(Arch(url="http://localhost/~warner/hello-arch", - version="gnu-hello--release--2.1.1", - mode="copy", - )) - f.addStep(Configure(command=["/bin/sh", "./configure"])) - f.addStep(Compile()) - f.addStep(Test(command=["make", "check"])) - b1 = {"name": "arch-hello", - "slavename": "bot1", - "builddir": "arch-hello", - "factory": f, - } - c['builders'].append(b1) - - c['projectName'] = "Hello" c['projectURL'] = "http://www.hello.example.com" c['buildbotURL'] = "http://localhost:8080" diff --git a/slave/buildslave/commands/arch.py b/slave/buildslave/commands/arch.py deleted file mode 100644 index af8fc624d06..00000000000 --- a/slave/buildslave/commands/arch.py +++ /dev/null @@ -1,206 +0,0 @@ -import os -import re - -from twisted.python import log - -from buildslave.commands.base import SourceBaseCommand, AbandonChain -from buildslave import runprocess -from buildslave.commands import utils - - -class Arch(SourceBaseCommand): - """Arch-specific (tla-specific) VC operation. In addition to the - arguments handled by SourceBaseCommand, this command reads the following keys: - - ['url'] (required): the repository string - ['version'] (required): which version (i.e. branch) to retrieve - ['revision'] (optional): the 'patch-NN' argument to check out - ['archive']: the archive name to use. If None, use the archive's default - ['build-config']: if present, give to 'tla build-config' after checkout - """ - - header = "arch operation" - buildconfig = None - - def setup(self, args, no_getCommand=False): - SourceBaseCommand.setup(self, args) - - # avoid doing this if used via a subclass - if not no_getCommand: - self.vcexe = utils.getCommand("tla") - - self.archive = args.get('archive') - self.url = args['url'] - self.version = args['version'] - self.revision = args.get('revision') - self.buildconfig = args.get('build-config') - self.sourcedata = "%s\n%s\n%s\n" % (self.url, self.version, - self.buildconfig) - - def sourcedirIsUpdateable(self): - # Arch cannot roll a directory backwards, so if they ask for a - # specific revision, clobber the directory. Technically this - # could be limited to the cases where the requested revision is - # later than our current one, but it's too hard to extract the - # current revision from the tree. - return (not self.revision and - not self.sourcedirIsPatched() and - os.path.isdir(os.path.join(self.builder.basedir, - self.srcdir, "{arch}"))) - - def doVCUpdate(self): - # update: possible for mode in ('copy', 'update') - d = os.path.join(self.builder.basedir, self.srcdir) - command = [self.vcexe, 'replay'] - if self.revision: - command.append(self.revision) - c = runprocess.RunProcess(self.builder, command, d, - sendRC=False, timeout=self.timeout, - maxTime=self.maxTime, usePTY=False) - self.command = c - return c.start() - - def doVCFull(self): - # to do a checkout, we must first "register" the archive by giving - # the URL to tla, which will go to the repository at that URL and - # figure out the archive name. tla will tell you the archive name - # when it is done, and all further actions must refer to this name. - - command = [self.vcexe, 'register-archive', '--force', self.url] - c = runprocess.RunProcess(self.builder, command, self.builder.basedir, - sendRC=False, keepStdout=True, timeout=self.timeout, - maxTime=self.maxTime, usePTY=False) - self.command = c - d = c.start() - d.addCallback(self._abandonOnFailure) - d.addCallback(self._didRegister, c) - return d - - def _didRegister(self, res, c): - # find out what tla thinks the archive name is. If the user told us - # to use something specific, make sure it matches. - r = re.search(r'Registering archive: (\S+)\s*$', c.stdout) - if r: - msg = "tla reports archive name is '%s'" % r.group(1) - log.msg(msg) - self.builder.sendUpdate({'header': msg+"\n"}) - if self.archive and r.group(1) != self.archive: - msg = (" mismatch, we wanted an archive named '%s'" - % self.archive) - log.msg(msg) - self.builder.sendUpdate({'header': msg+"\n"}) - raise AbandonChain(-1) - self.archive = r.group(1) - assert self.archive, "need archive name to continue" - return self._doGet() - - def _doGet(self): - ver = self.version - if self.revision: - ver += "--%s" % self.revision - command = [self.vcexe, 'get', '--archive', self.archive, - '--no-pristine', - ver, self.srcdir] - c = runprocess.RunProcess(self.builder, command, self.builder.basedir, - sendRC=False, timeout=self.timeout, - maxTime=self.maxTime, usePTY=False) - self.command = c - d = c.start() - d.addCallback(self._abandonOnFailure) - if self.buildconfig: - d.addCallback(self._didGet) - return d - - def _didGet(self, res): - d = os.path.join(self.builder.basedir, self.srcdir) - command = [self.vcexe, 'build-config', self.buildconfig] - c = runprocess.RunProcess(self.builder, command, d, - sendRC=False, timeout=self.timeout, - maxTime=self.maxTime, usePTY=False) - self.command = c - d = c.start() - d.addCallback(self._abandonOnFailure) - return d - - def parseGotRevision(self): - # using code from tryclient.TlaExtractor - # 'tla logs --full' gives us ARCHIVE/BRANCH--REVISION - # 'tla logs' gives us REVISION - command = [self.vcexe, "logs", "--full", "--reverse"] - c = runprocess.RunProcess(self.builder, command, - os.path.join(self.builder.basedir, self.srcdir), - environ=self.env, timeout=self.timeout, - sendStdout=False, sendStderr=False, sendRC=False, - keepStdout=True, usePTY=False) - d = c.start() - def _parse(res): - tid = c.stdout.split("\n")[0].strip() - slash = tid.index("/") - dd = tid.rindex("--") - #branch = tid[slash+1:dd] - baserev = tid[dd+2:] - return baserev - d.addCallback(_parse) - return d - - -class Bazaar(Arch): - """Bazaar (/usr/bin/baz) is an alternative client for Arch repositories. - It is mostly option-compatible, but archive registration is different - enough to warrant a separate Command. - - ['archive'] (required): the name of the archive being used - """ - - def setup(self, args): - Arch.setup(self, args, no_getCommand=True) - self.vcexe = utils.getCommand("baz") - # baz doesn't emit the repository name after registration (and - # grepping through the output of 'baz archives' is too hard), so we - # require that the buildmaster configuration to provide both the - # archive name and the URL. - self.archive = args['archive'] # required for Baz - self.sourcedata = "%s\n%s\n%s\n" % (self.url, self.version, - self.buildconfig) - - # in _didRegister, the regexp won't match, so we'll stick with the name - # in self.archive - - def _doGet(self): - # baz prefers ARCHIVE/VERSION. This will work even if - # my-default-archive is not set. - ver = self.archive + "/" + self.version - if self.revision: - ver += "--%s" % self.revision - command = [self.vcexe, 'get', '--no-pristine', - ver, self.srcdir] - c = runprocess.RunProcess(self.builder, command, self.builder.basedir, - sendRC=False, timeout=self.timeout, - maxTime=self.maxTime, usePTY=False) - self.command = c - d = c.start() - d.addCallback(self._abandonOnFailure) - if self.buildconfig: - d.addCallback(self._didGet) - return d - - def parseGotRevision(self): - # using code from tryclient.BazExtractor - command = [self.vcexe, "tree-id"] - c = runprocess.RunProcess(self.builder, command, - os.path.join(self.builder.basedir, self.srcdir), - environ=self.env, timeout=self.timeout, - sendStdout=False, sendStderr=False, sendRC=False, - keepStdout=True, usePTY=False) - d = c.start() - def _parse(res): - tid = c.stdout.strip() - slash = tid.index("/") - dd = tid.rindex("--") - #branch = tid[slash+1:dd] - baserev = tid[dd+2:] - return baserev - d.addCallback(_parse) - return d - - diff --git a/slave/buildslave/commands/base.py b/slave/buildslave/commands/base.py index 3a5d101f5e3..a7631e4d650 100644 --- a/slave/buildslave/commands/base.py +++ b/slave/buildslave/commands/base.py @@ -16,7 +16,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.9" +command_version = "2.11" # version history: # >=1.17: commands are interruptable @@ -43,6 +43,7 @@ # >= 2.8: added username and password args to SVN class # >= 2.9: add depth arg to SVN class # >= 2.10: CVS can handle 'extra_options' and 'export_options' +# >= 2.11: Arch, Bazaar, and Monotone removed class Command: implements(ISlaveCommand) diff --git a/slave/buildslave/commands/monotone.py b/slave/buildslave/commands/monotone.py deleted file mode 100644 index 01469d3b160..00000000000 --- a/slave/buildslave/commands/monotone.py +++ /dev/null @@ -1,111 +0,0 @@ -import os - -from buildslave.commands.base import SourceBaseCommand -from buildslave import runprocess -from buildslave.commands import utils - - -class Monotone(SourceBaseCommand): - """Monotone-specific VC operation. In addition to the arguments handled - by SourceBaseCommand, this command reads the following keys: - - ['server_addr'] (required): the address of the server to pull from - ['branch'] (required): the branch the revision is on - ['db_path'] (required): the local database path to use - ['revision'] (required): the revision to check out (None not allowed) - ['monotone']: path to monotone executable - """ - - header = "monotone operation" - - def setup(self, args): - SourceBaseCommand.setup(self, args) - self.server_addr = args["server_addr"] - self.branch = args["branch"] - self.db_path = args["db_path"] - self.revision = args["revision"] - self.monotone = args.get("monotone", utils.getCommand('mtn')) - self._made_fulls = False - self._pull_timeout = self.timeout - - def _makefulls(self): - if not self._made_fulls: - basedir = self.builder.basedir - self.full_db_path = os.path.join(basedir, self.db_path) - self.full_srcdir = os.path.join(basedir, self.srcdir) - self._made_fulls = True - - def sourcedirIsUpdateable(self): - self._makefulls() - return (not self.sourcedirIsPatched() and - os.path.isfile(self.full_db_path) and - os.path.isdir(os.path.join(self.full_srcdir, "MT"))) - - def doVCUpdate(self): - return self._withFreshDb(self._doUpdate) - - def _doUpdate(self): - # update: possible for mode in ('copy', 'update') - command = [self.monotone, "update", - "-r", self.revision, - "-b", self.branch] - c = runprocess.RunProcess(self.builder, command, self.srcdir, - sendRC=False, timeout=self.timeout, - maxTime=self.maxTime, usePTY=False) - self.command = c - return c.start() - - def doVCFull(self): - return self._withFreshDb(self._doFull) - - def _doFull(self): - command = [self.monotone, "--db=" + self.full_db_path, - "checkout", - "-r", self.revision, - "-b", self.branch, - self.srcdir] - c = runprocess.RunProcess(self.builder, command, self.builder.basedir, - sendRC=False, timeout=self.timeout, - maxTime=self.maxTime, usePTY=False) - self.command = c - return c.start() - - def _withFreshDb(self, callback): - self._makefulls() - # first ensure the db exists and is usable - if os.path.isfile(self.full_db_path): - # already exists, so run 'db migrate' in case monotone has been - # upgraded under us - command = [self.monotone, "db", "migrate", - "--db=" + self.full_db_path] - else: - # We'll be doing an initial pull, so up the timeout to 3 hours to - # make sure it will have time to complete. - self._pull_timeout = max(self._pull_timeout, 3 * 60 * 60) - self.sendStatus({"header": "creating database %s\n" - % (self.full_db_path,)}) - command = [self.monotone, "db", "init", - "--db=" + self.full_db_path] - c = runprocess.RunProcess(self.builder, command, self.builder.basedir, - sendRC=False, timeout=self.timeout, - maxTime=self.maxTime, usePTY=False) - self.command = c - d = c.start() - d.addCallback(self._abandonOnFailure) - d.addCallback(self._didDbInit) - d.addCallback(self._didPull, callback) - return d - - def _didDbInit(self, res): - command = [self.monotone, "--db=" + self.full_db_path, - "pull", "--ticker=dot", self.server_addr, self.branch] - c = runprocess.RunProcess(self.builder, command, self.builder.basedir, - sendRC=False, timeout=self._pull_timeout, - maxTime=self.maxTime, usePTY=False) - self.sendStatus({"header": "pulling %s from %s\n" - % (self.branch, self.server_addr)}) - self.command = c - return c.start() - - def _didPull(self, res, callback): - return callback() diff --git a/slave/buildslave/commands/registry.py b/slave/buildslave/commands/registry.py index 7e721180cd8..a0eb5359e92 100644 --- a/slave/buildslave/commands/registry.py +++ b/slave/buildslave/commands/registry.py @@ -10,10 +10,7 @@ "bk" : "buildslave.commands.bk.BK", "cvs" : "buildslave.commands.cvs.CVS", "darcs" : "buildslave.commands.darcs.Darcs", - "monotone" : "buildslave.commands.monotone.Monotone", "git" : "buildslave.commands.git.Git", - "arch" : "buildslave.commands.arch.Arch", - "bazaar" : "buildslave.commands.arch.Bazaar", # subclass of Arch "bzr" : "buildslave.commands.bzr.Bzr", "hg" : "buildslave.commands.hg.Mercurial", "p4" : "buildslave.commands.p4.P4", diff --git a/slave/buildslave/test/unit/test_commands_arch.py b/slave/buildslave/test/unit/test_commands_arch.py deleted file mode 100644 index 8221fc52158..00000000000 --- a/slave/buildslave/test/unit/test_commands_arch.py +++ /dev/null @@ -1,120 +0,0 @@ -import os - -from twisted.trial import unittest -from twisted.python import runtime - -from buildslave.test.fake.runprocess import Expect -from buildslave.test.util.sourcecommand import SourceCommandTestMixin -from buildslave.commands import arch - -class TestArch(SourceCommandTestMixin, unittest.TestCase): - - def setUp(self): - self.setUpCommand() - - def tearDown(self): - self.tearDownCommand() - - def test_simple(self): - self.patch_getCommand('tla', 'path/to/tla') - self.clean_environ() - self.make_command(arch.Arch, dict( - workdir='workdir', - mode='copy', - url='ftp://somewhere.com/pub/archive', - version='mainline', - revision='patch-22', - archive='funarchive', - )) - - exp_environ = dict(PWD='.', LC_MESSAGES='C') - expects = [ - Expect([ 'clobber', 'workdir' ], - self.basedir) - + 0, - Expect([ 'clobber', 'source' ], - self.basedir) - + 0, - Expect(['path/to/tla', 'register-archive', '--force', - 'ftp://somewhere.com/pub/archive'], - self.basedir, - sendRC=False, timeout=120, usePTY=False, keepStdout=True) - + { 'stdout' : 'Registering archive: funarchive\n' } - + 0, - Expect(['path/to/tla', 'get', '--archive', 'funarchive', - '--no-pristine', 'mainline--patch-22', 'source'], - self.basedir, - sendRC=False, usePTY=False, timeout=120) - + { 'stdout' : '9753\n' } - + 0, - Expect(['path/to/tla', 'logs', '--full', '--reverse'], - self.basedir_source, - timeout=120, sendRC=False, usePTY=False, keepStdout=True, - sendStdout=False, sendStderr=False, environ=exp_environ) - + { 'stdout' : 'funarchive/mainline--patch-22\n' } - + 0, - Expect([ 'copy', 'source', 'workdir'], - self.basedir) - + 0, - ] - self.patch_runprocess(*expects) - - d = self.run_command() - d.addCallback(self.check_sourcedata, "ftp://somewhere.com/pub/archive\nmainline\nNone\n") - return d - -class TestBazaar(SourceCommandTestMixin, unittest.TestCase): - - def setUp(self): - self.setUpCommand() - - def tearDown(self): - self.tearDownCommand() - - def test_simple(self): - self.patch_getCommand('baz', 'path/to/baz') - self.clean_environ() - self.make_command(arch.Bazaar, dict( - workdir='workdir', - mode='copy', - url='ftp://somewhere.com/pub/archive', - version='mainline', - revision='patch-22', - archive='funarchive', - )) - - exp_environ = dict(PWD='.', LC_MESSAGES='C') - expects = [ - Expect([ 'clobber', 'workdir' ], - self.basedir) - + 0, - Expect([ 'clobber', 'source' ], - self.basedir) - + 0, - Expect(['path/to/baz', 'register-archive', '--force', - 'ftp://somewhere.com/pub/archive'], - self.basedir, - sendRC=False, timeout=120, usePTY=False, keepStdout=True) - + { 'stdout' : 'Registering archive: funarchive\n' } - + 0, - Expect(['path/to/baz', 'get', '--no-pristine', - 'funarchive/mainline--patch-22', 'source'], - self.basedir, - sendRC=False, usePTY=False, timeout=120) - + { 'stdout' : '9753\n' } - + 0, - Expect(['path/to/baz', 'tree-id'], - self.basedir_source, - timeout=120, sendRC=False, usePTY=False, keepStdout=True, - sendStdout=False, sendStderr=False, environ=exp_environ) - + { 'stdout' : 'funarchive/mainline--patch-22\n' } - + 0, - Expect([ 'copy', 'source', 'workdir'], - self.basedir) - + 0, - ] - self.patch_runprocess(*expects) - - d = self.run_command() - d.addCallback(self.check_sourcedata, "ftp://somewhere.com/pub/archive\nmainline\nNone\n") - return d diff --git a/slave/buildslave/test/unit/test_commands_monotone.py b/slave/buildslave/test/unit/test_commands_monotone.py deleted file mode 100644 index 4cb1c7752bf..00000000000 --- a/slave/buildslave/test/unit/test_commands_monotone.py +++ /dev/null @@ -1,63 +0,0 @@ -import os - -from twisted.trial import unittest -from twisted.python import runtime - -from buildslave.test.fake.runprocess import Expect -from buildslave.test.util.sourcecommand import SourceCommandTestMixin -from buildslave.commands import monotone - -class TestMonotone(SourceCommandTestMixin, unittest.TestCase): - - def setUp(self): - self.setUpCommand() - - def tearDown(self): - self.tearDownCommand() - - def test_simple(self): - self.patch_getCommand('mtn', 'path/to/mtn') - self.clean_environ() - self.make_command(monotone.Monotone, dict( - workdir='workdir', - mode='copy', - revision='e831aa7c1baa0c545c5d1917364ff299cd79e174', # None is not supported - server_addr='monotone.ca', - branch='net.venge.monotone', - db_path='/var/slave/mtn/monotone.db', - )) - - exp_environ = dict(PWD='.', LC_MESSAGES='C') - expects = [ - Expect([ 'clobber', 'workdir' ], - self.basedir) - + 0, - Expect([ 'clobber', 'source' ], - self.basedir) - + 0, - Expect(['path/to/mtn', 'db', 'init', '--db=/var/slave/mtn/monotone.db'], - self.basedir, - sendRC=False, timeout=120, usePTY=False) - + 0, - Expect(['path/to/mtn', '--db=/var/slave/mtn/monotone.db', 'pull', - '--ticker=dot', 'monotone.ca', 'net.venge.monotone'], - self.basedir, - sendRC=False, timeout=3*60*60, usePTY=False) - + 0, - Expect(['path/to/mtn', '--db=/var/slave/mtn/monotone.db', 'checkout', - '-r', 'e831aa7c1baa0c545c5d1917364ff299cd79e174', '-b', 'net.venge.monotone', - 'source'], - self.basedir, - sendRC=False, timeout=120, usePTY=False) - + 0, - Expect([ 'copy', 'source', 'workdir'], - self.basedir) - + 0, - ] - self.patch_runprocess(*expects) - - d = self.run_command() - # TODO: monotone doesn't believe in sourcedata? - d.addCallback(self.check_sourcedata, "") - return d -