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 [email protected] 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 [email protected]@. 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 [email protected]@ to talk about a file named [email protected]
根据这个描述,你只需要一个@符号添加到路径。
所以这个:
svn add "C:\SomeTests\[email protected]"
给我的错误:
svn: E200009: 'C:/SomeTests/[email protected]': a peg revision is not allowed here
这:
svn add "C:\SomeTests\[email protected]@"
为我工作。
也是这个工作对我来说:
svn info "C:\SomeTests\[email protected]@"
更多在这里:How to escape @ characters in Subversion managed file names?
好,很好。 但是,当我想重命名或移动文件的@字符。它提供了奇怪的结果:
有:
svn mv "C:\SomeTests\test.txt" "C:\SomeTests\[email protected]"
我得到这个文件名:
C:\SomeTests\[email protected]
有:
svn mv "C:\SomeTests\test.txt" "C:\SomeTests\[email protected]@"
我得到这个文件名:
有:
svn mv "C:\SomeTests\test.txt" "C:\SomeTests\@myfile.txt"
我得到这个文件名:
有:
svn mv "C:\SomeTests\test.txt" "C:\SomeTests\@[email protected]"
我得到这个文件名:
什么SH我应该这样做,它总是有效的? 不管@符号是在开始,在中间还是在结尾?
(编辑:以我现在的问题人物总是在开始或在第二位。)