If I delete a file in Subversion, how can I look at it\'s history and contents? If I try to do svn cat
or svn log
on a nonexistent file, it complai
Use this command:
svn log -v | awk '/^r[0-9]+/ { rev = $1; }; / D .*filename_escaped_for_regex/ { print rev" "$2; };'
This will list all revisions that ever deleted any files matching the pattern.
That is, if you're searching for file README, then all of /src/README
, /src/README.first
, and /some/deeply/hidden/directory/READMENOT
will be found and listed.
If your filename contains slashes (path), dots, or other special regex characters, don't forget to escape them to avoid mismatching or errors.