TFS Version Control Integration in MATLAB and Simulink.
Jasper - Thank you for the insights.
Without knowing more about your specific requirements, my general recommendation would be to choose between TFVC and Git first based on whether a centralized or distributed source control system makes more sense for your team's workflows, and then to focus on things like integration with other tools second.
This page is a little VSTS specific, but it recommends you choose Git unless you have a specific need for the centralized server approach used by TFVC: https://docs.microsoft.com/vsts/tfvc/comparison-git-tfvc?view=vsts
If MATLAB integration is a hard requirement for you and a deciding factor in which source control technology to use, this might sound a little odd as the author of this add-on, but you might want to consider switching to Git. Don't get me wrong, if your team has a need for TFVC, then I definitely recommend you test out this add-on to see if it can add value for you, but if you really do have a choice in the matter, I would personally lean towards Git for the following reasons:
Git integration is built directly into MATLAB, so you don't need to install an add-on. As part of the official product, support will be more formal. Also, as updates are made to MATLAB's source control integration platform, the built-in Git integration will get these updates sooner. There are also lots more tools that integrate with Git, which would give your team members more freedom to use whatever tools/workflows fit best for them. I've also personally found it much easier to switch between Git branches than to juggle between TFVC shelfsets when working on more than one thing at a time.
Thanks for replying. We are on TFS2010 and won't be updating for a few more months.
In your opinion is TFS support within Matlab using the add-on sustainable in the long-term? Will we have to switch to Git eventually?
TFS has two kinds of workspaces: "local workspaces" and "server workspaces". The TFS integration with MATLAB uses local workspaces to streamline some user experiences. For example, with a local workspace, editing a file automatically sets the TFS file state to "edit". With a server workspace, you need to explicitly call a "tf edit" command to tell the server about changes you've made.
Local workspaces were introduced in TFS 2012. Are you using an older version of TFS? Is it possible to upgrade your TFS instance?
I'm getting the following error and have been unable to resolve it. Any idea?
TF204000: The Team Foundation server to which your team project is connected does not support local workspaces.
It would be great if there was a short video showing how to do the basic functions of TFS for a Matlab code project. And include some basic background.
It looks like your user java class path file has some incorrect entries in it. The script installTFS should not create entries that start with the $ token.
Could you take a look at the file
>> file = fullfile(prefdir,'javaclasspath.txt')
and delete it or remove any entries that contain TFS. If you then restart MATLAB the warnings should go away.
It should be possible to rerun the installTFS script after doing this. If this doesn't work feel free to contact me directly and I'll work with you to get this integration working.
I am having some trouble when restarting MATLAB after step 2.
""Warning: Unrecognized token "$\MATLAB\Add-Ons\Apps\TFSVersionControlIntegration\code\dist\TFS-SDK\redist\lib\....jar" in Java path specification."
""Warning: Unrecognized token "$\MATLAB\Add-Ons\Apps\TFSVersionControlIntegration\code\dist\intergation\....jar" in Java path specification"
With the .jar file in each folder apparently causing the problem.
Any ideas how to fix this?
Had some trouble with a java error while sorting simulink project files by the column that shows commit numbers. Looks like if the column contains blanks (files that are not yet checked in), it throws an error and you get to start matlab.
I decided to remove it because I ended up using DevStudio anyway.
Botched the install, had to reinstall and then follow the uinstall directions and delete the add-on folder manually to get the TFS Endpoint box to go away.
note: was able to fully uninstall by removing the remaining files under my Add-On install directory
This integration requires the URL of your TFS server (endpoint) to work properly. An example URL is given in the documentation for this app.
Please feel free to contact me if you need some help getting started using this integration.
doesn't work for me, keeps asking the TFS endpoint
I am trying to use TFS in VS2015/MATLAB 2017a.
In TFS we can set labels on a set of model files and select to check out from label.
I have not found how to check out from label in Matlab or SimulinkProject. Is it possible? Or is it only possible to check out the most recent version?
The inface also creates TFS workspace with names as 'MathworksSandbox1511251980172'. Is it possible to define more specific names, related to the model names and versions?
Works as described
Regarding the problem with TFS workspaces created with VS2015 and later. If you would like that fixed then please vote for the UserVoice idea here:
Thanks for the tips - I've reverted to the MS Explorer integration, which whilst clunky means I don't have to delete workspaces (sounds dangerous to me ...).
When you restart Matlab and get to "Usage Instructions" step 1,
- For the repository path, enter the source location on the TFS Server (ex: $/MyProject/Src/Main)
One of the known issues noted in the install instructions is:
"The TFS Java SDK uses an older version of the TFS APIs than Visual Studio. Workspaces you create with the Java SDK are usable in Visual Studio, but Workspaces created in Visual Studio have inconsistent behavior with the SDK."
So basically if you have a workspace that was created in Dev Studio for "$/MyProject/Src/Main" you need to go delete that workspace, then go to Matlab and create the workspace there.
I believe you have to delete this workspace even if you're trying to create a workspace to a subdirectory of an existing TFS workspace (for instance, you have a Dev-Studio - generated workspace for "$/MyProject/Src/Main" and you are trying to make a new workspace via this plugin to "$/MyProject/Src/Main/Mathworks")
After running installTFS and restarting MATLAB, go to the MATLAB Current Folder tool. Right-click in blank space and select "Source Control", "Manage Files...". The "Manage Files Using Source Control" dialog appears. From the drop-down list of available Source Control Integrations, select "Team Foundation Server".
Does this help?
I got this in high hopes after being pointed to it when finding the old MS integration will cease to be supported in the future.
However, no amount of fiddling will make it work in 2016a.
The documentation is poorly written and obscure. It's not obvious for example if you have to install the app and then run the install code or not.
Even then, under "usage instructions" it states "open matlab and create a TFS workspace" - How? Where? ... "In MATLAB's explorer menu" - what is this?
It seems to me the only redeeming feature is that it's free!
Extremely poor instructions that make references to things in the GUI by the wrong name. All it has allowed me to do so far is start multiple copies of Visual Studio from inside the MATLAB GUI. Appears to be completely useless and nonfunctional. The "Contact us" link at the bottom of this page generates and undeliverable e-mail message that bounces from email@example.com. Great job, guys!
Even the uninstall instructions failed. :(
Install went well, and, glad to see this by the way!
Only 4 stars due to being released with known issues....but hey that's better than not having it!
As the appReadMe indicates, I did have to delete my Dev_Studio-created workspace in order to let MATLAB create the workspace, and after that was done I could use the workspace in Dev_Studio but it was named something awesome like MathworksSandbox1475017577339 which means nothing to the human reader.
Fair warning: don't attempt to rename that workspace via DevStudio.
Great to see this integration!
Update to the R2016b source control adapter SDK.
Update app instructions