从TFS获取最新消息时的时间戳记,这有关系吗? [英] timestamp when Getting Latest from TFS and does it matter?

查看:90
本文介绍了从TFS获取最新消息时的时间戳记,这有关系吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定为什么以前从未注意到这一点,但是当我从TFS获取最新"消息时,本地工作文件夹中文件的日期和时间设置为当前日期和时间.即使未做任何更改,这也适用于创建"和修改"日期(就像我刚刚做的获取最新"一样).

I'm not sure why I never noticed this before but when I "Get Latest" from TFS, the date and time on the files in my local working folder are set to the current date and time. This applies to the Created and Modified dates, even if no changes have been made (as I just did "Get Latest", nothing more).

我应该担心文件的日期和时间没有反映出创建和随后修改文件的真实日期和时间吗?我在TFS中有修订历史,所以我不太担心,但是我必须承认这感觉不对.一切在技术上都可以,但是我想知道发生了什么.

Should I be concerned about the dates and times of the files not reflecting the true date and time the file was created and subsequently modified? I have the revision history in TFS so I'm not overly concerned but I gotta admit this feels wrong. Everything technically works but I want to know what's going on.

推荐答案

您注意到,Team Foundation Server的默认行为是将文件时间写入当前"时间(检索文件时).大多数版本控制工具的默认行为,通常被认为是安全的.

As you note, the default behavior in Team Foundation Server is to write file times to the "current" time (when you retrieved the file.) This is the default behavior of most version control tools and generally considered safe.

在许多情况下,将时间设置为远程时间可能会带来负面影响.例如,make将扫描比上次构建时间更新的文件.将文件时间设置为服务器时间可能会影响确定自上次构建以来哪些文件已更改的能力.

Setting time to the remote time can have negative consequences in many scenarios. For example, make will scan for files newer than the last build time. Setting file times to the server's time can impact the ability to determine which files have changed since the last build.

但是,如果您确实喜欢这种行为,并且至少使用了TFS 2012和Visual Studio 2012,则可以通过将文件时间"设置为签入"来基于每个工作区启用它:

However, if you do prefer this behavior and are using at least TFS 2012 and Visual Studio 2012, you can enable it on a per-Workspace basis by setting "File Time" to "Checkin":

其他详细信息来自Microsoft :

文件时间:

  • 如果要每个文件的日期和时间戳与您的版本的变更集的戳匹配,请选择签入 工作区.一些问题和例外是:

  • Choose Checkin if you want the date and time stamp of each file to generally match the stamp of the changeset of the version in your workspace. A few issues and exceptions are:

  • 修改本地文件时,日期和时间戳将与修改文件时的日期和时间匹配.

  • When you modify the local file, the date and time stamp will match the date and time when you modified the file.

仅当您使用Visual Studio 2012或更高版本以及Visual Studio Team Foundation Server 2012或更高版本时,此功能才可用.

This feature is available only if you are using Visual Studio 2012 or later and Visual Studio Team Foundation Server 2012 or later.

该设置不适用于文件夹,除非对该文件夹包含的文件执行挂起的添加或删除操作.

The setting does not apply to folders, unless there is a pending add or delete operation to a file contained by the folder.

您可能无法逐步构建代码项目.相反,您将不得不重建).

You might not be able to build your code project incrementally. Instead, you will have to rebuild).

如果希望日期和时间戳与上次修改本地文件时的日期和时间匹配,请选择当前.例如,一个 团队成员在星期一检入了对文件的最新更改.在 星期二,您执行获取操作以更新文件.日期和 时间戳记设置为星期二.

Choose Current if you want the date and time stamp to match the date and time when you last modified the local file. For example, a team member checked in the latest change to the file on Monday. On Tuesday, you perform a get operation to update the file. The date and time stamp is set to Tuesday.

这篇关于从TFS获取最新消息时的时间戳记,这有关系吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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