简体   繁体   中英

Is there a TFS check-in policy to prevent check-ins across team projects?

I'm having some trouble with some team members accidentally checking in code across (usually unrelated) Team Projects. I could flog them for not being careful or try to find an easier way to bring this to their attention. We are running TFS 2010 & VS 2010.

Is there a TFS check-in policy to prevent check-ins across team projects?

I'm really disappointed by these responses. TFS is a tool to make developers work better and more efficiently. To blame a developer for being lazy or not paying attention seems like an absolute cope out. What if you hire a new employee that has limited knowledge and simply makes a mistake? Tools should allow us to assist and teach developers on appropriate methods.

They shouldn't have this problem if they either check in from the Solution Explorer or from a sub-folder (or individual team project) in the Source Code Explorer. It sounds like they're being lazy and simply right clicking on $/ and checking in.

That being said, I haven't seen any out-of-the-box policies for doing this. However, writing your own using the TFS API is very straightforward.

Jim Lamb's article is probably the best place to start:

http://blogs.msdn.com/b/jimlamb/archive/2010/03/31/how-to-implement-package-and-deploy-custom-check-in-policy-for-tfs-2010.aspx

In TFS 2010 check-in policies aren't evaluated for check-ins across multiple projects, so a check-in policy can't do what you want.

However, there is code for a VS addin in the first comment of this bug-report which looks like it does what you want: http://social.msdn.microsoft.com/Forums/en-US/tfsversioncontrol/thread/a71ac2f0-dc9c-4c03-a6a3-ab59877c55d8/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM