P4Python - Create a pending changelist and keep default pending
Question: I use

    
    
    change = P4.fetch_change()
    change['Description'] = Description
    result = p4.save_change(change)
    

but it will move my default file into this changelist.

is there has any way to just create empty pending changelist and keep my file
in the default?


Answer: A numbered pending changelist is created by saving a changelist 'form', which
in your program is identified by the Python 'change' variable.

The contents of this changelist form are up to you, but in this particular
snippet you are populating the changelist form by running the P4Python
`fetch_change()` method.

That is, you're asking Perforce to create a pending changelist form for you.

When you ask Perforce to create a pending changelist form for you, it will
automatically include all of the files that are open in your default
changelist as part of the new changelist form.

But that is not required; that is just the default behavior.

Here, it is instructive to run `p4 change -o` from the command line, with
several of your files already open in the default changelist. You will see
that Perforce automatically includes those files in the generated pending
changelist form.

If, instead of running `P4.fetch_change()` to initialize your pending
changelist form, you create your pending changelist form from scratch, you can
create a pending changelist form which has **NO** files in the form, and then
your new pending changelist will be empty (that is, it will contain no files).

Or, you can run `P4.fetch_change()` to initialize your `change` variable, but
then before you call `save_change` you can remove the files from the change
variable, and leave only the description and other identifying information in
the form.

Either way, the important thing is that when you call `save_change()`, the
files that will be included in the change are the ones which are in the form
that you provide, so simply ensure that the `change` variable has the correct
contents.

Lastly, if you get the wrong files in the pending changelist, you can always
change that later, prior to submit. For example, the `p4 reopen` command is a
convenient way to move files from one pending changelist to another (or to and
from the default changelist).

