examining history of deleted file

前端 未结 17 1837
臣服心动
臣服心动 2020-11-30 17:36

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

17条回答
  •  既然无缘
    2020-11-30 18:18

    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.

提交回复
热议问题