views:

27

answers:

2

(I am new to perforce and am trying to avoid getting myself into problems, I have hit problems doing this with other source code control systems)

When I rename I class I need to

  • Change the class name it’s self
  • Get Visual Studio to Refactor all the code that uses the class
  • Rename the file in the Visual Studio project
  • Rename the file in Perforce
  • Check the changes into perforce
  • Then maybe merge the change from my working branch into the main branch

What’s the best way to do the above with perforce? What issues to I need to be aware of?

+1  A: 

If you have a new enough version of Perforce, it now supports the move command, which will maintain file history across different names. If this is available, your steps are straightforward and should work just fine (from the Perforce side; I'm less experienced with VS).

If you don't have the move command available, you might want to look at this question for a further discussion on renaming/editing files in Perforce.

Caleb Huitt - cjhuitt
Thanks, the possible problem is that the "Rename the file in the Visual Studio project" step also renames the file on the disk.
Ian Ringrose
@Ian Ringrose: It might still work. First, check the file for edit in Perforce, then do the VS move, then the p4 move. P4 might object to the existence of the file in the place it is moving, though; I don't know on that one.
Caleb Huitt - cjhuitt
A: 

Have you had a look at the Visual Studio integration (P4SCC) that's available on the Perforce products page? I'd assume that it supports a rename rather nicely (disclaimer: I'm not using Visual Studio with Perforce myself, so I might be wrong).

jhwist