oh_cripes
oh_cripes

Reputation: 107

How can I move a folder to another changelist using P4V?

I have accidentally added a few folders to my default changelist that I don't want to submit to the server. How can I move these changes to another changelist, or remove them from the changelist without affecting the files on disk?

I have created a new changelist and moved some individual files / changes to this list but the folder contains many autogenerated files and this will take too long to do file by file.

I also looked at using the "revert" option but I think some of these files may have been previously added to the server in error. Reverting seems like it will change these files on disk to the previous server version.

Upvotes: 1

Views: 1210

Answers (2)

Wei Guo
Wei Guo

Reputation: 564

You can specify the folder path in "Find File".

And use "*" to match all files in the contains filed.

Now you can select all the files in your folder by using "Ctrl+A"

enter image description here

Upvotes: 1

Samwise
Samwise

Reputation: 71454

From P4V you can multi-select the files in the pending changes window and then drag them into a new changelist. If they're all in the same directory they'll all be grouped together since it's sorted by depot path.

If you just want to have them not be open but also not modify them on disk, go to the command line and do:

p4 revert -k //depot/path/...

The -k option lets you keep your local files. This isn't available from P4V as far as I know (since it leaves your workspace out of sync with the depot state, it's usually a bad idea).

If you have generated files in your workspace that aren't supposed to go into the depot, you should exclude them from your client's View, e.g.:

View:
    //depot/... //myclient/...
    -//depot/path_to_generated_files/... //myclient/path_to_generated_files/...

This will essentially "hide" these files from all Perforce operations; you will never be able to add files from this workspace path, and if somebody else adds files to that depot path, you won't sync them down to your workspace. Two notes on this:

  1. If you already have some of these files in the depot and they're currently synced, excluding them from your view and then syncing your client will remove them from your client. You can use sync -k, much like revert -k, to keep your local copies while telling the server that your client is properly up to date.
  2. If you're using streams, you can do this for ALL clients of the stream by adding an Ignored path.

Upvotes: 1

Related Questions