Domanda

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.

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top