我可以复制 TFS2010 中的文件历史记录吗?

发布于 2024-11-30 01:12:58 字数 555 浏览 6 评论 0原文

我正在检查我的代码库并重构一些东西。有时,我会遇到在单个文件中包含类似内容的文件:

public class A
{
    // Tons of code
}

public class HelperThatWasOriginallyOnlyUsedHereButHasExpandedToBeUsedEverywhere
{
    // Tons of code
}

因为该文件已经存在很长时间了,所以它有一个相当长的更改集列表。

不幸的是,它位于一个名为“A.cs”的文件中,更合适的是它位于两个文件“A.cs”和“HelperThatWasOriginally....cs”中。

我希望新文件(文件中的第二类)能够轻松追踪到其来源(A.cs),但在新文件的顶部添加注释,例如“此文件最初是 A.cs 的一部分”似乎有点做作,很容易被忽视。

我真的不知道 TFS 如何在内部解决这个问题,因为我可以看到这两个文件的变更集历史记录在“分割”日期之前发生冲突(它们曾经是同一个文件),但我希望这是可能的尽管如此。

I'm going through my code base and refactoring some stuff. Occasionally, I run into files that have content like this within a single file:

public class A
{
    // Tons of code
}

public class HelperThatWasOriginallyOnlyUsedHereButHasExpandedToBeUsedEverywhere
{
    // Tons of code
}

Because this file has been around for a long time, it has a rather lengthy change set list.

Unfortunately, it's in a file called "A.cs", where it could more appropriately be in two files, "A.cs" and "HelperThatWasOriginally....cs".

I want the new file (the second class in the file) to be easily traceable to its origin (A.cs), but putting a note in the top of the new file like "this file was originally part of A.cs" seems somewhat hokey and easily overlooked.

I don't really know how TFS could internally resolve this, because I can see the two files would have changeset histories that conflicted prior to the "split" date (they used to be the same file), but I was hoping it was possible nonetheless.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

原来分手还会想你 2024-12-07 01:12:58

这有点麻烦。您可以对文件进行分支,这将保留共享历史记录。然后从每个新文件中删除不需要的类。

It's a bit of a cludge. You could branch the file, that would keep the shared history. Then delete the unwanted classes from each of your new files.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文