You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Gavin \"Beau\" Baumanis" <ga...@palcare.com.au> on 2011/04/13 03:27:22 UTC

Finding the revision of a deleted file.

I have been doing some work everyone's good friend Mr.Google.
Every blog / article I read all said the same thing;

Create a file with svn log
(svn log --verbose > svn.log)
Then grep / search the log for the file you're after.

It takes  about 8 minutes just for the log file to be created - which makes it a slightly painful workflow - just to resurrect an old file.

Is there not a more convenient way to do this?

As always thanks in advance.
Gavin "Beau" Baumanis

Re: Finding the revision of a deleted file.

Posted by Konstantin Kolinko <kn...@gmail.com>.
If you do not know the path to the file, then I think

svn ls --depth=infinity

together with peg revision set in the past will help you to locate it.

Then you can use svn log on the file to see when it was deleted and
svn cp it from any revision before that.

Best regards,
Konstantin Kolinko

2011/4/13 Gavin "Beau" Baumanis <ga...@palcare.com.au>:
> It's always the way ....
> I should have been a little more clearer about my requirements.
>
> I have a file; fileName.txt
> This file exists "somewhere" in the repository at a previous revision because it was deleted at sometime in the past.
>
> So, I  am unable to restrict the path that svn.log starts at.
>
> I can't think of a way to do it other than the svn log method...
> And the fact that Mr.Google has only revealed the svn log method, too - I assume there simply isn't a better method...
> It just seems like there "should" be an easier method - so I figured I had better ask as opposed die wondering...
>
> Gavin.
>
>
> On 13/04/2011, at 4:52 PM, Konstantin Kolinko wrote:
>
>> 2011/4/13 Gavin "Beau" Baumanis <ga...@palcare.com.au>:
>>> I have been doing some work everyone's good friend Mr.Google.
>>> Every blog / article I read all said the same thing;
>>>
>>> Create a file with svn log
>>> (svn log --verbose > svn.log)
>>> Then grep / search the log for the file you're after.
>>>
>>> It takes  about 8 minutes just for the log file to be created - which makes it a slightly painful workflow - just to resurrect an old file.
>>
>> I guess you are "log"'ing a lot more than necessary. Have you looked
>> at the options available for the log command? I use the "--limit" one
>> very often. Are you calling this command for the right path?
>>
>>> Is there not a more convenient way to do this?
>>>
>>> As always thanks in advance.
>>> Gavin "Beau" Baumanis
>

Re: Finding the revision of a deleted file.

Posted by "Gavin \"Beau\" Baumanis" <ga...@palcare.com.au>.
It's always the way ....
I should have been a little more clearer about my requirements.

I have a file; fileName.txt
This file exists "somewhere" in the repository at a previous revision because it was deleted at sometime in the past.

So, I  am unable to restrict the path that svn.log starts at.

I can't think of a way to do it other than the svn log method...
And the fact that Mr.Google has only revealed the svn log method, too - I assume there simply isn't a better method...
It just seems like there "should" be an easier method - so I figured I had better ask as opposed die wondering...

Gavin.


On 13/04/2011, at 4:52 PM, Konstantin Kolinko wrote:

> 2011/4/13 Gavin "Beau" Baumanis <ga...@palcare.com.au>:
>> I have been doing some work everyone's good friend Mr.Google.
>> Every blog / article I read all said the same thing;
>> 
>> Create a file with svn log
>> (svn log --verbose > svn.log)
>> Then grep / search the log for the file you're after.
>> 
>> It takes  about 8 minutes just for the log file to be created - which makes it a slightly painful workflow - just to resurrect an old file.
> 
> I guess you are "log"'ing a lot more than necessary. Have you looked
> at the options available for the log command? I use the "--limit" one
> very often. Are you calling this command for the right path?
> 
>> Is there not a more convenient way to do this?
>> 
>> As always thanks in advance.
>> Gavin "Beau" Baumanis

