|
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 51 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # # Copyright Buildbot Team Members
"""CVS-specific VC operation. In addition to the arguments handled by SourceBaseCommand, this command reads the following keys:
['cvsroot'] (required): the CVSROOT repository string ['cvsmodule'] (required): the module to be retrieved ['branch']: a '-r' tag or branch name to use for the checkout/update ['login']: a string for use as a password to 'cvs login' ['global_options']: a list of strings to use before the CVS verb ['checkout_options']: a list of strings to use after checkout, but before revision and branch specifiers ['checkout_options']: a list of strings to use after export, but before revision and branch specifiers ['extra_options']: a list of strings to use after export and checkout, but before revision and branch specifiers """
self.branch)
os.path.isdir(os.path.join(self.builder.basedir, self.srcdir, "CVS")))
# need to do a 'cvs login' command first d = self.builder.basedir command = ([cvs, '-d', self.cvsroot] + self.global_options + ['login']) c = runprocess.RunProcess(self.builder, command, d, sendRC=False, timeout=self.timeout, maxTime=self.maxTime, initialStdin=self.login+"\n", logEnviron=self.logEnviron,usePTY=False) self.command = c d = c.start() d.addCallback(self._abandonOnFailure) d.addCallback(self._didLogin) return d else:
# now we really start
cvs = self.getCommand("cvs") d = os.path.join(self.builder.basedir, self.srcdir) command = [cvs, '-z3'] + self.global_options + ['update', '-dP'] if self.branch: command += ['-r', self.branch] if self.revision: command += ['-D', self.revision] c = runprocess.RunProcess(self.builder, command, d, sendRC=False, timeout=self.timeout, maxTime=self.maxTime, logEnviron=self.logEnviron, usePTY=False) self.command = c return c.start()
verb = "export" else: self.global_options + [verb, '-d', self.srcdir])
else: command += self.export_options
command += ['-r', self.branch] command += ['-D', self.revision]
sendRC=False, timeout=self.timeout, maxTime=self.maxTime, logEnviron=self.logEnviron, usePTY=False)
# CVS does not have any kind of revision stamp to speak of. We return # the current timestamp as a best-effort guess, but this depends upon # the local system having a clock that is # reasonably-well-synchronized with the repository.
|