How to prevent TFS from deleting shelvesets that were checked in via a queued build?

不想你离开。 提交于 2020-01-07 02:56:06

问题


Checking in shelvesets is a nice feature of the build system in TFS, but the shelveset is deleted after the build finishes. Is there a way to change this behavior so that the shelveset is preserved?

I use the build+check in shelveset feature all the time to check in code from teammates, but sometimes I don't want the original shelveset to be deleted by TFS. In some situations, this can cause problems, like when the shelveset is associated with a code review work item. In that case, all comments from the code review are hidden by Visual Studio because it can't find the associated shelveset.

I searched on the default properties window when queuing the build in Visual Studio but there doesn't seem to exist any option to control this behavior. Will I have to customize the build xaml to change this, or is there a known way without having to get to that?


回答1:


If you mean build+ check in shelveset is building shelveset and check in the changes after build successful as below:

Then it's impossible. Since you have checked in your shelveset. This is not related to build. So this question is the same as how to check in shelveset and prevent deleting shelvesets. Shelve saving all of the changes on your box without actually checking in. The changes are persisted on the server. So other team members can see the source code and can also check in other's shelvest.

You can also treat is as a kind of container.

  • You create your file and commit it to a shelveset (container A).
  • You then go to the build agent and get that Shelveset into the local workspace (container B)
  • You then commit the shelveset (from container A to source control) the check in from Container A is successful and Container A is deleted to reflect that the Gated Shelveset has completed it's life cycle (if it failed it would remain intact)


来源:https://stackoverflow.com/questions/35875439/how-to-prevent-tfs-from-deleting-shelvesets-that-were-checked-in-via-a-queued-bu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!