Renaming Depot Directories

Info & Tags

Article #:
24
Created:
03/14/07
Modified:
01/09/08

TASK

Moving or renaming a depot directory

SOLUTION

To move or rename a directory you branch the existing directory into a new directory and delete the existing one. For example, to rename //depot/widgets to //depot/main/widgets issue the following commands:

p4 integ //depot/widgets/... //depot/main/widgets/...
p4 delete //depot/widgets/...
p4 submit

This series of commands marks the head revisions of files in //depot/widgets as deleted. To remove his or her //depot/widgets files and copy in the //depot/main/widgets files a user whose client view is mapped to //depot/main/widgets should do a sync.

The complete history of the files in the new directory can be shown with p4 filelog -i* and p4 changes -i.

After you have renamed the depot directory, you must change any references to the depot name to reflect the new name so that all users can view and sync to files from the new directory. To avoid errors check the following for references to the depot directory:

  • Protection tables
  • Client workspace specifications
  • Labels
  • Branch specifications
  • Triggers
  • Scripts that refer to the depot directory