How to find a file that ever existed in svn-repo?

For some obscure (but valid) reasons, I need to find out if the file was ever a version in our repository.

I found only a roundabout way to get the log for the containing dir and then parse it for deleted entries:

svn log -v a/b/|grep "   D .*a/b/c.xml"

It works, but feels "unclean" and somewhat fragile.

+5
source share
2 answers

, ( , , , ). Lazy Badger : . , , , .

, :

svn log -v a/b/ | grep "   D .*a/b/c.xml"

-q, , :

svn log -v -q a/b/ | grep "   D .*a/b/c.xml"

, , (.. ). Unix/Linux, awk ( ):

svn log -q -v a/b/ | awk '
    /^r[0-9]* \|/ { REVISION=$1; }
    /  D/ { print REVISION": "$0; }
' | grep "   D .*a/b/c.xml"

- svn log, –v: , . , , Page.cs 10506:

r10506 | msorens | 2011-02-14 12:58:56 -0800 (Mon, 14 Feb 2011) | 1 line
Changed paths:
   A /Projects/Test/Common
   A /Projects/Test/Common/Setup.cs
   A /Projects/Test/Common/Utility.cs
   D /Projects/Test/Page.cs

awk , , , ( "D" ). Windows PowerShell ​​ , awk, switch:

$( switch -Regex (svn log -q -v a/b) {
    '^(r[0-9]*) \|' { $rev = $Matches[1] }
    '^   D\s+(.*)'  { "{0,-6} {1}" -f $rev, $Matches[1] }
} ) | Select-String "a/b/c.xml"

TortoiseSVN - . , . , ( ) , .

+4

@Michael Sorens ,

, . /assets/gfx

bash , , , "mysearchstr" - var,

mysearchstr=assets/gfx/
svn log -v $mysearchstr | awk '/^r[0-9]* \|/ { REVISION=$1; } /  D/ { print REVISION": "$0; }' | grep menu

, . ... , , - , , , ( - )

0

All Articles