Re: Finding the revision of a deleted file.

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
On Wed, 13 Apr 2011 10:52 +0400, "Konstantin Kolinko" <kn...@gmail.com> wrote:
> 2011/4/13 Gavin "Beau" Baumanis <ga...@palcare.com.au>:
> > Is there not a more convenient way to do this?
> >

Binary search with 'svn info'?

Re: Finding the revision of a deleted file.

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/4/13 Gavin "Beau" Baumanis <ga...@palcare.com.au>:
> I have been doing some work everyone's good friend Mr.Google.
> Every blog / article I read all said the same thing;
>
> Create a file with svn log
> (svn log --verbose > svn.log)
> Then grep / search the log for the file you're after.
>
> It takes  about 8 minutes just for the log file to be created - which makes it a slightly painful workflow - just to resurrect an old file.

I guess you are "log"'ing a lot more than necessary. Have you looked
at the options available for the log command? I use the "--limit" one
very often. Are you calling this command for the right path?

> Is there not a more convenient way to do this?
>
> As always thanks in advance.
> Gavin "Beau" Baumanis

Re: Finding the revision of a deleted file.

Posted by "Gavin \"Beau\" Baumanis" <ga...@palcare.com.au>.
Firstly, let me thank everyone for their help.

I was "hoping / wishing" that here was some simple command line instruction(s), that I simply didn't know about, that would do the job for me.
It would appear, not in the way I had hoped.

Mark Cooke suggested that I use a hook script to maintain the log every update, that way all I ever had to do was grep and not the log creation too.
Which is an excellent idea, and seems to be inline with the earlier suggestion of Stefan's of using "svnsearch" or "fisheye" for the task.

It was more a case of working out if I "could" do what I want internally within subversion, or whether Google was correct and I had to use one of the processes that have now been mentioned here.

Slightly different but I only just found out that you can use svn merge to obtain a list of changes that an svn update will do to your working copy.
svn merge --dry-run -r BASE:HEAD .
which in effect is a svn update with a --dry-run switch.

So I just wanted to make sure something like that didn't already exist for me to find out a deleted revision / path of a long lost file.

Thank you everyone for your considered responses - I do appreciate the time you've taken to help me out.

Gavin "Beau" Baumanis



On 19/04/2011, at 2:21 AM, Henrik Sundberg wrote:

> On Wed, Apr 13, 2011 at 3:27 AM, Gavin "Beau" Baumanis
> <ga...@palcare.com.au> wrote:
>> Create a file with svn log
>> (svn log --verbose > svn.log)
>> Then grep / search the log for the file you're after.
>> 
>> Is there not a more convenient way to do this?
> 
> Have you seen ViewVC?
> /$

Re: Finding the revision of a deleted file.

Posted by Henrik Sundberg <st...@gmail.com>.
On Wed, Apr 13, 2011 at 3:27 AM, Gavin "Beau" Baumanis
<ga...@palcare.com.au> wrote:
> Create a file with svn log
> (svn log --verbose > svn.log)
> Then grep / search the log for the file you're after.
>
> Is there not a more convenient way to do this?

Have you seen ViewVC?
/$

RE: Finding the revision of a deleted file.

