0

I am using TFS every where on CentOS and I want to run a service to listen on directory modifying this directory represent TFS local folder and for every (add or modify) it mirroring to TFS

I tried to use inotifywait and listen to event create,modify but I confusion when adding directory, when adding a directory 'ssss'

output:

/tfs_loacl_folder/business_layer/ CREATE,ISDIR ssss
/tfs_loacl_folder/business_layer/ssss/ CREATE 1
/tfs_loacl_folder/business_layer/ssss/ MODIFY 1
/tfs_loacl_folder/business_layer/ssss/ CREATE www
/tfs_loacl_folder/business_layer/ssss/ MODIFY www
/tfs_loacl_folder/business_layer/ssss/ CREATE 112
/tfs_loacl_folder/business_layer/ssss/ MODIFY 112
/tfs_loacl_folder/business_layer/ssss/ CREATE asd
Steve
  • 503
  • 3
  • 9
  • 19
  • 1
    I'm not sure that I understand your question at all. I'm also not sure what it is that you're trying to accomplish. It almost sounds like you're trying to automatically pend changes to TFS that your inotify listener detects? If so, what's the rationale? Are you using local or server workspaces? – Edward Thomson Feb 05 '14 at 22:05
  • yes I want to automatically checkin the changes and about workspaces I created it using `tf workspace -new Beta1 -collection:http://myserver:8080/tfs/DefaultCollection` – Steve Feb 07 '14 at 14:23
  • 1
    I guess my question is, if you switch to a local workspace `tf workspace -new ... -location:local` and let `tf` do the scanning for you, by running `tf status`, how far away are you from your design goals? – Edward Thomson Feb 07 '14 at 16:20
  • What do you mean about `-location:local` – Steve Feb 07 '14 at 16:45
  • not exist in manual page http://msdn.microsoft.com/en-us/library/y901w7se(v=vs.100).aspx – Steve Feb 07 '14 at 16:45
  • 1
    TFS local workspaces: http://visualstudiomagazine.com/articles/2012/11/02/local-workspaces-in-tfs-2012.aspx were introduced in TFS 2012 (the MSDN document is for an older version, before they were introduced.) – Edward Thomson Feb 07 '14 at 17:25
  • That is amazing !!!! is there any way to checkin the changes `File name Change Local path ---------------------------------------------- ------ ------------------------- $/TestProject/BuildProcessTemplates/Models/Acc inter face.php edit /home/motaz/motaz_tfs_local/TestProject/BuildProcessTemplates/Models/Acc/inter face.php 1 change(s)` – Steve Feb 07 '14 at 17:35
  • it is working just `tf checkin -recursive root_folder` – Steve Feb 07 '14 at 17:41
  • 1
    I summarized this in an answer, I hope it helps! – Edward Thomson Feb 07 '14 at 17:48

1 Answers1

1

It sounds like you're trying to avoid having to explicitly checkout files when you change them. Team Foundation Version Control has this functionality already.

Team Foundation Version Control operates in two modes:

  1. Checkout / edit / checkin, where you need to explicitly checkout a file for edit before changing the contents. The file is even marked read-only (0444) until you run tf checkout <filename>.

  2. Edit / merge / commit, where you can edit a file at any time, and running tf status will examine your local filesystem for changes and mark each change as an edit.

The latter is called "local workspaces", and can be enabled by passing the -location:local flag to tf when creating the workspace. For example:

tf workspace -new Workspace01 -location:local -collection:https://tfs.visualstudio.com/DefaultCollection

After that, you can edit files without needing to pend the changes explicitly.

Edward Thomson
  • 74,857
  • 14
  • 158
  • 187