Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TortoiseSVN: Move file does not preserve history

I am attempting to move a file to another folder inside a TortoiseSVN repository, and the revision history is not being preserved. I have tried moving the files using the Repo-browser (right-click drag the files and select "Move items to here") as well in the working folder (right-click drag, select "SVN Move versioned files here," and commit the parent folder). In both cases the history is not preserved. I have read the TortoiseSVN manual as well as some other posts from people and am postitive those are the ways to do it. Am I missing something?

like image 559
John Michaels Avatar asked Jan 26 '10 17:01

John Michaels


People also ask

How do I move files in SVN without losing history?

If you right-drag the folder and use "SVN move versioned item(s) here", then you keep the history. Even the history of the files within the folder. But, the log dialog won't show the history unless you uncheck the box "Stop on copy/rename".

Does SVN copy preserve history?

Whilst you can copy or move files and folders within a repository, you cannot copy or move from one repository to another while preserving history using TortoiseSVN. Not even if the repositories live on the same server.

How do I move my TortoiseSVN repository?

If you are using TortoiseSVN (and I'm sure there's a command line tool for this as well, but I'm using Tortoise), you can simply right-click on your existing working copy folder and select TortoiseSVN –> Relocate. In the dialog that comes up, enter the new location of the repository, and click OK.

Can I move SVN folder to another location?

Moving files and folders select the files or directories you want to move. right drag them to the new location inside the working copy. release the right mouse button. in the popup menu select Context Menu → SVN Move versioned files here.


2 Answers

Subversion and TortoiseSVN absolutely do preserve the file history. (It is one of the fundamental aspects of SVN.)

Two key points (which you already seem to be aware of):

  • You have to use the SVN move/copy/rename commands. Otherwise, SVN won't be able to know they are the same file.

  • When looking at the log for moved/copied/renamed, you have to make sure the "Stop on copy/rename" option is unchecked. Otherwise, the log will only go back so far.

Now, keep in mind that you need to be looking at the log for something that actually was moved/copied. Look at the log of the file that was copied. Don't look at the log of the directory you copied it from, or the directory you copied it to.

like image 142
myron-semack Avatar answered Oct 03 '22 07:10

myron-semack


The page with the answer has been removed from TortoiseSVN help docs: http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-rename.html>

But still exists in Google cache:

http://webcache.googleusercontent.com/search?q=cache:x7UeADC8BpwJ:tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-rename.html+&cd=4&hl=en&ct=clnk&gl=us

If you want to move files around inside your working copy, perhaps to a different sub-folder, use the right mouse drag-and-drop handler:

select the files or directories you want to move

right drag them to the new location inside the working copy

release the right mouse button

in the popup menu select Context Menu → SVN Move versioned files here

enter image description here

like image 23
joeb1415 Avatar answered Oct 03 '22 07:10

joeb1415