Posted by "Cooke, Mark" <ma...@siemens.com>.
> > On Wed, Apr 13, 2011 at 11:27:22AM +1000, Gavin "Beau" 
> Baumanis wrote:
> >> I have been doing some work everyone's good friend Mr.Google.
> >> Every blog / article I read all said the same thing;
> >> 
> >> Create a file with svn log
> >> (svn log --verbose > svn.log)
> >> Then grep / search the log for the file you're after.
> >> 
> >> It takes  about 8 minutes just for the log file to be 
> created - which makes it a slightly painful workflow - just 
> to resurrect an old file.
> >> 
> >> Is there not a more convenient way to do this?
> >> 
> >> As always thanks in advance.
> >> Gavin "Beau" Baumanis
> 
> On 14/04/2011, at 2:20 AM, Stefan Sperling wrote:
> 
> > 
> > Hi Gavin,
> > 
> > this thread had some interesting technical discussion about 
> this topic:
> > http://svn.haxx.se/users/archive-2010-11/0509.shtml
> > 
> > One way to work around this limitation is to use a 
> data-mining tool which
> > crawls the repository and fills a relational database with 
> information.
> > This DB can then be queried, often via a web interface. Two 
> such products
> > are "svnsearch" (open source) and "fisheye" (proprietary).
> > They do more than just locating deleted files, though. I 
> think both support
> > full text search of file content of all revisions in the 
> repository, too.
> 
> -----Original Message-----
> From: Gavin "Beau" Baumanis [mailto:gavin.baumanis@palcare.com.au] 
> Sent: 14 April 2011 01:28
> To: Stefan Sperling
> Cc: Subversion Users
> Subject: Re: Finding the revision of a deleted file.
> 
> Hi Stefan / Konstantin,
> 
> Thanks for the responses.
> The data mining tool looks promising, and as you state, 
> allows for some "extra" goodness too.
> 
> Gavin.
> 
...just my 2€: having created the log file once, could it not be "maintained" using a post-commit hook script and appropriate arguments, then you eliminate the need to recreate the log file each time and just have the 'grep' stage...

~ mark c

Re: Finding the revision of a deleted file.

Posted by "Gavin \"Beau\" Baumanis" <ga...@palcare.com.au>.
Hi Stefan / Konstantin,

Thanks for the responses.
The data mining tool looks promising, and as you state, allows for some "extra" goodness too.

Gavin.


On 14/04/2011, at 2:20 AM, Stefan Sperling wrote:

> On Wed, Apr 13, 2011 at 11:27:22AM +1000, Gavin "Beau" Baumanis wrote:
>> I have been doing some work everyone's good friend Mr.Google.
>> Every blog / article I read all said the same thing;
>> 
>> Create a file with svn log
>> (svn log --verbose > svn.log)
>> Then grep / search the log for the file you're after.
>> 
>> It takes  about 8 minutes just for the log file to be created - which makes it a slightly painful workflow - just to resurrect an old file.
>> 
>> Is there not a more convenient way to do this?
>> 
>> As always thanks in advance.
>> Gavin "Beau" Baumanis
> 
> Hi Gavin,
> 
> this thread had some interesting technical discussion about this topic:
> http://svn.haxx.se/users/archive-2010-11/0509.shtml
> 
> One way to work around this limitation is to use a data-mining tool which
> crawls the repository and fills a relational database with information.
> This DB can then be queried, often via a web interface. Two such products
> are "svnsearch" (open source) and "fisheye" (proprietary).
> They do more than just locating deleted files, though. I think both support
> full text search of file content of all revisions in the repository, too.

Re: Finding the revision of a deleted file.

Posted by Stefan Sperling <st...@elego.de>.
On Wed, Apr 13, 2011 at 11:27:22AM +1000, Gavin "Beau" Baumanis wrote:
> I have been doing some work everyone's good friend Mr.Google.
> Every blog / article I read all said the same thing;
> 
> Create a file with svn log
> (svn log --verbose > svn.log)
> Then grep / search the log for the file you're after.
> 
> It takes  about 8 minutes just for the log file to be created - which makes it a slightly painful workflow - just to resurrect an old file.
> 
> Is there not a more convenient way to do this?
> 
> As always thanks in advance.
> Gavin "Beau" Baumanis

Hi Gavin,

this thread had some interesting technical discussion about this topic:
http://svn.haxx.se/users/archive-2010-11/0509.shtml

One way to work around this limitation is to use a data-mining tool which
crawls the repository and fills a relational database with information.
This DB can then be queried, often via a web interface. Two such products
are "svnsearch" (open source) and "fisheye" (proprietary).
They do more than just locating deleted files, though. I think both support
full text search of file content of all revisions in the repository, too.