Author Topic: Renaming C++ classes and files in svn  (Read 2620 times)

liam.sharp

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Renaming C++ classes and files in svn
« on: September 15, 2010, 07:30:17 AM »
I'm using SlickEdit Version 15.0.1.3 on Linux (Ubuntu) to mange my C++ project. Recently I had to rename a large number of files to fit a new naming convention. The process I used seemed a little painful, can anyone suggest a more efficient route to do this?

Each class was in a .hpp .cpp pair and under source control using svn. Here is what I did to rename class Foo in Foo.hpp/Foo.cpp to class Bar in Bar.hpp Bar.cpp.

- In the class declaration in Foo.hpp, Tools->Quick Refactoring->Rename, enter Bar as the new class name. Excellent.
- On the command line...
svn mv Foo.hpp Bar.hpp
svn mv Foo.cpp Bar.cpp
SlickEdit pops up a message to close removed files, I choose Close
- 'Replace in Files' all #include "Foo.hpp" with #include "Bar.hpp"
- Fix build system to compile Bar.cpp
Now, as I've moved these file 'from under' SlickEdit I can no long jump to Bar or locate Bar.hpp/cpp in the 'Open' Tool Window, so:
Project->Project Properties->Files->Remove All then
'Add Tree' after navigating to the folder containing my source files (dialog seems to always reset to the vsprojects folder in my home directory and not store any history :-( )