颠覆汽车道具的困境
这让我抓狂,所以欢迎其他用户提供任何建议。 我正在使用 Subversion,并在 Windows 服务器上安装了 VisualSVN 1.6.1 的副本。 在我的 PC 上,我结合使用了 TortoiseSVN 和出色的 AnkhSVN Visual Studio 插件。 一切都像梦一样,但现在我尝试使用 svn:keywords 功能,这样我就可以在所有源文件的顶部包含 $Id$
。 现在,对于现有文件,我可以编辑 SVN 属性并添加此关键字,一切正常,但我希望对新文件自动完成此操作 - 但我无法使其工作。
根据文档,您需要编辑位于 C:\Documents and Settings\
文件夹中的特殊 Subversion Config 文件。 我的电脑已经有该文件的副本,因此我将其更改为如下所示:
[miscellany]
enable-auto-props = yes
[auto-props]
*.cpp = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.hpp = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.rc = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.rc2 = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.cc = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.c = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.h = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.wsf = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.js = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.htm = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.html = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.css = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
然后,我将一个新文件添加到现有的 Visual Studio 项目(从 Visual Studio 内),将 $Id$
添加到顶部并提交了它 - 但是,唉,svn:keywords
属性没有被设置。
有谁知道如何让它工作? 我什至尝试将设置添加到注册表(在 HKEY_CURRENT_USER\Software\Tigris.org\Subversion\Config
中),但仍然不满意。 然后我尝试弄乱 SVN 服务器本身上的配置文件,但似乎没有任何效果。
我显然错过了一些非常明显的事情!
This is driving me nuts so any advice from fellow users would be welcome. I am using Subversion, with a copy of VisualSVN 1.6.1 installed on a Windows server. On my PC I am using a combination of TortoiseSVN and the wonderful AnkhSVN Visual Studio plugin. Everything works like a dream, but now I am trying use the svn:keywords
feature so I can include $Id$
at the top of all my source files. Now, for existing files I can edit the SVN properties and add this keyword and it all works fine, but I want this done automatically for new files - and I cannot make it work.
According to the documentation you need to edit a special Subversion Config file located in your C:\Documents and Settings\<user>\Application Data\Subversion
folder. My PC already had a copy of this file, so I changed it to look like this:
[miscellany]
enable-auto-props = yes
[auto-props]
*.cpp = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.hpp = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.rc = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.rc2 = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.cc = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.c = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.h = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.wsf = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.js = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.htm = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.html = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
*.css = svn:eol-style=native;svn:keywords=Author Date Id HeadURL Revision
I then added a new file to an existing Visual Studio project (from within Visual Studio), added $Id$
to the top and committed it - but, alas, the svn:keywords
property is not being set.
Does anyone know how to get this working? I even tried adding settings to the registry (in HKEY_CURRENT_USER\Software\Tigris.org\Subversion\Config
) but still no joy. I then tried messing with Config files on the SVN server itself, but nothing seems to work.
I have obviously missed something blindingly obvious!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
看来答案只是围绕实际关键字的一些愚蠢的引用:)
It seems that the answer is just some silly quotes around the actual keywords :)
如果您想确保选择了正确的配置文件,请使用 TortoiseSVN 的编辑按钮: 颠覆维基。
我能找到的唯一类似问题是用户抱怨这不适用于大写文件扩展名,但这是针对 Fedora 的,不适用于 Windows: 链接
If you want to be sure you've picked the correct config file, use TortoiseSVN's edit button: Subversion Wiki.
The only similar problem I could find was a user complaining about this not working with uppercase file extensions, but this is for Fedora, not for Windows: link
你是对的,问题出在 AnkhSVN 上。 如果在 Visual Studio(使用 AnkhSVN 2.0.5250)中添加新文件,则不会自动添加关键字属性。 仅当您使用 Tortoisvn 添加文件时才会添加它。
我下载了 VisualSVN 的试用版(Visual Studio 的插件)。 它不存在这个问题。 属性会自动添加到 Visual Studio 中添加的新文件中。
You're right, the issue lies with AnkhSVN. The keywords properties will not be automatically added if the new file is added in Visual Studio (with AnkhSVN 2.0.5250). It will only be added if you add the file using Tortoisvn.
I downloaded a trial version of VisualSVN (plugins to Visual Studio). It does not have this issue. Properties are automatically added to new files added in Visual Studio.
这似乎是 AnkhSVN 的问题。 我在 Visual Studio 之外做了一些测试,使用 TortoiseSVN 添加文件,然后它开始工作(使用我的用户配置文件)。 我将尝试最新的 AnkhSVN 看看这是否有什么不同。
我更喜欢在服务器端完成此操作,但这似乎是特定于用户的。
不管怎样,感谢 Len 和 schnaader 的指点。
This seems to be an issue with AnkhSVN. I did some tests outside of Visual Studio, using TortoiseSVN to add the files, and it started working (using my user config file). I will try the latest AnkhSVN to see if this makes any difference.
I'd prefer to have this done at the server end, but this seems to be user-specific.
Either way, thanks for the pointers Len and schnaader.