Versioning of a network shared folder with a TFS repository - tfs

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.

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.

Modified TFS Destination path

I am working with Team Foundation Server and I'm trying to fetch content from the server into my local folders.
so basically I'm using: tf get "companyName" /recursive /force /noprompt in the command prompt and everything is working smoothly and it gets stored under
C:\Users\myFolders\Escrow\XYZCompany\TFS
I'm using a program class and the path gets called from an app.config (XML) file into my visual studio class.
Is there a way to change the final path? I need to segregate the customers into subfolders so C:\Users\myFolders\Escrow\XYZCompany\TFS\CompanyOne or something similar, can this be done or altered? if I change the path I always get a message that everything is up to date and if I don't include the TFS folder, it gets created automatically whenever I run my command.
Thanks in advance for the help
This behavior is controlled by the workspaces you have mapped. A workspace represents the mapping between a location in source control and a folder on your PC.
It's not entirely clear whether your intent is to map the same source control location to multiple folders on your PC. You can't do that. In that case, it sounds like you need to adopt a branching strategy to allow for isolation of work between different customers.
No, you can't map the same repository to the subfolders of one folder. You could either:
Create multiple workspaces. Each customer has a workspace and map to different path.
Use branches. In general, you should map your entire team project to a single local folder under for example c:\Users\YourName\Source\Workspaces\, If you create branches for each customer, then you could map branches to c:\Users\YourName\Source\Workspaces\Main or c:\Users\YourName\Source\Workspaces\branch

Monitoring files on a shared drive and auto-check in to 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.

Mirror a TFS folder to a shared folder

I have a folder in TFS that I want to publish to a shared folder on my local network (read only access). I would like that anytime a change (or new file) is checked in, the files will be automatically updated in the shared folder.
What is the easiest way to do this?
I'd set up an automated build, with the server workspace mapped to the folder you want to monitor. The only thing the build would need to do is call out to xcopy. You'll probably need to create a custom workflow to do this but that should be fairly easy (famous last words)

Resources