How to remove a specific ChangeSet in TFS 2010?

后端 未结 3 1509
逝去的感伤
逝去的感伤 2020-12-11 01:33

How to remove a specific changeset in tfs2010?

I have changeset version numbers with 545, 544, 543,542.

Now, I am looking to delete the particular changeset

3条回答
  •  悲&欢浪女
    2020-12-11 02:20

    Disclaimer - you should never, never do this. Don't even think about it!

    Background - I am trying to do a partial TFS migration, and having the most villainous time with the "TFS Integration" tool. Recently it dumped a series of wrong changesets into my destination TFS. Instead of wiping everything out and starting from scratch, I nosed around the TFS database, and came up with the following (on TFS 2013, TFS 2010 would be more or less similar I suppose):

    declare @ChangeSetId int = 5735
    
    -- Delete the actual file content first
    delete from tbl_Content where ResourceId in (select ResourceId from tbl_File where FileId in (select FileId from  tbl_Version where VersionFrom = @ChangeSetId))
    -- Remove the file
    delete from tbl_File where FileId in (select FileId from  tbl_Version where VersionFrom = @ChangeSetId)
    -- Purge the version
    delete from tbl_Version where VersionFrom = @ChangeSetId
    -- Destroy the changeset
    delete from tbl_ChangeSet where ChangeSetId = @ChangeSetId
    

    It is not wise to do it. It is not supported by Microsoft. Do not use it on a live production environment! Use rollback instead! But if you're desperate to wipe out a changeset, you can try this. But don't tell me you were not warned.

提交回复
热议问题