M
M
Maxim Nikitin2016-01-15 11:43:23
Team Foundation Server
Maxim Nikitin, 2016-01-15 11:43:23

How to execute TFS undo command only if there are files in Pending changes?

The build project comes with an undo command to exclude all files from Pending changes. Under certain conditions, there are no such files and undo does not work:

<Exec command="$(tfcommand) undo /recursive /noprompt &quot;$(SolutionRoot)&quot;"/>

I know that you can hack and add
IgnoreExitCode="true",
but I would like to know a more correct solution, i.e. run undo only if there are files in pending changes.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oxoron, 2016-01-16
@MaxSter

Ask TFS for a list of files in Pending Changes, determine its length.
Example . If necessary, you can drive the code into a PS script.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question