Question

I have a gated checkin build which does change some files of the changeset which is provided by the user requesting the build. The build does mainly set the build version number in the source files for all targets.

The gated checkin activity does checkin the shelveset of the user. Now I want to checkin also the changed files by my build which can potentialy conflict with files part of the users shelvset. This results in merge conflicts.

Is use VersionControlServer.CheckinShelveset which has no options to force a checkin in case of merge conflicts due to the other checkin of the previous shelveset. I tried to change the shelveset provided by the user but I cannot change a shelveset which was not created by the same user. I am forced therefore to create a second shelveset and wait until the gated checkin activity which lives on the build controler has succeeded.

When I have a workspace I could resolve the changes but on the build controler there is no workspace (it is on the build agent) so I would have to create a new workspace, unshelve the shelveset of the other user and try to merge my other shelveset into this one and then try to checkin which is not easy and more seriously it would take quite some time.

Is there a way to checkin a shelveset in and force TFS to simply overwrite the latest version without having a workspace? Or is there another way to get my changes of the build checked in without merge conflicts? If I would check earlier on the build agent then the gated checin will fail with merge conflicts on the build controler.

Était-ce utile?

La solution

If you have your code that does this run on the build agent rather than the controller, you would have access to the workspace. In that case, you could consider having two checkins: the first is the user's changes, and the second would be the modifications your code made. Or, you could simply make the changes to the code and then do the checkin from the workspace of the build agent. In that case, the shelveset submitted by the user would not be used for the checkin but as the basis for your code to make further changes and then check that in.

There's no way to force a shelveset to be checked in despite conflicts.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top