“Safe” is probably an important point here. After renaming or moving the file, it will get the version number “1”, which will look like a new file for your Perforce client. Of course, administrators will be able to get their background, but if the history of editing / version of a file is important to you, it’s a little harder to get an older version.
Update: Thanks to Commodore Jaeger and Greg Whitfield for clarifying the comments.
It was not easy to keep track of what One True Answer is, even from Perforce support, so I decided that I would update all of those found:
- Perforce stores all versions of each document in its database.
- If it saves your file as a type of "or", it will save the difference in one version of the file to another, and not to the entire file.
- If you are viewing a file, do not make any changes to it, and then resubmit it, it will save as a new version with 0 diff. This is customizable, and P4 can be tuned to ignore change list items without any actual differences. You can force this behavior to select "Discard unchanged files ..." before submitting a list of changes.
- Use "Rename / Move ..." to move files in P4 to track them. Do not copy them using Windows Explorer, and then re-add them to P4.
- If you use the Rename / Move ... function from the context menu, the “new” file will display the version number “1”, as if it were a new file.
- However, since P4 saves every function that is executed in a file, you can actually go to any previous revision (and even recover deleted files) using the CLI command "p4 filelog -i"
- If you want to go to the change history of a moved or renamed file, and you are not an administrator, you can right-click and select its “Revision Graph”, which shows each version of the file, even if it is moved between branches.
In line with Perforce support, simplified tracking of change history by moving branches or folders is often a given feature and is located in their current roadmap.
Answer to Perforce: There is currently no way to move / rename / integrate files and keep accurate file history.
However, if you selected "Integration ..." by right-clicking on the folder you want to provide, the versions of the recently forked folder and base file files will start from version No. 1, but the history of integration between the forked folder and base files and the source folder and the basic files will remain, through which you can track the history of file changes.
Jough dempsey
source share