tags:

views:

191

answers:

2

In Perforce, is it possible to rename a depot?

I would imagine that you could integrate across different named depots, but I do not think that would carry over the full depot's history.

I have seen this Renaming Depot Directories article, but this applies only to directories under a depot (and not the depot itself).

+3  A: 

No. You can't rename a depot because Perforce won't let you move files from depot A to depot B unless depot B already exists. If you wish to rename depot A to depot B, do the following:

  • create a depot named B
  • move all files in A to B
  • delete depot A

It used to be that moving files to a new location in Perforce meant you lost their history. The old file was deleted and then added again in the new location as though it had never been under version control. That is no longer the case. I don't recall exactly when they did it (perhaps in the 2008.x series?), but they finally made it so that file history is maintained across a move/rename/integration.

Edit: In the comments below, Greg Whitfield informs me that Perforce has been maintaining file history across integrations all along. I guess it was off by default and turned on in a fairly recent version of P4V?

raven
The atomic move was feature was added 2009.1 release.
Dennis Roche
Perforce has never lost the history upon a rename - been using it for nearly 10 years now, so it is definitely not a new thing. Where people get confused is the flag that shows/hides branch history when showing a file history.
Greg Whitfield
@Greg: Could you elaborate? I'm not familiar with this flag of which you speak. The command that is issued when I view the history of a branched file in P4V is something like `p4 fstat -Olhp \\depot\current\file.txt \\depot\previous\file.txt` It's passing the current location of the file and the location(s) from which it was branched. A flag isn't controlling that output. Somehow it knows that files location history and passes those paths to the fstat command.
raven
The p4 filelog command with the -i argument is what you need from the command line. From the P4V GUI there is a button at the top right that lets you toggle whether to show branch history or not.
Greg Whitfield
A: 

Contact Perforce support. They can guide and support you through the process of actually renaming a depot, which involves manipulating the metadata.

Cwan