[p4python] can't seem to pass a changeList # as an argument top4c.run_add()

Smith, Jeff jsmith at medplus.com
Mon Aug 15 13:45:03 PDT 2005


I think the problem is that you've passed it one argument
	-c 124 c:\p4\uds\art\game\locations\global\ftree\empty_file
and you should pass in three
	-c
	124
	c:\p4\uds\art\game\locations\global\ftree\empty_file

You should use
	cmdResult = p4Session.run_add( '-c', cLNum, f )

Jeff

P.S. Note this is untested and confirmation is left as an exercise for
the reader :-)

-----Original Message-----
From: John Burk [mailto:jburk at radical.ca] 
Sent: Monday, August 15, 2005 4:34 PM
To: p4python at perforce.com
Subject: [p4python] can't seem to pass a changeList # as an argument
top4c.run_add()


Python: ActivePython 2.4.1 Build 247
p4Python: P4Python-0.6.win32-py2.4.exe

I can successfully open files for add to the default changeList, but I'm
unable to open them for add to a specific changeList.


	  cLNum = newChangeList( p4Session,
				 "adding new empty files to game at " +
gameRoot )

        for f in newFiles:
            cmdArgs = '-c' + cLNum + ' ' + f
            print "cmdArgs: " cmdArgs
            try:
                cmdResult = p4Session.run_add( f )
                print cmdResult
            except p4.P4Error:
                for e in p4Session.errors:



All well and good, here's the output from the above:

	cmdArgs: -c 119
c:\p4\uds\art\game\locations\global\ftree\empty_file
	['//uds/art/game/locations/global/ftree/empty_file#1 - opened
for add']


But if I try and run:

      cmdResult = p4Session.run_add( cmdArgs )

I get:

	cmdArgs:-c 124
c:\p4\uds\art\game\locations\global\ftree\empty_file
	Usage: add/edit/delete [-c changelist#] [ -f ] [-t type]
files...
	Missing/wrong number of arguments.

ChangeList #124 does indeed exist:

	C:\P4\uds>p4 describe 124
	Change 124 by jburk at jburk-atgPC on 2005/08/15 13:25:05 *pending*

        adding new empty files to game at c:\p4\uds

	Affected files ...



Any ideas?

John Burk



_______________________________________________
p4python mailing list
p4python at maillist.perforce.com
http://maillist.perforce.com/mailman/listinfo/p4python




More information about the p4python mailing list