Can anybody find the TFS "Unshelve" option in Visual Studio 2012? - tfs

I can find the shelve button okay, and had shelved changes earlier today, but now I can't seem to find a way to unshelve them! This has left me in quite a predicament!
If this button is in fact missing in the Visual Studio 11 Beta, perhaps there is a console based TFS command I can execute to temporarily accomplish this?
Thanks all, I actually can't find an answer on Google for this either.

Go to Team Explorer, then "Pending Changes", then "Actions", then "Find Shelvesets", then right click on the shelve you want to unshelve, finally "Unshelve".

Also :
File > Source Control > Find > Find Shelvesets

I always used to right-click on the solution and choose "Unshelve". To add this functionality back:
Click on the menu "Tools > Customize". This opens the "Customize" dialog.
Select the "Commands" tab.
Choose the "Context menu" radio button in the "Choose a menu or toolbar to rearrange" section.
Choose "Project and Solution Context Menus | Solution | Source Control" from the drop down.
Click the "Add Command" button. This opens the "Add Command" dialog.
Choose "File" in the "Categories" list.
Choose "TfsUnshelvePendingChanges" in the "Commands" list.
Click the "OK" button to close the "Add Command" dialog.
Use the "Move Down" button to place the new menu item in the proper place.
Click the "Close" button to close the "Customize" dialog.

Generally if you can't find an option among the thousands available in Visual Studio there is a very useful "Quick Launch" (Ctrl-Q) function.
In this case if you type "shelve" it will show you where to find shelvesets.

Just like to add to Nock's answer that you can only see the unshelve option if you open a solution under source control.
You will not see the option if you open a blank solution, regardless if your Visual Studio workspace is connected to Team Foundation or not.
This is how it looks like if you tried unshelving a shelveset in a blank solution (with TFS connected to your Visual Studio workspace and source control all connected), where there isn't an option to unshelve from source control.
This is how it looks like with a solution under source control opened.
Moral of the answer is to open any solution/project you may have that is under the source control which has the shelveset you want to unshelve.

Related

Find shelvesets via Visual Studio as quickly as possible

I need to review many shelvesets using Visual Studio every day. I have added the TfsPendingChanges command to the my toolbar, but the rest of the procedure to access a shelveset (Actions/Find Shelvesets) still feels clumsy. In fact, shelveset review has nothing to do with my own pending changes. And VS11 just made it even one step longer than it already was.
Is there any way to add "Find Shelvesets" in some form directly to a menu or to a toolbar, in Visual Studio 2012?
If you go to right click and then "Customize" on any toolbar, it will bring up a dialog. Press the "Keyboard" button on it, choose File.TfsUnShelvePendingChanges and assign a Hot Key to it. I do believe that the Source Control Explorer window needs to be open and active for your hot key to work.
OR...This may not be exactly what you are looking for, but if you have the Source Control Explorer window open and active, then ALT-F ALT-R ALT-F ALT-F ALT-S will bring up the dialog. That is actually navigating File/Source Control/Find/Find Shelvesets.
The easiest way to work with Shelvesets is to use the new My Work feature. By suspending and resuming work Visual Studio will automatically do all the Shelveset magic for you with a simple drag/drop of the task that you want to have in progress.
The same applies to reviews, Suspend your current work, or create a new temporary workspace, open the Review Request, let it unshelve the changes automatically and when you're done go back to where you were by resuming your previous tasks.
It's really great once you get the hang of it. That it uses Shelvesets under the hood is nice to know, but this way you don't really need to know, it just works.
As for TWA Diff, there've been great improvements with TFS 2012 Update 2 which is almost ready to be released...
If this is only for reviews then maybe Team Web Access would be better for you?
Just navigate to http://:8080/tfs/web/, select team project, then click Source Tab and Find Shelvesets. You can then open each shelveset in new browser window and it will list all changes and allows you to quickly do compare etc.
Command that you are looking for is TfsUnshelvePendingChanges under File.
Right click on any toolbar, click on customize and a dialog will open. Go to 'Commands' tab on the top.
Choose appropriate button out of Menu Bar | Toolbar | Context Menu. Select the desired option under that. My favorite is to add it to Toolbar>Work Item Tracing (toolbar where New Item/Open Item appears).
After choosing from above step appropriately, click on 'New Command'. Then select to File>TfsUnShelvePendingChanges. This will add a shortcut to unshelve changes.
Thanks to #Alex for pointing out the correct command name. Writing here separately for people looking for answers in future.

How can I open a single changeset in TFS from within Visual Studio

Someone emailed me a TFS changeset ID and now I am trying to open this single changeset. Is there an easy was to do this from within Visual Studio (VS 2008 if it matters)?
In Visual Studio a keyboard shortcut can be used for pulling up a specific Changeset or Work Item.
Go to Changeset
In Visual Studio open the Source Control Explorer window and while it has context press Ctrl + G. Enter the number in the Go To Changeset dialog and press OK.
I know this works in VS 2010, 2012 and 2013, but recall this working as far back as at least Visual Studio 2008.
Go to Work Item
Pressing Ctrl + G when the Team Explorer Work Items window has context brings up the Go To Work Item dialog:
In Visual Studio 2012 and 2013 the TEAM menu contains an option Go to Work Item which also brings up this dialog.
Last Word
Visual Studio is a very contextual program and what happens when a specific keyboard command is used is oftentimes influenced by what window has context. To be clear pressing Ctrl + G when an editor window is open will present the Go To Line dialog.
As with many keyboard commands in Visual Studio your mileage will vary.
In the Source Control Explorer (View -> Other Windows -> Source Control Explorer):
Right click on the folder you want to grab
Click Get Specific Version
Change the dropdown from "Latest Version" to "Changeset"
Find your changeset on via the browse (...) button.
Change to search to changeset number
Just select the result and hit ok.
Alternatively, if you want to see what changes were in that changeset...
Go to the same Source Control Explorer
Click the History button (looks like a clock)
Scroll down the changeset list that appears, double click the one you want.
This will list the files changed in that changeset as well as notes the developer put.
or, from a VS command prompt type "tf changeset 1234" (make sure that your root folder is inside of your workspace or you will have to explicitly define the team project etc.)
You don't need to remember Ctrl + G shortcut, just do as below.
Open the source Control Explorer -> Right Click -> Find in Source Control -> Changeset
Then a dialog box will appear where u can specify your changeset number hit find. And it will appear in results section at the bottom, then you could go into all its details.
In the NugGet console, you can use the TFS Powershell Snapin from the TFS PowerTools.
Add-PsSnapin Microsoft.TeamFoundation.Powershell
Get-TfsChangeset <ChangesetNumber>
Another option is to open Tools > External Tools and add a new external tool that calls TF.exe changeset and prompts for arguments where you can give the changeset number.
In VS2012 you have the option to search in changesets.
if you want to search changeset...
Go to Source Control Explorer Click the Find Changeset(looks like some papers tied together) button. it is near to history button (looks like a clock)
you can search by changes checkedin by a user,containing file,and date range
try to add as much filter as possible, otherwise it will take sometime to load.

TFS: Why there are Pending changes from multiple projects

i have a Team Project and under this Team Project there are multiple visual studions solutions. each solution contain multiple projects.
while working on a solution , in pending changes it shows me files from other solutions as well which are checked out to me.... this is wrong.. it have to show only changes related to current solution. why it is showing me changes from all solutions.??
There is a button to the right of the list of buttons in the pending changes window that looks like a solution item - when this is highlighted it should only shows items for the current solution. Sometimes you have to refresh to show the correct items.
Just an update for Visual Studio 2012: The button mentioned above appears to have been moved to a filter drop down beneath Included Changes / Excluded Changes. Hit the dropdown and change "Show All" to "Show Solution Changes."
Open the Team Foundation Server window in Visual studio, then click pending changes, then at included changes list you will find blue link "Show All" and small down arrow above the files list, click this arrow and select "Show Solution Changes"
"Show Solution Changes" will greyed out when your solution is in OFFLINE mode, make sure you turn it ONLINE by following below steps.

How to undo changes in tfs coming from unmanaged workspace?

I have a workspace that is lost forever. I have some files checked out from this workspace. I want to unlock them but I can't. I tried to do:
TF UNDO $/MyProject/MyFolder/MyFile.cs /WORKSPACE:LOST;user /s:http://mysite:8080
But I got this message:
The workspace LOST;user is not on this
computer. Run get (get all if edits
were undone) on the computer hosting
that workspace to update it with the
change s that have been made on the
server.
Does exist any way to undo a file (not every file) checked out by unavailable workspace?
If the workspace is lost, then I would just delete it. Deleting it undoes any changes that were made in it.
tf workspace /delete WorkspaceName;WorkspaceOwner
As long as you have the appropiate permissions I would think that the method from this answer by #BubbleSort should work: https://stackoverflow.com/a/17870318/1982894
He used TFS 2012, I have tested it in TFS 2010 and it works there too.
Answer copied for easy reference:
(Note: I have the TFS Power Tools installed so if you don't see the
described options you may need to install them.
http://visualstudiogallery.msdn.microsoft.com/b1ef7eb2-e084-4cb8-9bc7-06c3bad9148f
)
If you are accessing the Source Control Explorer as a team project
administrator (or at least someone with the "Undo other users'
changes" access right) you can do the following in Visual Studio 2012
to clear a lock and checkout.
From the Source Control Explorer find the folder containing the locked file(s).
Right-click and select Find then Find by Status...
The "Find in Source Control" window appears
Click the Find button
A "Find in Source Control" tab should appear showing the file(s) that are checked out
Right click the file you want to unlock
Select Undo... from the context menu
A confirmation dialog appears. Click the Yes button.
The file should disappear from the "Find in Source Control" window.
The file is now unlocked.

How do I change my workspace in Team Foundation Server 2005 and 2008?

I have multiple projects in a couple of different workspaces. However, it seems like I can never figure out how to change my current workspace. The result is that files that I have checked out on my machine are shown to be checked out by somebody else and are not accessible.
I'm going to assume you mean "workspace", not "workstation", as your question doesn't quite make sense to me otherwise.
In Visual Studio, go to the Source Control Explorer (View->Other Windows->Source Control Explorer). At the top of the source control explorer window you should have a toolbar with a few buttons. Somewhere on that toolbar (for me it's at the right) there should be a Workspace dropdown. Just select the workspace you want to use from that dropdown.
Are you wanting to change the location of the files on the workstation? If so, here's how I do it:
Open Visual Studio
Open the Source Control Explorer window.
From the Workspace dropdown select "Workspaces..."
The Manage Workspaces dialog should show up.
Select the workspace you want to modify, and click Edit...
You should be able to adjust the folders from here.
First, you should active you workspace window.
choose the window menu
click Source Control Explore.
click Active button.
The Workspace window appears
click the WorkSpace name in Workspace window.
from the popup list choose the Workspace name you want.
In Visual Studio 2013
If you just regret which local folder you choose for a project under version control. Do like follows:
In the Source Control Explorer in the Folders pane
Select the project which local folder destination/mapping you are not pleased with.
Right click. --> Advanced --> Remove mapping.
A window opens: Press the browse button and choose another local folder for the project and then click "Change".
Click on: File -> Source Control -> Advanced -> Workspace and then you can edit or remove the existing mapped locations
I don't entirely understand your question.
Are you saying that files you check out on one machine seems to be unaccessible on another of your machines? I'd say that would be entirely by design, as now you have a file that has local modifications done on one machine, which may or may not be available on your other machines.
When you say checked out by somebody else, what does that mean exactly? How are you verifying this, what are you looking at?
Or do you mean something else? In that case, please elaborate.

Resources