[Buildbot-commits] buildbot/buildbot/scripts runner.py, 1.50, 1.51 tryclient.py, 1.18, 1.19
Brian Warner
warner at users.sourceforge.net
Tue Feb 6 20:36:11 UTC 2007
Update of /cvsroot/buildbot/buildbot/buildbot/scripts
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9373/buildbot/scripts
Modified Files:
runner.py tryclient.py
Log Message:
[project @ implement 'try --diff', might not work yet, still needs docs and tests]
Original author: warner at allmydata.com
Date: 2007-02-06 19:06:08
Index: runner.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/runner.py,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- runner.py 9 Dec 2006 07:09:41 -0000 1.50
+++ runner.py 6 Feb 2007 20:36:09 -0000 1.51
@@ -585,7 +585,15 @@
["master", "m", None,
"Location of the buildmaster's PBListener (host:port)"],
["passwd", None, None, "password for PB authentication"],
-
+
+ ["diff", None, None,
+ "Filename of a patch to use instead of scanning a local tree. Use '-' for stdin."],
+ ["patchlevel", "p", 0,
+ "Number of slashes to remove from patch pathnames, like the -p option to 'patch'"],
+
+ ["baserev", None, None,
+ "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"],
["branch", None, None,
@@ -607,6 +615,9 @@
def opt_builder(self, option):
self['builders'].append(option)
+ def opt_patchlevel(self, option):
+ self['patchlevel'] = int(option)
+
def getSynopsis(self):
return "Usage: buildbot try [options]"
Index: tryclient.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/scripts/tryclient.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- tryclient.py 23 Jan 2007 05:49:58 -0000 1.18
+++ tryclient.py 6 Feb 2007 20:36:09 -0000 1.19
@@ -341,28 +341,43 @@
self.bsid = "%d-%s" % (time.time(), random.randint(0, 1000000))
# common options
- vc = self.getopt("vc", "try_vc")
branch = self.getopt("branch", "try_branch")
- if vc in ("cvs", "svn"):
- # we need to find the tree-top
- topdir = self.getopt("try_topdir", "try_topdir")
- if topdir:
- treedir = os.path.expanduser(topdir)
+ difffile = self.config.get("diff")
+ if difffile:
+ baserev = self.config.get("baserev")
+ if difffile == "-":
+ diff = sys.stdin.read()
else:
- topfile = self.getopt("try-topfile", "try_topfile")
- treedir = getTopdir(topfile)
+ diff = open(difffile,"r").read()
+ patch = (self.config['patchlevel'], diff)
+ ss = SourceStamp(branch, baserev, patch)
+ d = defer.succeed(ss)
else:
- treedir = os.getcwd()
- d = getSourceStamp(vc, treedir, branch)
+ vc = self.getopt("vc", "try_vc")
+ if vc in ("cvs", "svn"):
+ # we need to find the tree-top
+ topdir = self.getopt("try_topdir", "try_topdir")
+ if topdir:
+ treedir = os.path.expanduser(topdir)
+ else:
+ topfile = self.getopt("try-topfile", "try_topfile")
+ treedir = getTopdir(topfile)
+ else:
+ treedir = os.getcwd()
+ d = getSourceStamp(vc, treedir, branch)
d.addCallback(self._createJob_1)
return d
+
def _createJob_1(self, ss):
self.sourcestamp = ss
if self.connect == "ssh":
patchlevel, diff = ss.patch
+ revspec = ss.revision
+ if revspec is None:
+ revspec = ""
self.jobfile = createJobfile(self.bsid,
- ss.branch or "", ss.revision,
+ ss.branch or "", revspec,
patchlevel, diff,
self.builderNames)
More information about the Commits
mailing list