gpt4 book ai didi

file - 为什么Subversion跳过包含@符号的文件?

转载 作者:行者123 更新时间:2023-12-03 08:09:32 25 4
gpt4 key购买 nike

当我尝试执行这样的命令时(从命令行或Perl脚本执行-没关系):

svn revert "build\myfile@test.meta"

SVN跳过此文件并输出:
Skipped 'build\myfile'

我试着做:
svn revert "build\*.meta"

但这给出了相同的结果。

我可以从GUI恢复这些文件。而且我可以通过执行这些文件的还原(但是它的还原量超过了我想要的):
svn revert --recursive "build"

有没有解决方法?

最佳答案

Subversion中的@登录文件名实际上具有特殊含义-固定的修订号。引用Subversion book:

The perceptive reader is probably wondering at this point whether the peg revision syntax causes problems for working copy paths or URLs that actually have at signs in them. After all, how does svn know whether news@11 is the name of a directory in my tree or just a syntax for “revision 11 of news”? Thankfully, while svn will always assume the latter, there is a trivial workaround. You need only append an at sign to the end of the path, such as news@11@. svn cares only about the last at sign in the argument, and it is not considered illegal to omit a literal peg revision specifier after that at sign. This workaround even applies to paths that end in an at sign—you would use filename@@ to talk about a file named filename@.



因此,您应该在脚本中的文件名后附加@符号,如下所示:
svn revert "build\myfile@test.meta@"

关于file - 为什么Subversion跳过包含@符号的文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1985203/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com