none
TFS alert when checking out a file that already has a pending change?

    Question

  • I have a small team of developers, and we're pretty good at conflict tracking so don't want to go down the road of Exclusive Locking for every job.

    It would be useful though if another developer has a pending edit on a file, that any other user would be notified if they also attempt a checkout on that asset.

    It's quite easy to keep track of this via Source Control Explorer, but when working in Solution Explorer, or when unshelving a job that's been on hold for a few days, it's more difficult to tell if your change will conflict with an already in-flight task.

    Does anyone know if this can be done, either via Alert Subscriptions, or with a popup dialog inside VS2010?

    Currently runnning TFS2008 with VS2010, but upgrading to TFS2010 in the next few weeks.

    Many thanks,

    Dan

    Monday, October 03, 2011 11:27 AM

Answers

All replies

  • A short answer.


    Unfortunately you cannot do this out of the box. There is a notion of events in TFS on which you can respond. For Version Control there is only the Check-in alert.

    Maybe you can consider putting a feature request on the Microsoft Connect, go here: https://connect.microsoft.com/VisualStudio/

    Every feedback submitted will be evaluated carefully by engineers. If they have some feedback on it, they will let you know their comments further through that portal. This would be helpful to improve Visual Studio products.


    René van Osnabrugge
    W: www.delta-n.nl
    B: osnabrugge.wordpress.com
    T: @renevo
    Monday, October 03, 2011 12:32 PM
  • Thank you, I've submitted a feature request as suggested:

    http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2292029-allow-a-tfs-alert-when-checking-out-a-file-that-al

    Is anyone aware of something similar that can be achieved via either an event or a VS popup?

    TFS is aware of the edit state, as it shows up in Source Control Explorer - this would just need to bind to that event and alert when more than one user is trying to pend an edit to a code item. Similar to the behaviour when an exclusive lock is applied, but just a notification rather than denying the checkout.

    It sounds straightforward in principle, but of course things are seldom that easy in practice!

    Thanks again for the response,

    Dan

    Monday, October 03, 2011 12:59 PM
  • When you are in Solution explorer you can tell when someone else has the file checked out. Instead of the pad lock icon you get a little person icon. That icon is to the alert you that someone currently has the file checked out.

    You also get alerted in your output window for example.

    $/Demo/CodeCoverage/TestProject/MathTests.cs:
       opened for edit in WIN-GS9GMUJITS8;Administrator

    The output above is when I am logged in as someone other than administrator.

    Good Luck,
    Donovan

    Monday, October 03, 2011 11:55 PM
  • Thanks Donovan - I forgot to add, the 'little person icon' seems to be very hit and miss on our setup - it regularly displays the "checked out by another user in another area" notification even when this explicitly isn't the case (confirmed via both Source Control Explorer, and the Status Sidekick tool).

    I was wondering if perhaps it gets its notifications via the project/solution file rather than directly from source control? That way it would only be as up to date as when the project file was last checked in?

    The Output window is of interest though - is it possible to bind an event to the data output in there?

    Many thanks,

    Dan

    Tuesday, October 04, 2011 6:44 AM
  • I see you have already entered an enhancement request for Team Foundation Server.  This is the correct move.

    I could find no examples of binding an event to the Output Window in TFS.  However, since you are trying to determine a pending edit on a file, you might be able to use the TFS API  VersionControlServer Class and call one of the QueryPendingSets() methods.  This is just an idea you might want to investigate.  See http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.versioncontrol.client.versioncontrolserver.aspx


    --Trevor H.
    Thursday, October 06, 2011 6:20 PM