Reputation: 5678
I've looked at this similar question but I'm still fairly lost. I have one file which I want to be a part of multiple changelists. I seem to remember that doing this involves creating multiple clients, but that's stumping me, too. I can create a client just fine, but I can't figure out how to "check out" that client and start creating a separate CL in that client, one that is independent from the CLs I have started in my original client.
Any help would be hugely appreciated!
(It's also worth mentioning that I'm working on a source control system that's forked from perforce, not exactly perforce).
Upvotes: 0
Views: 1667
Reputation: 71454
One file can only be part of multiple submitted changelists if each changelist has a different revision -- e.g. if you add a file to the depot its revision #1 is in one changelist, when you edit it and submit that its revision #2 is in another changelist, and so on. Same file, different revisions.
One file can be part of multiple pending changelists at the same time (all derived from the same revision) if each changelist is on a different client. If you're creating different clients on one machine, make sure that each has its own unique client root, since you'll want to have unique copies of the file(s) on your local machine. Then you don't need to do anything special to open the file; each client is independent of the others. Just "p4 sync" and "p4 edit" the same way you did on your first client. (Make sure to use P4CLIENT or the equivalent to specify which client you're using at any given time; P4CONFIG files make this easier by associating a P4CLIENT setting with a particular working direcotory.) The only difference you'll see is an informational message from "p4 edit" that the file is already open by another client. Creating changelists works the same way as it always does; run "p4 change" to create a pending change, "p4 reopen -c change" to move files around between changes.
There is also shelving, which is similar in some ways to having multiple pending changelists on different clients (except that the changelists are all stored on the server rather than in a bunch of different client workspaces) but if you happen to be using a very old version of Perforce (or something similar to it) that's probably not an option.
Upvotes: 2