[Buildbot-commits] buildbot/buildbot/slave commands.py,1.40,1.41

Brian Warner warner at users.sourceforge.net
Fri Apr 7 04:14:59 UTC 2006


Update of /cvsroot/buildbot/buildbot/buildbot/slave
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30329/buildbot/slave

Modified Files:
	commands.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-483
Creator:  Brian Warner <warner at lothar.com>

SF#1219384: add arguments to p4poller/P4Sync

	* buildbot/changes/p4poller.py (P4Source): add new arguments:
	password, p4 binary, pollinterval, maximum history to check.
	Patch from an anonymous sf.net contributor, SF#1219384.
	* buildbot/process/step.py (P4Sync.__init__): add username,
	password, and client arguments.
	* buildbot/slave/commands.py (P4Sync): same


Index: commands.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- commands.py	22 Oct 2005 22:41:59 -0000	1.40
+++ commands.py	7 Apr 2006 04:14:57 -0000	1.41
@@ -1226,7 +1226,10 @@
     environment. The only thing which comes from the master is P4PORT.
     'mode' is required to be 'copy'.
 
-    ['p4port'] (required): host:port to put in env['P4PORT']
+    ['p4port'] (required): host:port for server to access
+    ['p4user'] (optional): user to use for access
+    ['p4passwd'] (optional): passwd to try for the user
+    ['p4client'] (optional): client spec to use
     """
 
     header = "p4 sync"
@@ -1234,15 +1237,28 @@
     def setup(self, args):
         SourceBase.setup(self, args)
         self.p4port = args['p4port']
+        self.p4user = args['p4user']
+        self.p4passwd = args['p4passwd']
+        self.p4client = args['p4client']
         
     def sourcedirIsUpdateable(self):
         return True
 
     def doVCUpdate(self):
-        # TODO: revision
         d = os.path.join(self.builder.basedir, self.srcdir)
-        command = ['p4', 'sync']
-        env = {'P4PORT': self.p4port}
+        command = ['p4']
+        if self.p4port:
+            command.extend(['-p', self.p4port])
+        if self.p4user:
+            command.extend(['-u', self.p4user])
+        if self.p4passwd:
+            command.extend(['-P', self.p4passwd])
+        if self.p4client:
+            command.extend(['-c', self.p4client])
+        command.extend(['sync'])
+        if self.revision:
+            command.extend(['@' + self.revision])
+        env = {}
         c = ShellCommand(self.builder, command, d, environ=env,
                          sendRC=False, timeout=self.timeout)
         self.command = c





More information about the Commits mailing list