Login    Register    Wednesday, June 19, 2013      Search  
Blogs Print  
Lakeland .NET Blog Entries
Feb 26

Written by: Roy Lawson
2/26/2009 10:17 PM 

I recently had a problem in TFS that prevented me from adding a new workspace. The problem was that an old workspace existed in the TFS database, however it wasn't in my list of workspaces and my limited knowledge of how to query TFS through the command line made a simple problem difficult. If you haven't had the problem of a "stale" workspace, consider yourself lucky.

The bright side to this problem is that I learned a few key TFS commands. To start from the beginning, when I try to change the path of my workspace to C:\Team instead of C:\TFS I get this error:

The first logical step was to delete that workspace.  However that workspace was not showing up in the list of workspaces assigned to my account from within TFS explorer.  When I query TFS (see screenshot below) I get just one workspace back and it isn't the offending workspace:

Just to make sure this isn't in fact the offending workspace, I go ahead and delete it:

When I attempt to delete the Roy_Laptop workspace (tf workspace /delete /server:http://ol-cat-tfs.olcc.lan:8080 Roy_Laptop) I am told that workspace does not exist:

So at this point I spent a couple of hours reading other blogs and trying all types of remedies. The solution was actually very close. Had I known a simple TFS command I would have quickly discovered that I had an account out there called "rlawson:13". I am not sure how that account was created, but it was in fact the problem. To get a list of all workspaces that includes all owners, run this command: "tf workspaces /owner:*"

C:\Program Files\Microsoft Visual Studio 9.0\VC>tf workspaces /owner:*

Server: ol-cat-tfs.olcc.lan
Workspace                           Owner      Computer        Comment
----------------------------------- ---------- --------------- ----------------

ORANGELAKEVPC                       khempel    ORANGELAKEVPC
Roy_Laptop                          rlawson:13 CATTAML38M2JC1
TeamLocal                           dbyers     CATTAML8HGDVC1

Once I located the account, it was simple to delete and my problem was solved. In order to prevent others from following my bone-headed path, here is a list of TFS commands that can be run from the Visual Studio 2008 Command Prompt. You can thank Noah Coad for posting this file and his colleague John-Lyon Smith for putting the list together. His blog can be found here.

COMMANDS

Add        tf add itemspec [lock:none|checkin|checkout] [/type:filetype] 

              [/noprompt] [/recursive]

Branch     tf branch olditem newitem [/version:versionspec] [/noget] [/lock]

              [/noprompt] [/recursive]

Branches   tf branches [/s:servername] itemspec

Changeset  tf changeset [/comment:comment|@commentfile] /s:servername 

              [/notes:("NoteFieldName"="NoteFieldValue"|@notefile)] [/noprompt]

              ([/latest]|changesetnumber)

Checkin    tf checkin [/author:authorname] [/comment:("comment"|@commentfile)]

              [/noprompt] 

              [/notes:("Note Name"="note text"|@notefile)] 

              [/override:reason|@reason] [/recursive] filespec ...]

Checkout   tf checkout|edit [/lock:(none|checkin|checkout)] [/recursive]

              [/type:encoding] itemspec

Configure  tf configure pathtoproject /server:servername

Delete     tf delete [/lock:(none|checkin|checkout)] [/recursive] itemspec

Difference tf difference itemspec [/version:versionspec] [/type:filetype] 

              [/format:(visual|unix|ss)] [/ignorespace] 

              [/ignoreeol] [/ignorecase] [/recursive] [/options:"options"]

           tf difference itemspec itemspec2 [/type:filetype] 

              [/format:(visual|unix|ss)] [/ignorespace] [/ignoreeol] 

              [/ignorecase] [/recursive] [/options:"options"]

           tf difference [/shelveset:[shelvesetowner;]shelvesetname] 

              shelveset_itemspec [/server:serverURL] 

              [/type:filetype] [/format:(visual|unix|ss)] [/ignorespace] 

              [/ignoreeol] [/ignorecase] [/recursive] [/options:"options"]

           tf difference /configure

Dir        tf dir [/s:servername] itemspec [/version:versionspec] [/recursive]

              [/folders] [/deleted] 

Get        tf get itemspec [/version:versionspec] [/all] [/overwrite] [/force]

              [/preview] [/recursive] [/noprompt]

Help       tf help commandname

History    tf history [/s:servername] itemspec [/version:versionspec]

              [/stopafter:number] [/recursive] 

              [/user:username] [/format:(brief|detailed)] [/slotmode]

Label      tf label [/s:servername]  labelname@scope [/owner:ownername] 

              itemspec [/version:versionspec] 

              [/comment:("comment"|@commentfile)] [/child:(replace|merge)]

              [/recursive]

           tf label [/s:servername] [/delete] labelname@scope 

              [/owner:ownername] itemspec [/version:versionspec] 

              [/recursive]

Labels     tf labels [/owner:ownername] [/format:(brief|detailed)] 

              [/s:servername] [labelname]

Lock       tf lock itemspec /lock:(none|checkout|checkin) 

              [/workspace:workspacename] [/server:serverURL] [/recursive] 

              [/noprompt]

