Last active
September 4, 2024 00:58
-
-
Save positron/8674615 to your computer and use it in GitHub Desktop.
Create an empty perforce changelist in p4python and save the changelist number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from P4 import P4 | |
client = P4() | |
# set client.port, client.client, etc here | |
change = client.fetch_change() | |
change['Files'] = [] # this contains all the files in default otherwise | |
ret = client.save_change(change) # ['Change 1234 created.'] | |
new_cl = ret.split()[1] | |
# now you can do stuff like | |
client.run_add('-c', new_cl, 'path/to/file.txt') | |
# or | |
client.run_integrate(['-c' + new_cl, '//path/from/...', '//path/to/...']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment