Changing File Case (Windows)
TASK
Change the case of a file on a Perforce Server on WindowsSOLUTION
Since Windows uses a case-insensitive file system, references to files that differ only by case are ignored. In order to get the Perforce Server to change the case of a file on a Windows Server, the file must first be deleted and then re-added to Perforce using the correct case. Additionally, the internal Perforce "have list" references to the old case name must be eliminated by removing the file from case-insensitive workspaces and then re-syncing the file using the correct case.Example
Here we assume file "foo" has three revisions and we want to change the file name to use all upper-case, from "foo" to "FOO".- Delete the existing file
p4 delete foo
p4 submit - Recreate the file locally in the correct case. The sync command will re-create the workspace file using the case provided on the command line.
p4 sync FOO#3
- Remove the internal "have list" reference. The flush command ("sync -k", in recent versions) will remove the have list reference without removing the file from your workspace.
p4 flush FOO#none
- Re-add the file in the correct case. As with the sync command, the add command uses the case of the file argument provided at the command line, so it is important to provide the correct case.
p4 add FOO
p4 submit
Notes
To obtain the newly case-changed file, all users who use workspaces on case-insenstive file systems (such as Windows NTFS or MacOS X HFS) must remove the old file from their workspace and then re-sync the renamed file with the correct case to replace it in their workspace.