Merge      tf merge  [/recursive] [/force] [/candidate] [/discard] 

              [/version:versionspec] 

              [/lock:none|checkin|checkout] [/preview] [/baseless] [/nosummary]

              source destination

Merges     tf merges [/s:servername] [source] destination [/recursive]

Permission tf permission [/allow:(* |perm1[,perm2,…]] 

              [/deny:(*|perm1[,perm2,...])] 

              [/remove:(* |perm1[,perm2,...])]

              [/inherit:yes|no] [/user:username1[,username2,…]] [/recursive] 

              [/group:groupname1[,groupname2,...]] 

              [/server:servername] itemspec 

Properties tf properties [/recursive] itemspec

Rename     tf rename [/lock:(none|checkout|checkin)] olditem newitem

Resolve    tf resolve itemspec [auto:(AcceptMerge|AcceptTheirs|AcceptYours)] 

              [/preview] 

              [(/overridetype:overridetype | /converttotype:converttype)] 

              [/recursive]

Shelve     tf shelve [/move] [/replace] [/comment:(@commentfile|"comment")] 

              [/recursive] shelvesetname[;owner] filespec

           tf shelve /delete [/server:serverURL] shelvesetname[;owner]

Shelvesets tf shelvesets [/owner:ownername] [/format:(brief|detailed)] 

              [/server:serverURL] shelvesetname

Status     tf status itemspec [/s:servername] 

              ([/workspace:workspacename[;workspaceowner]] | 

              [/shelveset:shelvesetname[;shelvesetowner]]) 

              [/format:(brief|detailed)] [/recursive] [/user:(*|username)] 

Undelete   tf undelete [/noget] [/lock:(none|checkin|checkout)] 

              [/newname:name] [/recursive] itemspec[;deletionID]

Undo       tf undo [/workspace:workspacename   [;workspaceowner]] 

              [/s:servername] [/recursive] itemspec

Unlabel    tf unlabel [/s:servername] [/recursive] labelname itemspec

Unshelve   tf unshelve [/move] [shelvesetname[;username]] itemspec

View       tf view [/s:servername] [/console] [/noprompt] itemspec 

              [/version:versionspec]

WorkFold   tf workfold localfolder

           tf workfold [/workspace: workspacename]

           tf workfold [/s:servername] [/workspace: workspacename] 

              repositoryfolder

           tf workfold [/map] [/s:servername] [/workspace: workspacename] 

              repositoryfolder|localfolder

           tf workfold /unmap [/s:servername] [/workspace: workspacename] 

              [/recursive] (repositoryfolder|localfolder)

           tf workfold /cloak (repositoryfolder|localfolder) 

              [/workspace: workspacename] [/s:servername]

           tf workfold /decloak (repositoryfolder|localfolder) 

              [/workspace:workspacename] [/s:servername]

Workspace  tf workspace /new [/noprompt] 

              [/template:workspacename[;workspaceowner]] 

              [/computer:computername] [/comment:("comment"|@commentfile)] 

              [/s:servername]

           tf workspace /delete [/s:servername] 

              workspacename[;workspaceowner]

           tf workspace [/s:servername] [/comment:comment] 

              [/newname:workspacename] workspacename[;workspaceowner]

Workspaces tf workspaces [/owner:ownername] [/computer:computername] 

              [/s:servername] [/format:(brief|detailed)] 

              [/updateUserName:oldusername] 

              [/updateComputerName:oldcomputername] workspacename

 

ITEMSPECS

  Can contain wildcards *, ? and #

  Can contain relative path parts . and .. 

  Can reference file system or UNC paths mapped to a workspace or server 

  paths (which start with $/). You can usually specify more than one 

  file separated by spaces for an itemspec (useful for edit, add, delete 

  commands)

 

VERSIONSPECS

  Date/Time         Dmm/dd/yyyy

  Changeset number  Cnnnnnn

  Label             Llabelname

  Latest version    T

  Workspace         Wworkspacename;workspaceowner

 

ALIASES

  /changeset  /G     /noprompt   /I

  /comment    /C     /owner      /O

  /computer   /M     /recursive  /R

  /delete     /D     /server     /S

  /force      /P     /slotmode   /X

  /format     /F     /template   /T

  /help       /?,/H  /user       /U

  /lock       /K     /version    /V

  /login      /Y     /workplace  /W

  /newname    /N     

 

Tags:
Search_Blog Print  
Blog_Archive Print  
    Home Forum Blog Events Community News
Copyright 2009 by Lakeland .NET User Group    Privacy Statement   
Downloaded from DNNSkins.com
We are proud to provide the most extensive supply of sports jerseys on the Web. You can select from over 20,000 of the most popular sports jerseys while receiving the best service and the best prices. We guarantee your satisfaction when you buywholesale jerseys, Cheap Nike Shoesdiscount NBA jerseys, NFL jerseys, wholesale jerseys,wholesale NHL jerseys, official MLB jerseys, ED Hardy Clothing. If you can't find a sports jersey here, please let us know and we'll do our best to carry it.