Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moving a method from one file to another while keeping its history

I recently moved a method from one class / file into another so that I could reuse it. Now if I blame through subversion I am responsible for all lines of code, which makes sense since I created a new file.

Is there any way to get subversion to recognize where that method came from so that the history is kept intact?

like image 559
Joshua Jewell Avatar asked Jan 20 '23 02:01

Joshua Jewell


1 Answers

If you moved the function from one existing file to another existing file, I think the short answer is, "It can't be done". If you moved the function from an existing file to a new file, i.e. you created the new file just to hold this function (maybe adding other things, but starting with this function), then you could copy the file, delete the function from the original, and delete everything but the function from the copy. Then both the original and the copy would preserve the history.

like image 131
Jay Avatar answered Jan 31 '23 06:01

Jay