为什么Subversion跳过包含@符号的文件? [英] Why Subversion skips files which contain the @ symbol?

查看:90
本文介绍了为什么Subversion跳过包含@符号的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

when I try to execute command like this (from a command-line or Perl script - it doesn't matter):

svn revert "build\myfile@test.meta"

SVN跳过此文件并输出:

SVN skips this file and outputs:

Skipped 'build\myfile'

我尝试做:

svn revert "build\*.meta"

但是它给出了相同的结果.

But it gives the same result.

我可以从GUI恢复这些文件.而且我可以通过执行这些文件的还原(但是它还原的幅度比我想要的还要多):

I can revert these files from the GUI. And I can revert these files by doing (but it reverts more than I want):

svn revert --recursive "build"

是否有解决方法?

推荐答案

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

The @ sign in filenames in Subversion actually has a special meaning - a pegged revision number. To quote the Subversion book:

具有洞察力的读者可能在此时想知道钉钉修订版语法是否会导致工作副本路径或URL中实际带有符号的问题.毕竟,svn怎么知道news @ 11是我树中目录的名称还是只是新闻修订版11"的语法?值得庆幸的是,尽管svn始终假定后者,但有一个简单的解决方法.您只需要在路径末尾附加一个at符号,例如news @ 11 @. svn只关心参数中的最后一个符号,在符号后省略字面钉修订说明符并不被认为是非法的.此解决方法甚至适用于以at符号结尾的路径-您可以使用filename @@来讨论名为filename @的文件.

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@.

因此,您应该在脚本中的文件名后添加@符号,如下所示:

So, you should append an @ sign to filenames in scripts, like this:

svn revert "build\myfile@test.meta@"

这篇关于为什么Subversion跳过包含@符号的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