1

I would like to know if it's possible, eventually by developing somethng using the SDK, to provide a check-in comment automatically when checking-in in TFS.

UPDATE: I tried using the SDK API like so:

TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(tfsName); tfs.EnsureAuthenticated(); VersionControlServer versionControl = (VersionControlServer)tfs.GetService(typeof(VersionControlServer)); versionControl.CommitCheckin += VersionControlOnCommitCheckin;

But the event does not seem to be fired. Is there anything blatantly wrong I'm doing?

Simone
  • 3,607
  • 1
  • 31
  • 37
  • Jerry-- I'll still try. Where are you writing this code, is it a standalone application? A Visual Studio plug-in? Where are you doing the checkin from, code or the VS 2010 UI? – Robaticus Jul 21 '10 at 22:49
  • I would like to have a transparent way, that is, not attached to VS or any other application, to provide a checkin comment automatically. – Simone Jul 22 '10 at 08:38
  • @jerry: because of the few questions I made none received a good reply? – Simone Jul 22 '10 at 14:09

3 Answers3

1

The problem is that the TFS API events used as shown in my question are raised only when the operations are performed from the same API instance, thus same machine, same process, same AppDomain.

Simone
  • 3,607
  • 1
  • 31
  • 37
0

Without knowing anything about TFS, that sounds like it runs counter to the purpose of having a commit comment. You're supposed to include useful high-level information in a check-in comment about why things have changed. If people just want to know what has changed, they can look at diffs. Automatically generating a comment would seem to be defeating the point.

Gian
  • 13,735
  • 44
  • 51
  • I agree in spirit, Gian. However, there are times (as I mentioned in my answer) where you need to show that the checkin occurred outside of normal human interaction. – Robaticus Jul 21 '10 at 18:15
  • 1
    I have time tracker and want my task information to propagate to check-in comments automatically. – Ben Mar 01 '11 at 11:16
0

Both the SDK and the command line allow you to specify the check-in comment. If you're looking at doing this when the person checks in from within Visual Studio, you'll have to look at some automation, but, with VS2010, it should be relatively straightforward using DTE/MEF.

We have a couple automated processes that do check-ins, and we specify the comment to indicate that the check-in occurred as part of an automated process.

Robaticus
  • 22,857
  • 5
  • 54
  • 63