Automatic checkouts of Mathematica files from Eclipse TFS - tfs

The TFS add-in for Eclipse doesn't automatically check out files when you edit them, and you get this annoying and misleading error message when you go to save:
Mathematica could not write some data to the file
C:\Dev\ProjectName\Main\Mathematica\ExcelImport.nb. You should check
that file's permissions.
I've looked up a couple of threads:
http://team-foundation-server.blogspot.com.au/2007/06/automatic-checkouts-with-team-explorer.html
TEE 2012 does not check out files automatically
what's the best way to checkout from TFS to eclipse using TEE?
But in my case we're using it for Mathematica projects and they have the Team menu but they do not have the select Share, then select TFS
Hopefully someone out there knows a workaround, we are using Juno with TFS2010 (cough #EdwardThomson)

If you're using TFS 2012 you can create a local workspace rather then a server workspace.
Local workspaces work in a similar way to SVN and there is no need to check out files to edit them

Related

TFS - Versioning file in a drop folder

We currently use TFS 2010 for controlling some of our .NET projects.
I'd like to know whether it's possible to provide some kind of versioning within TFS for a specific folder on a network share for example.
The idea being is to control release packages (zips) for every release we do. As this bit is done by some other person (not technical and he doesn't use Visual Studio or any tech tool), it'd be great to streamline the process of versioning the zip files for every release.
Technically speaking:
We've setup this folder \servername\releasezips and every time I drop a file named release.zip, it would automatically commit (push) this file to the TFS server (no comments needed) and furthermore, once the file contents change (meaning that someone dropped another version of the file in there), the system would again push the file to TFS, but with a following version.
Is this possible somehow? I've seen somewhere that I could programatically have some extra control over TFS, using REST API.
Thanks in advance!
Thanks for your tips, Daniel and PatrickLu-MSFT.
As I said, I did want something straighforward, some kind of control similar to what box.com provides, where you associate a local folder on your machine with the cloud. So, once you drop files in the local folder, the small box client synchronizes it along with the cloud. If access the box.com, I can see the different versions of that specific file.
So what I did was, I've created a small .NET app to monitor the folder and any new files dropped in there would get checked in to our TFS server, by using the tf command line (of course ignoring work items or comments).
So, progamatically within the .NET app, it builds up the tf required commands for processing and versioning the recently dropped files and therefore, executes them.
By the way, I could have used the Team Foundation API in order to do the same job, but it would demand way more effort.
Cheers
According to your description, you want to commit/check in files during the build/release pipeline.
It's not a recommend way to check-in generated build files and modify source code during a build pipeline. If you really want to do this, you could edit the build workspace files and use tf commands in custom activity and call the powershell eq:
cd $env:BUILD_SOURCESDIRECTORY
$TFFile = Get-Item "C:\Program Files (x86)\Microsoft Visual Studio 1x.0\Common7\IDE\TF.exe"
$tfOutput = [string]( & $TFFile.FullName checkin /noprompt /override:"***NO_CI*** New version is $newVersion." /comment:"***NO_CI*** New version is $newVersion." 2>&1)
Another way is installing TFS Power Tool and use the Windows PowerShell Cmdlets to check in the files. Refer to this link for more details: PowerShell and TFS: The Basics and Beyond
For version the dropped files, you could take a look this similar question: TFS Build Copy to Versioned Folder
Basically, you have to customize build definition with custom activity and based on build.buildnumber variable to generate/create .zip file.

How to transfer a project from ClearCase to TFS?

Excuse me for the novice question :blush:
How do I detach a project from ClearCase in order to add it to a TFS source control system?
The easiest way is to do whats called a "tip" migration. This just means grab a copy of your source code from ClearCase to your harddrive. Then add all the files to TFS. This will bring over the latest version of your code, but will not bring over the history.
If you want to do a migration that brings over history you will need to use a tool such as the TFS Integration Platform. The ALM Rangers have produced a connector for ClearCase and a bunch of training and videos on how to perform a migration that can be found here: http://blogs.msdn.com/b/willy-peter_schaub/archive/2011/07/27/getting-started-with-ibm-rational-to-team-foundation-server-tfs-migrations.aspx
I know it's silly but here's what I needed to do -
Open each of the csproj files
For each one, remove the xml nodes starting "Scc" (like SccProjectName, SccAuxPath, SccProvider etc) it seems they were the ones bothering the Visual Studio.
Reload the projects and add them to desired TFS workspace
Additional Steps that may need to be done:
Open the .sln with a texteditor and delete the entire section about source control.
In Visual Studio go to Extras -> Options... -> Sourcecontrol and change the plug in to TFS

How do I export my source from TFS for import into CVS?

TFS version is 2010. CVS version is 1.11.17.
You probably want to look at the TFS Integration Platform. You should be able to setup a 2-way sync of source so that both are kept up to date.
I don't think CVS is supported out-of-the-box, but there should be someone who has written an adapter.
There is a tool from Timely Migration that should integrate with the TFS IP.
CVS is really a step back, but ok ;)
If you don't need any file history, it's very simple to export your source.
In VS2010, open View / Other Windows / Source Control Explorer.
Than open the drop-down "Workspace" and select "Workspaces ..."
There you can add a new Workspace, where you also can select your local folder to which you want to export the TFS source files.
After that you can click OK and retrieve the TFS files you want to the selected local folder.
The next step is to import all in CVS.
That's all.
EDIT:
I found a software tool that claims to offer source code migration from CVS to TFS. Perhaps it's worth to try: http://www.componentsoftware.com/Products/Converter/index.htm

TFS out of sync between local and remote - how to "re-sync"?

I have a Project on CodePlex which is using TFS and I am using the TFS Plugin for Visual Studio. Now I have copied this project and worked on another PC without TFS and done some refactoring. Foolishly, I have then just used copy/paste and manual text editing to merge my changes, expecting that TFS just picks up the changes.
Apparantly, that is not the case.
Here is a screenshot of my local directory:
My Local TFS http://img259.imageshack.us/img259/2897/tfslocal.jpg
Notice how some files are missing the lock symbol - those are missing. If you look at the current TFS Tree on Codeplex, there are some files which do not exist locally anymore, i.e. WikiPlexExtensions.cs in the main folder.
Is there any way to easily tell TFS to compare my local to the remote repository and pick up the changes? I could re-add the local files using "Exclude from local project" and re-adding them, and I could create the "deleted" files as empty files just to delete them, but if I can avoid the manual messing around that would be good as well :)
The easiest way is to exploit VS 2008's "online" feature. Basically you want to set your solution offline, then bring it online while connected to the proper Codeplex server. TFS should figure out the rest.
Feature overview: http://msdn.microsoft.com/en-us/teamsystem/bb898913.aspx
Tweaking the settings by hand: http://blogs.msdn.com/benryan/archive/2008/07/09/using-tfs-2008-power-tools-to-modify-server-s-offline-state.aspx
To compare local and server folders, you can check out TFS Power Tool. After installing it, you can bring up the source control explorer, right click on the server folder and then select 'Compare'. Folder difference window will display the differences. You can also right click on the differences to see available commands such as 'Get Latest' to update your local folder for example. Check out Bryan Harry's blog post on the power tool
I don't think there is an easy fix... What I've done in the past is back up those files that I have edited, then do a "Get Latest Version..." for the files I edited. This should change the files back to being read-only etc... Now, check out the files the regular way and paste the backups you had into the checked out files. Obviously this really only works when there are a couple of files you have edited.
TFS (in Visual Studio) has a "Reconcile" command for this, see Microsoft documentation, or this answer with steps.
BTW: This command may not haven been existing at time of original question, but this question came first when I was searching.

Does any tool exist to help Sync a directory with TFS?

When using TFS with a tool outside of Visual Studio (Specifially ORMS), modifications to the project file to include a new file will not cause the file to be added to source control.
Does anything exist that could potentially say "Warning: You are about to check in change to a project file which include a file which is not versioned"
In addition to Martin's answer, the latest release of TFS Power Toys includes:
"Windows Shell Extension (NEW!)
Allows core version control operations within Windows Explorer without using Team Explorer."
So you may just be able to commit those new files without having to fire up Team Explorer or use an MSSCCI compliant source control client.
Not quite, however you might want to download the TFS Power Tools and check out the command line utility tfpt.exe.
The "tfpt online" and "tfpt treeclean" might be most useful to you when working outside of an integrated TFS client. tfpt online will look for files in your local directory that are not under version control, treeclean will show you files in your local directory that are not under version control so that you can remove then if they are not required.
Good luck,
Martin.
One gotcha I've found using tfpt online is that it doesn't always pick up changes unless you use the /diff switch. That one caused us all kinds of headaches with our automated build until I realised what was happening!

Resources