1
votes

Recently, one of the junior developers made a check-in to a large MVC SOA C# application, to both the client and service side, which makes the project unbuildable. Their check-in added spurious dependencies as well as removed required files, with something like 900 files in the project affected.

In order to keep the project moving forward, I was instructed by management to simply obtain the project from the changeset prior to this check-in in TFS and and then apply all changesets after the bad check-in going forward, since we though a release would be urgently needed.

As the weeks have passed, however, this approach is getting untenable. Is there a way to do one of these two things in TFS?

Either

  1. remove a changeset from TFS without removing the changesets that come after it?

or

  1. Automatically get all of the changesets in TFS for a solution except for one specific changeset.
1
You can simply roll back the bad changeset. Now that some time has passed you might have some "fun" with the merge conflicts, but getting rid of the broken code will be better in the long runJames Reed

1 Answers

0
votes

remove a changeset from TFS without removing the changesets that come after it?

According to the document Roll back changesets:

A changeset is a permanent part of the history of your version-controlled items and cannot be undone or removed. However, you can roll back the effects of one or more changesets.

So, we could not remove one specify changeset. Just like James said, we could roll back the bad changeset. But it will also remove the changesets that come after it. As workaround, you can check the Changeset details for that specify changeset. Then ask that the junior developers remove his code, then check in the delete changeset.

Automatically get all of the changesets in TFS for a solution except for one specific changeset.

There is way to find and view a TFS changeset by comment text:

tf history $/ -r | ? { $_.comment -like '*findme*' }

Check the this thread for some more details.

But there is no such out of box method to exclude one specific changeset in the text, we need to write our scripts like, batch, powershell to except it from the text.

Hope this helps.