0

I get a changelist number and I am able to add the files to the changelist

>>> createdCLNumber
'1157545'
>>> p4.run_add("-c", createdCLNumber, "/Users/ciasto/ciasto_piekarz/sandbox/main/upgrade_tools/upgrade_gitlab")
['//depot/td/main/bin/upgrade_gitlab#1 - currently opened for add']

but when I try to submit them I get the error.

>>> p4.run_submit(changeList)
P4.P4Exception: [P4#run] Errors during command execution( "p4 submit -i" )

        [Error]: 'No files to submit.'
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197

1 Answers1

0

If you want to submit a numbered changelist (implied by the fact that you used p4 add -c CHANGELIST), do:

p4 submit -c CHANGELIST

See p4 help submit:

submit -- Submit open files to the depot

p4 submit [-Af -r -s -f option --noretransfer 0|1]
p4 submit [-Af -r -s -f option] file
p4 submit [-Af -r -f option] -d description
p4 submit [-Af -r -f option] -d description file
p4 submit [-Af -r -f option --noretransfer 0|1] -c changelist#
p4 submit -e shelvedChange#
p4 submit -i [-Af -r -s -f option]
          --parallel=threads=N[,batch=N][,min=N]

If you only specify a single argument, it's interpreted as a file path:

p4 submit [options] file

To specify a changelist you want this form:

p4 submit [options] -c changelist#
Samwise
  • 68,105
  • 3
  • 30
  • 44
  • if this works I am going to wrap this in `python.Subprocess` instead of using `p4python` api – Ciasto piekarz Jun 02 '20 at 15:56
  • Note that the P4Python version would just be `p4.run_submit("-c", changeList)`. Everything in P4Python just works exactly like the CLI commands. – Samwise Jun 02 '20 at 15:57
  • Lets not confuse few things , when I added files to p4 I ran `p4.run_add("-c", createdCLNumber, [file/path])` which I believe is equivalent to `p4 add -c 1157545 /Users/ciasto/ciasto_piekarz/sandbox/main/upgrade_tools/upgrade_gitlab` . later when we submit its only the number passed to p4. i.e. `p4 submit -c 1157545` inbetween add and submit I did one more thing I didnt found on documentaiton examples, i.e. `changeList['Files'] = ["file/path/file/on/disk"]` then I ran submit. this changeList was what I passed to `p4.save_change` to get the changelistNumber – Ciasto piekarz Jun 02 '20 at 16:08
  • That doesn't actually work because you didn't run the command that updates the changelist. But you're also making this way too complicated; you don't need a numbered changelist for this workflow at all. – Samwise Jun 02 '20 at 16:13
  • 1
    Protip: instead of posting five different questions about five different subsets of a problem you've overcomplicated, you might be able to post a single question about the thing you're actually trying to do (e.g. "I am trying to add a file") and get the simple solution. :) – Samwise Jun 02 '20 at 16:14
  • 1
    I just want you to be the future Lead or moderator at Stackoverflow. PS: with the changelist number it worked for me – Ciasto piekarz Jun 02 '20 at 16:16