Monitoring files on a shared drive and auto-check in to TFS - tfs

We need to monitor files in a share drive and check in file changes (new files or additions/deletions to existing files) to Team Foundation Server. Is it possible to map a TFS path to the shared drive and accomplish this ?

First,TFS is able to work with network/shared drivers. You could also create a workspace on the drive and mapped to TFS. You also be able to get latest and do some modification, then check in files.
So it's the same as monitoring files on a local drive and auto-check in to TFS. The most concern is the "auto-check in" operation, how would this be achieved. For example when you edit a file on the workspace in share drive, when would you check in files, after edit a character or a line, it's hard to judge when you finished the modification.
Actually if you are working on local workspace, your demand is by designed. When you had been modified externally VS or directly on files, TFS automatically checked them out without you having to do anything. The changes are added as a "pending change" status.
Lately you could check in the projects in the normal way and save the external modifications.
Certainly, you could also use tf command or TFS API to control the check-in operation.

Related

Does PlasticsCM apply a read-only tag on client files?

I'm currently using Perforce for source control, the files on my workstation in the source controlled workspace are tagged with read-only, Perforce uses this tag to help manage which file was checked-out. and Unreal Engine editor, takes advantage of that tag, and lets me know when certain file need to be checked out, I value this very much because sometimes you can be working on one asset, and affect many files without realizing it.
We also use Google drive with the Filestream client. This mounts a g:/ drive on my workstation that I put all of my work project folders, not just code, but everything day to day work stuff.
This setup works great for everything, except... Google drive does not support "read-only" tags and makes using perforce more inconvenient, having to reconcile the project, or manually check files out( I am used to it happening automatically).
Now for my question about PlasticSCM... I might consider making the switch, but I've never used PlasticSCM, would someone be able to tell me if it uses the read-only file tag so that I could have my working source folder on the google drive mount g: ?
Many thanks and appreciation.
If you decide to use Plastic SCM (or any other SCM), I don't fully understand why you plan to use it at the same time with Google Drive.
You can use a Plastic workspace from where you can checkin your changes to a cloud repository. Then other members of your team can create a local workspace pointing to the same repo and this way, they can be up to date with your last changes in the project.
Anyway, answering to your specific question:
Plastic SCM by default doesn't set local files are read-only in your workspace.
You can still manually enable this workflow with the following preference:

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 identify files updated outside of TFS

We have a nopCommerce website of a client's that one of their IT guys was modifying views directly on the web server. They now want to do more extensive changes so we want to put the baseline NopCom code in TFS.
Then, ideally, we'd like to be able to identify all the views that were changed directly on the web server and have those changed views be recognize as changes in TFS source control to check-in.
Is there anyway to do this in Visual Studio/TFS in batch? i.e. it would be great to do a check-in locally so all the base code of NopCom was checked in to TFS, then download the website files and overwrite them in the local workspace and have TFS recursively do a diff and determine if any new files were added or existing ones changed and mark those for check-in.... I know...I'm probably dreaming, but any other smart workarounds appreciated as well, assuming this won't work.
TFS does what you want. To set up Team Foundation Version Control (TFVC) on your dev machine, you just need to create a workspace and then add your code. Check link: https://www.visualstudio.com/en-us/docs/tfvc/set-up-team-foundation-version-control-your-dev-machine
When your codebase is under version control, you can develop your app, create and open files in Solution Explorer and write your code, while version control does other work for you. When you check files in and out, it keeps track of your changes and creates a history of your project.
You can use the Diff window to clearly see the difference by comparing folders or files. You can compare server folders and local folders to each other, and view the differences between the contents of each folder. You can compare two server files, two local files, or a server file against a local file and view the differences between the files.
You can get more details about TFVC from website below: https://www.visualstudio.com/en-us/docs/tfvc/overview

TFS: Is is possible to transfer all checked out files from one user to another?

I am developer and work with TFS for a while but never have the responsibility of TFS admin. We have a user that was let go and now his userId has been revoked so we cannot use his id anymore.
He has so many files checked out in TFS and a lot of stuff done, we don't want to lose these checked out files if possible. Is there a way to transfer all his checked out files to me or someone else? Or what is the best way to recover these files?
NOTE: we still have his laptop with all the files, we just cant login to it with his username.
Thank you for your help in advanced
Download TFS Sidekicks (get the right version for your TFS)
They have a Visual Studio Add-in if that is what you are using as your IDE
Backup his files that you want to keep
Use the Workspace Sidekick of TFS Sidekicks to delete his workspace(s)
(this won't delete his files).
This will release any exclusive locks that he has effectively undoing all his checkouts.
You can also use the Status Sidekick to see what files he has checked out.
Get latest source and copy his files over yours
If you are using TFS2012 or later, you can use a 'local' workspace and simply copy his files over. Team Explorer will create your pending changes for you. If you are using a 'server' workspace or a version of TFS prior to 2012, you will need to full check-out everything and THEN copy his files over.
It's not a great solution but it should work for you
The changes to the developer's files that are checked out will be stored locally on the developers machine (specifically in their workspace directories) - transferring "check out status" would seemingly not accomplish what you hope.
You would need to obtain access to the developer's workspace (perhaps via an admin account on the dev's machine), copy out all the contents to a new workspace you own to consolidate differences between "source" and "new workspace".
Once you've copied the developer's workspace to a new workspace you own, you can simply compare "source" to "workspace" to find all the changed files and which are needed vs. not needed. Note, this should be done sooner rather than later as the longer you wait the more differences there will be between the two, making it harder to identify what is actually needed.

Versioning of a network shared folder with a TFS repository

I have a collection of scripts among with some executables on a network share folder.
From time to time I change these scripts, add new ones along with some new executables.
In order to be able to roll-back some inadvertent changes I would like to keep track of my changes.
The rest of my code sits in a Team Foundation Server repository and it would be best if I could just sync the network share with a folder in that repository.
I tried to use tf.exe for this purpose, but as far as I understood I first need to create a workspace, map it to this folder etc -- that seems to be too complicated.
Is there any simple solution here?
Check-in the scripts to TFS, setup a simple build which copies the script files and replaces them on network share.
Map your shared drive and create a TFS workspace to the mapped drive. Add all the files in the shared drive to TFS.
Every time you are doing a change, checked out your file using
tf checkout "fileName"
do the changes and then check-in the file using
tf checkin "filename"
Make sure to execute tf.exe on the mapped folder.

Resources