Feature Request: Support for 'tf history'

Hi -

A small feature request, if I could:  I use the "tf history" command in many of my fb6 projects to extract changeset numbers for specific files/folders.  I then use these changeset numbers as version numbers that are burned into application config files, etc.

Currently, the Team Foundation Server support for FB6, while otherwise excellent, does not provide any wrapper for the history command.  This was never a problem previously - I just used the "execute program" task to run tf.exe myself.  Now, however, I'm trying to run my FB6 project on a machine that's not in the same domain as the TFS server, so I need to supply credentials.  The built-in TFS actions have support for custom credentials, but unfortunately, there's no (obvious) way to get a similar effect for tf history.

 

Hi Carl,

I’ll add the request to the feature request list for the next version of FinalBuilder. In the meanwhile though, you should be able to keep using the Execute Program action, you just need to supply the /login command line option:


/login is used to specify the user name and password to authenticate the user with the Team Foundation Server. The usage is /login:username[,password]. If /login:username is supplied but /noprompt is not, the user is prompted for the password. If /login:username,password is specified, Team Foundation Server uses the supplied parameters.


Regards,
Paul.

Oh yes, I forgot about the /login option.  That'll help a little bit, but it's not quite a substitute - unless, that is, there's a way to get at the default credentials that are set up for the TFS plug-in from within the normal execute program action.

As I understand it, the default credentials (set through Tools|Options) are stored as user settings, while a use of the /login command line argument would end up being stored in the FB6 project file where I don't want it (since machines that are domain joined don't need it).

I'll give that a go in the meantime though - while it's not perfect, it's a step in the right direction.

 

Hi Carl,

EDIT: We're going to add the action to the current version of FinalBuilder, I'll let you know when a build is available.


> unless, that is, there's a way to get at the default credentials that are set up for the TFS plug-in from within the normal execute program action

This is possible; Define two new variables, TFSUser & TFSPass and add the following Javascript scripts to the Execute Program action:

BeforeAction:

var tfsOpts = GetOptionsObject("Team Foundation Source Control");
TFSUser = tfsOpts.Properties.PropertyAsString("DefUsername");
TFSPass = DecryptString(tfsOpts.Properties.PropertyAsString("DefToken"));

AfterAction:
TFSUser = "";
TFSPass = "";

OnStatusMessage:
if (StatusMessage.MessageText.indexOf("login") > -1)
StatusMessage.Lines.Clear();

Then you can specify the login as /login %TFSUser%:%TFSPass%.

Regards,
Paul.

Awesome, thanks!

Hi Carl,

Here’s the new build of FinalBuilder which includes a TFS History action.

URL: https://www.finalbuilder.com/downloads/finalbuilder/630/FB630_1903.exe

Regards,
Paul.

You do know that you folks rule, right?

I'll check out the new build later this week & let you know if I have any problems (which I'm not expecting to be the case).

 

OK, it took me longer than a week, but I finally got back to this project - the new tf history action works great.  Thanks so much!

 

Excellent! Thanks for letting us know

Incidentally - The history command seems to work fine with tf 2008, but when I tried with tf 2005 the action reported "Failed!", yet when I typed the exact command line, including the full path to (2005) tf.exe, it worked just fine.

I'm not sure if this is a bug, or a failure in my expectations or my test case.  It's fine with me if it only works with 2008, but it caught me by surprise.

Hi Carl,

Did the action report why it failed with TFS 2005?

Regards,
Paul.

The details text in the log reads:

Path to Executable: C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\tf.exe
Command line: history /stopafter:1 /noprompt $/path-to-my-file
Failed!