How can I find the revision history of the file that was deleted and then resubmitted to SVN?

This is a follow on question to "How do I delete 1 file from a revision in SVN?" but because it probably has a very different answer and I believe that others would benefit from knowing the answer. (I don't know the answer yet.)

The previous question was answered and I discovered that it is not possible to remove a revision from SVN. The second best solution was to remove the file from SVN, commit and then add the file back and commit again.

I now want to make sure that the original file's revision history has gone. So I am hoping that the answer to the question "How can I find the revision history of the file that was deleted and then resubmitted to SVN?" is that you can't.

Answers


With a simple

svn log -v [folder]

you can browse quickly the adding and deletion.

------------------------------------------------------------------------
r14 | kame | 2008-08-29 04:23:43 +0200 (ven., 29 aoû2008) | 1 line
Chemins modifié :
   A /a.txt

Readded a
------------------------------------------------------------------------
r13 | kame | 2008-08-29 04:23:24 +0200 (ven., 29 aoû2008) | 1 line
Chemins modifié :
   D /a.txt

Delete a
------------------------------------------------------------------------
r12 | kame | 2008-08-29 04:23:06 +0200 (ven., 29 aoû2008) | 1 line
Chemins modifié :
   A /a.txt

svn log won't show the file, svn diff will pretend that the old revision does not exist, but a svn checkout targeting the old revision will happily give you the old file.


What makes you think that it is not possible to remove a revision from Subversion? The solution given to your other question (svndumpfilter) does exactly that (see the parameters --drop-empty-revs and --renumber-revs)! And when the revision is gone, there's obviously no way to get at the revision history, because it was never there in the first place.


Short answer: you can

Long answer:

Unfortunately (for you but perhaps not for most folks) , the revision history for a deleted file is still there - it's just a little harder to get at.

Here's an example:

$ touch one
$ svn add one
$ svn ci -m "Added file one"
$ date >> one 
$ svn ci -m "Updated file one"
$ date >> one
$ svn ci -m "Updated file one again"
$ svn log file:///repos/one

------------------------------------------------------------------------
r3 | andrewr | 2008-08-29 12:27:10 +1000 (Fri, 29 Aug 2008) | 1 line

Updated file one again
------------------------------------------------------------------------
r2 | andrewr | 2008-08-29 12:26:50 +1000 (Fri, 29 Aug 2008) | 1 line

Updated file one
------------------------------------------------------------------------
r1 | andrewr | 2008-08-29 12:25:07 +1000 (Fri, 29 Aug 2008) | 1 line

Added file one
------------------------------------------------------------------------

$ svn delete one
$ svn ci -m "Deleted file one"
$ svn up
$ touch one
$ svn add one
$ svn ci -m "Adding file one back in"
$ svn log file:///repos/one

------------------------------------------------------------------------
r5 | andrewr | 2008-08-29 12:29:13 +1000 (Fri, 29 Aug 2008) | 1 line

add one back
------------------------------------------------------------------------

It looks like it works (the old history is gone), but if you request the file at older revisions you get the history of the deleted file.

$ svn log -r 3:1 file:///repos/one

------------------------------------------------------------------------
r3 | andrewr | 2008-08-29 12:27:10 +1000 (Fri, 29 Aug 2008) | 1 line

Updated file one again
------------------------------------------------------------------------
r2 | andrewr | 2008-08-29 12:26:50 +1000 (Fri, 29 Aug 2008) | 1 line

Updated file one
------------------------------------------------------------------------
r1 | andrewr | 2008-08-29 12:25:07 +1000 (Fri, 29 Aug 2008) | 1 line

Added file one
------------------------------------------------------------------------

Need Your Help

DataContractSerializer metadata export. Related schemas

import xsd schema datacontractserializer svcutil.exe

I'm exporting assembly's datacontracts with svcutil.exe. It generates set of xsd files including each other like this:

Parsing XML data in AS3 by attribute

xml actionscript-3 xml-parsing flash-cs6

I am building an application which allows the user to add ingredients in their fridge to a list and then search for all of the potential recipes based on the ingredients they've listed.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.