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我應該這樣做,它總是有效的? 不管@符號是在開始,在中間還是在結尾?
(編輯:以我現在的問題人物總是在開始或在第二位。)