tags:

views:

100

answers:

2

Problem : I have multiple projects checked out in my depot. I also have multiple pending numbered change lists, each change list containing checked out files specific to its project. When I check out a new file, it appears in the default change list instead of in the change list that is relevant to its project and I need to manually move it to the relevant change list. This gets real tedious real quick.

Is there any way to automate this process? Sure, a shell script with regular expressions could work, but I want to know if there is any Perforce feature that does this. For example, is there a way to link my project folder to a numbered change list so that a newly checked out file automatically appears in the relevant change list?

+2  A: 

The way I handle this is that each project I'm working on has a separate client workspace configuration.

However, this is a 6 of one, half dozen of the other situation - now I have to manage a bunch of workspaces. The problem I run into is that when I'm working on project A and want to do something quick in project B I have to switch my workspace to do it.

Perforce does have methods to help deal with that problem by using config files that you place in the proper parts of your directory hierarchy. See the Perforce User's Guide, Chapter 2 - the "Using config files" section.

Michael Burr
+1  A: 

The graphical clients make this pretty easy. Dragging a file(s) or folder(s) onto a change list will check it out for you. Instead of checking them out with the context menu or Ctrl+E, which will put them in the default change list, just drag them onto the appropriate change list and they are automatically checked out where you want them to be.

To do it from the command line, you pass the target change list number to the edit command, via the -c switch. The following command will open the file foo.txt for edit in change list number 1234:

p4 edit -c 1234 foo.txt
raven