tags:

views:

50

answers:

2

Here's a frequent situation: You have about thirty files checked out into a specific pending change-list. After working on those files, and before submitting them, you needed to move them to a folder (external to deposits, so a simple "Integrate" wouldn't be suitable).

Using the "Show In - Explorer" option, you'll get a lot of window popped-up. And that's just painful (and sometimes, the system just cannot open all of them).

So, question is, is there a simple way to copy-paste multiple files from a change-list without doing it individually?

+1  A: 

I know you want to do these things outside of Perforce, but the best I can think of is if you create another workspace specifically for exporting files. You can sync your Perforce workspace to contain only the files in a particular changelist.

In this workspace, try giving the files in your changelist, after it is submitted, a particular label. If you sync your workspace to this label, it will delete every file that does not have this label based on this Perforce page. (do Find for label in that page)

p4 sync @label_name

This involves Perforce, but it does provide a way to get only the files you want.

I believe you can also accomplish this only using changelist numbers, but it may be more complicated. I'm not 100% sure this works

p4 sync #none
p4 sync @changelist,@changelist

I think this will sync files only in this changelist.

Chance
You can also use p4v to get files only with a particular label; I'm not sure about P4WIN.
Chance
+1  A: 

You can do this with a custom tool.

  • In P4V, open the custom tools manager via the Tools->Manage Custom Tools... menu item
  • Click New->Tool... to open the Add Custom Tool dialog and enter these parameters (xcopy isn't the ideal app for this, but I'll talk about that later1)

alt text

  • Now you will be able to select all the files in your change list, right click on them, and a new item will be available in the context menu Copy selected files to another location..."

alt text

  • An input box will appear, asking you where you wish to copy the files.

alt text

  • Click OK and the files will be copied to the location you entered in the input dialog. Maybe...

1There are some problems with xcopy:

  • the target directory must already exist
  • it doesn't seem to work if the path contains spaces
  • if the process fails, you're process list will fill up with a bunch of instances of xcopy.exe that are stuck trying to do who knows what
  • the custom tool will no longer work if the previous condition occurs

I tried robocopy also, which would be perfect if there was a way to pass it the source directory, but P4V custom tool editor doesn't provide the parent directory as a parameter. Ideally, you should write your own file copy utility, if this is really important to you. It wouldn't require that much effort.

Lastly, the P4V custom tool editor offers a file browser, but not a folder browser, and the latter is what you really need for a tool such as this.

So, play around with the custom tool thing. You might be able to come up with an answer to your problem.

raven
Perfect! Thanks!
moz