Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Perforce, can you rename a folder to the same name but cased differently?

Tags:

perforce

Can I rename a folder in Perforce from //depot/FooBar/ to //depot/Foobar/?

I've tried this by renaming from //depot/FooBar/ to //depot/Temp/ to //Depot/Foobar/ but the end result ends up the same as //depot/FooBar/.

like image 447
Iain Avatar asked Sep 25 '08 13:09

Iain


People also ask

Which method is used to rename a folder?

To rename a file or folder:Right-click on the item and select Rename, or select the file and press F2 . Type the new name and press Enter or click Rename.

How do I rename a folder in sequentially?

Select multiple files in a folder. To do so, press and hold down the CTRL key while you are clicking files. After you select the files, press F2. Type the new name, and then press ENTER.

How do I rename a file in p4v?

Right-click the file or folder you want to rename and choose Rename/Move. The Rename/Move dialog is displayed. Specify the new name in the New name field. You can either click Submit to submit the change immediately, or Save to Changelist to submit the renamed object at a later date.

Can files be renamed?

Open File Explorer by going to My Computer, or by pressing Windows Key + E on your keyboard. Find the file you want to rename, select it and select Rename on the ribbon (or press F2 on your keyboard). Type the new name you want the file to have and press Enter.


1 Answers

Once it is in Perforce, the case remains set. As mentioned by Johan you can obliterate, set the name up correctly, and add it in again. However, there is a slight gotcha....

If anyone else (running Windows) has already synced the wrong-cased version, then when they sync again the right one, it will not change the case on their PC. This is a peculiarity of the Windows file system acknowledging case but still being fundamentally case-independent.

If a number of users have synced, and it is not convenient to get them to remove-from-client too (and blasting the folders from their machines), then you can resort to a dark and dirty Perforce technique called "Checkpoint surgery". It's not for the fainthearted, but you do this:

  1. Stop your server, take a checkpoint.
  2. Using your favourite text editor that can handle multi-megabyte files, search & replace all occurances of the old case name with the new. You could of course use a script too.
  3. Replay your checkpoint file to recreate the Perforce database meta data.
  4. Restart your server.

This will affect all user client specs transparently, and so when they sync they will get the right case as if by magic.

It sounds hairy, but I've had to do it before and as long as you take care, backup, do a trial run etc, then all should be OK.

like image 200
Greg Whitfield Avatar answered Sep 22 '22 03:09

Greg Whitfield