【问题标题】:How to find all commits (revision numbers) in which a file was deleted/moved in SVN如何在 SVN 中查找文件被删除/移动的所有提交(修订号)
【发布时间】:2013-11-19 13:26:04
【问题描述】:

我需要从 SVN 中找到所有已删除的文件。然后检查文件是否需要在完成后恢复。如果是,则恢复。我怎么做。我知道我可以恢复已删除的文件,但这需要修订号。

【问题讨论】:

    标签: svn svnadmin collabnet


    【解决方案1】:

    您可以使用svn log --search(自 SVN 1.8 起提供)查找删除特定文件的修订版,然后将其恢复。

    以下命令将查找删除MyProject/MyForm.cs 文件的修订版。

    svn log -v --search "MyProject/MyForm.cs" --search-and "D" http://svn.example.com/svn/MyRepository
    

    我没有在 SVNBook 中看到对新 --search 参数的描述,因此包括命令行帮助供您参考(请查看 svn help log 了解更多信息):

     If the --search option is used, log messages are displayed only if the
     provided search pattern matches any of the author, date, log message
     text (unless --quiet is used), or, if the --verbose option is also
     provided, a changed path.
     The search pattern may include "glob syntax" wildcards:
         ?      matches any single character
         *      matches a sequence of arbitrary characters
         [abc]  matches any of the characters listed inside the brackets
     If multiple --search options are provided, a log message is shown if
     it matches any of the provided search patterns. If the --search-and
     option is used, that option's argument is combined with the pattern
     from the previous --search or --search-and option, and a log message
     is shown only if it matches the combined search pattern.
     If --limit is used in combination with --search, --limit restricts the
     number of log messages searched, rather than restricting the output
     to a particular number of matching log messages.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-10-19
      • 2011-02-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-13
      • 2012-11-29
      相关资源
      最近更新 更多