能够在签入时修改代码文件 [英] Ability to modify code files on check in

查看:61
本文介绍了能够在签入时修改代码文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

首先,如果这是错误的论坛,我道歉。我问一个关于使用Visual Studio将文件检入TFS的问题。我注意到有一个"Visual Studio Team Foundation"。论坛类别,但其中唯一的论坛与申请
见解有关,我不确定这是否是我想要的。

First, my apologies if this is the wrong forum. I am asking a question about using Visual Studio to check a file into TFS. I notice that there is a "Visual Studio Team Foundation" forum category, but the only forum within there is to do with application insights, and I am not sure if that is what I want.

我的问题是这个。有没有办法在检入TFS时自动修改代码。特别是,我们希望确保在当年根据版权声明检查源文件时是当前年份,例如"Copyright(c)2018"?

My question is this. Is there a way to automatically modify code when it is checked into TFS. In particular we want to make sure that when a source file is checked in the year against the copyright notice is the current year, e.g. "Copyright (c) 2018"?

我知道Visual SourceSafe有一些关键字可以识别并翻译成适当的其他文本。但是,我不知道TFS有类似的东西。 (我知道删除关键字替换是故意的设计决定吗?)

I know that Visual SourceSafe had some keywords that it recognised and translated into appropriate other text. However, I am not aware that TFS has anything similar. (I understand that it was a deliberate design decision to remove keyword replacement?)

另一种选择可能是在签入文件时运行的脚本,它会查找版权声明和取代年份。

An alternative may be a script that it run when a files are checked in that would look for the copyright notice and replace the year.

请有人就可以达到我们想做的最佳方式提供建议。 (如果它类似于签入脚本,如何设置它。)

Please can someone give advice as to the best way to achieve what we want to do. (And if it is something like a check-in script, how to set that up).

提前感谢所提供的任何帮助。

With thanks in advance for any help offered.

Andrew Ch。

Andrew Ch.

推荐答案

我认为现在的方法是创建一个自定义登记政策,要求提供此版权声明。您可以查看以下链接:

I think the way to go is to create a custom check-in policy to require this copyright notice. You may check these links:

https: //msdn.microsoft.com/en-us/library/bb668980.aspx

https://stackoverflow.com/a/42933610/1184708


这篇关于能够在签入时修改代码文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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