Got it working! thanks for the help. While the revert is definitely needed in the script, setting a breakpoint after fetch_change showed me that the field 'Client' was what I was after. This is the modified script.
Two minor issues, but aren't big deals... The reconcile takes a long time and I get no output to the console window in P4V from my print statements until the entire script is run. I don't know if there's a way to pipe that output back to P4V.
import os
import sys
from P4 import P4
clNum = sys.argv[1]
newWS = sys.argv[2]
working_dir = sys.argv[3]
os.chdir(working_dir)
p4 = P4()
try:
with p4.connect():
try:
print("Reconciling offline work from ", working_dir)
p4.run_reconcile('-c', clNum, '-e', '-a', '-d')
except P4.P4Exception:
for e in p4.errors:
print(e)
print("Shelving Files")
p4.run_shelve('-f', '-a leaveunchanged', '-c', clNum)
print("Reverting...")
p4.run_revert("-w", "-c", clNum, "//...")
change = p4.fetch_change(clNum)
print("Assigning changelist ", clNum, " to client: ", newWS)
change["Client"] = newWS
print("Saving changelist...")
p4.save_change(change)
except P4.P4Exception:
for e in p4.errors:
print(e)
print("Complete.")