How to handle splitting a file under source control?

Posted by sharptooth on Stack Overflow See other posts from Stack Overflow or by sharptooth
Published on 2010-03-12T13:52:26Z Indexed on 2010/03/12 13:57 UTC
Read the original article Hit count: 249

I have a .cpp file and .h file containing a class. Class.cpp contains the implementation and Class.h contains the definition. The class is overcomplicated so I want to separate some code and move it into a separate class. So I create NewClass.cpp and NewClass.h and move the code there.

How do I handle this when the files are under SVN?

I can simply "svn add" the two new files, but then they will appear as new and will have no history. I could instead "svn copy and rename" the two initial files and edit the the two old files and the two new files - then the two new files will have common history.

Which approach is better from the point of version control? Should the new files share history with the old files or should they appear as new?

© Stack Overflow or respective owner

Related posts about version-control

Related posts about source-control