问题
Same situation as this [question]: TFS Meltdown - How can I recover shelved changes but for TFS2015. The issue I'm having is I can't find the files that were added or renamed in my query result.
SELECT c.[CreationDate], c.[Content], vi.ChildItem, vi.ParentPath
FROM [dbo].[tbl_Content] c
INNER JOIN [dbo].[tbl_FileMetadata] fm ON fm.ResourceId = c.ResourceId
INNER JOIN [dbo].[tbl_FileReference] fr ON fr.ResourceId = fm.ResourceId
INNER JOIN [dbo].[tbl_PendingChange] pc ON pc.FileId = fr.FileId
INNER JOIN [dbo].[tbl_Workspace] w ON w.WorkspaceId = pc.WorkspaceId
INNER JOIN [dbo].[tbl_Version] vi ON vi.ItemId = pc.ItemId AND vi.VersionTo = 2147483647
WHERE w.WorkspaceName = 'SHELVESET_NAME'
UPDATE: Was able to figure out the query.
SELECT w.WorkspaceId, c.[CreationDate], c.[Content], pc.TargetChildItem, pc.TargetParentPath
FROM [dbo].[tbl_Content] c
JOIN [dbo].[tbl_FileMetadata] fm ON fm.ResourceId = c.ResourceId
JOIN [dbo].[tbl_FileReference] fr ON fr.ResourceId = fm.ResourceId
JOIN [dbo].[tbl_PendingChange] pc ON pc.FileId = fr.FileId
JOIN [dbo].[tbl_Workspace] w ON w.WorkspaceId = pc.WorkspaceId
WHERE w.WorkspaceName = 'SHELVESET_NAME'
回答1:
I was able to figure out the query by looking at table tbl_PendingChange and looking for the new files that was added and then correctly updated the original query.
来源:https://stackoverflow.com/questions/42233302/tfs2015-how-can-i-recover-shelved-changes