我可以复制 TFS2010 中的文件历史记录吗?
我正在检查我的代码库并重构一些东西。有时,我会遇到在单个文件中包含类似内容的文件:
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这有点麻烦。您可以对文件进行分支,这将保留共享历史记录。然后从每个新文件中删除不需要的类。
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.