简体   繁体   English

SVN Propset svn:keywords,只在部分目录下展开

[英]SVN Propset svn:keywords, only expanding in some directories

Good Day, I am controlling an SVN repository with over 10k .sql files.美好的一天,我正在控制一个包含超过 10k .sql 文件的 SVN 存储库。 There is a need to have the revision number updated inside the file whenever there is a commit.每当有提交时,都需要更新文件内的修订号。 To address this I ran this line on every exisiting file为了解决这个问题,我在每个现有文件上都运行了这一行

svn propset svn:keywords "Id" filename.sql

This worked and was able to see $Id$ expanded properly on the files that had $Id$这有效并且能够看到 $Id$ 在具有 $Id$ 的文件上正确扩展

Next to make sure this property was set on new files I modified my local svn config file to contain接下来确保在新文件上设置此属性,我修改了本地 svn 配置文件以包含

enable-auto-props = yes
*.sql = svn:keywords="Id";

This worked too for all my initial tests as it seemed new files were also getting properly expanded.这也适用于我所有的初始测试,因为似乎新文件也得到了适当的扩展。 But after further testing it seems some new files are not getting the $Id$ expanded.但是经过进一步测试,似乎有些新文件没有扩展 $Id$。 This is causing issues so I tried to narrow down why some are not getting expanded.这导致了问题,所以我试图缩小为什么有些没有得到扩展。 To test i created a dummy file that contained the $Id$ and i added/comitted(Using TortoiseSVN) this file to a few different directories and found mixed results.为了进行测试,我创建了一个包含 $Id$ 的虚拟文件,并将该文件添加/提交(使用 TortoiseSVN)到几个不同的目录中,发现结果不一。 (No means $Id$ didn't expand, Yes means it did) (不表示 $Id$ 没有扩展,是表示扩展了)

NO: Breakfix\DB\schema\MasterMind\nonMAS\grants\testSVN.sql
YES: Breakfix\EnvSetup\testSVN.sql
YES: Breakfix\DB\schema\MasterMind\testSVN.sql
YES: Breakfix\DB\schema\MasterMind\nonMAS\testSVN.sql
NO: Breakfix\DB\schema\MasterMind\nonMAS\indexes\testSVN.sql
NO: Breakfix\DB\schema\MasterMind\nonMAS\Scripts\testSVN.sql
NO: Breakfix\DB\schema\MasterMind\nonMAS\triggers\testSVN.sql
YES: Trunk\DB\schema\MasterMind\nonMAS\grants\testSVN.sql
YES: Trunk\DB\schema\MasterMind\nonMAS\Objects\testSVN.sql

My question is, What are some possible reasons as to why the $Id$ is not getting expanded in some directories as it is in others in the same SVN repository?我的问题是,为什么 $Id$ 在某些目录中没有像在同一个 SVN 存储库中的其他目录那样扩展,有哪些可能的原因?

Note: svn propget returns "Id" for the files that worked, and for the files that didn't svn propget returns "Header".注意: svn propget 为有效的文件返回“Id”,而对于没有 svn propget 的文件返回“Header”。

Any advice or suggestions would be greatly appreciated!任何意见或建议将不胜感激!

Thank you谢谢

Solved!解决了! I've been looking at this issue for months, but finally figured it out.我已经研究这个问题几个月了,但终于弄明白了。 This article from Tortoise SVN helped. Tortoise SVN 的这篇文章有所帮助。 https://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-propertypage.html https://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-propertypage.html

Turns out my predecessor setup some svn:keywords that were folder based.原来我的前任设置了一些基于文件夹的 svn:keywords。 This was the reason some folders didn't work for me.这就是某些文件夹对我不起作用的原因。 I was able to go to the parent folder of everything and setup a global svn:keyword and now it works for everyone.我能够转到所有内容的父文件夹并设置全局 svn:keyword,现在它适用于每个人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM