Even though the two missing folders have the same name and are in the same repository directory, Subversion thinks of them as two completely separate items. If you do svn log missingFolder
, you will get the information on the one you just added which isn't the same as the one you previously deleted.
Let's take this one at a time:
How to find when a file or folder was deleted
$ svn log -v
That's pretty much it, then you search for the name of the folder and the D
representing when it was deleted.
The listing can be rather long, but it doesn't take all that long to run. I will pipe this through less
:
$ svn log -v -q | less
Then, I can do /D *missingFolder
and find the line where I see the delete. A few lines up will be the revision number where it was deleted.
$ svn log -v $REPO/folder/folder
...
...
[on and on}
r1234 | ....
D folder/folder/missingFolder
deleted missingFolder
------
...
...
We can see this folder was deleted in revision 1234. This means it existed in revision 1233. That's important to remember.
You can do a svn log
on the parent folder which will make the output a bit shorter.
How to correctly add back in a previously existing folder or file:
If you wan the history of this folder or file to go all the way back before it was deleted, you need to copy the item in the Subversion repository before it was deleted. Remember that this folder was deleted in revision 1234. This means it exists in revision 1233:
$ svn cp -r1233 $REPO/folder/folder/missingFolder@1233 .
This is now the same folder in your current revision that was previously deleted in revision 1233. Now, doing a log will show me the entire history of missingFolder
. Unfortunately, it will show you when the file or folder was added back into the repository, but it doesn't say when the file or folder was deleted. For that information, you have to take the svn log
of the parent folder.