

This let the server know that the content of our local files are already up to date. Now the state of your workspace is even more inconsistent! Because of previous “p4 revert” operation, a normal “p4 sync” would not be correct. This switches your workspace to the new stream but it does not sync anything. Don’t forget to change “myclient” by the name of your own workspace. This creates the files in your new stream from the same revision you were synced in the main stream.

P4 stream -o -P //project/main -t development //project/myfeature | p4 stream -i In a script, you should use the -o and -i options like this: Just close it since we already provided the required parameters on the command line. public > X revert(X list) is not applicable at all as there is no. It will open the stream spec in your text editor. Any comments on correctness Still I cant get methods with type parameters working. This is slightly dangerous since it leave your workspace in an inconsistent state. This reverts the opened files on the server but not on the client. The source stream may need to be escaped since the -replace function expects a regular expression. Since we will use $files in the other commands, make sure your current directory is the workspace root. Preserving the change list information is left as an exercise to the reader…) We also replace the depot path of the stream with “.”. (All your changes will end up in the default change list. This gets a list of all opened files and remove all revision and changelist information. P4 stream -P //project/main -t development //project/myfeatureĪnd here are the explanations line by line: This procedure will also switch your workspace to the new stream.
Xrevert windows#
Here is my take on this operation, using modern Perforce commands and the modern Windows shell, that is, Powershell.įor this example, I’ll assume that you have a workspace named “myclient” set to the stream “main” of the depot “project” and that you want to move your pending changes to a new stream named “myfeature”. It mentions the shelve operation as a workaround but, sometimes, you really need a new branch. It does not cover what to do when you use streams and it is sub-optimal in the way it reconciles the files in the new branch. I just noticed that the Perforce knowledge base article about Branching Work In Progress is a little out of date.
