Comment on checkin appears empty or jibberish on TFS Side - tfs

VSCODE connected to TFVC. Checkin works but text entered in Message/Comment field in VSCODE, becomes empty or jibberish in TFS changeset comment field. It occurs no matter the language of the text (English, other, combined).
Comment as appears on regular Visual Studio in View History :

Update
There maybe a check-in comment issue with VSCode 1.16 such as comment not get passed.
TFVC Comment Not being passed to tf checkin command
Suggest you give a try with downgrading VS Code Version or use 1.170-insider
To narrow down the issue:
Suggest you try to use visual studio to check in the same comment of a new changeset.
Try to use tf changeset command to list the comment info, it
will shows either it's a server side issue or the gibberish comment also stored
in TFS database.
Change your OS system language to English(if not) and try again

Related

TFS: "Get This Version" vs "Rollback Entire Changeset"

I find myself needing to remote debug some deployed code, I have a clear changeset defined in tfs that is the code that was deployed.
My question is: What is the standard procedure in TFS to ensure my local code matches what has been deployed to live.
"Get This Version": I seem to recall that operation only checks out the changeset in question, leaving all other files in place, some of which have have been changed by another later changeset
"Rollback Entire Changeset": This one appears most promising, but I'm confused if it means 'Roll back TO this changeset', or if it means 'Roll back this changeset' effectively leaving the code in a state BEFORE that changeset was checked it.
Any clarification would be greatly appreciated.
According to your description, you shouldn't use rollback entire changeset feature. This will influence your source control in TFS. If you roll back a file to an earlier version, tfs will eliminating the effect of all changesets that occurred after that version. More details please take a look at this tutorial: Roll back changesets
Actually you just want to get an older version in history include all files for a branch or root project folder.
In TFS, you could Get Specific Version instead of get latest version of the branch. Details please refer this question: TFS Get Specific Version into separate folder
How to do this in VS: right click the branch-Advance-Get Specific Version. Have a look at my answer in this similar question: TFS source code explorer: browse specific revision

Get or download Shelf Code in Team Foundation Server (TFS)

I am fairly new to TFS, like Mel from this post:
https://softwareengineering.stackexchange.com/q/142977/27650
I had a project on another PC, but I have been issued another PC.
Yes, I could go to management, and bug them with all of the various steps involved with finding and then getting my shelf project that I was working on last week, but I would rather find the information on my own.
I found MSDN's article on Shelve and Unshelve Pending Changes, but it did not cover how to get my shelf item. Perhaps there is a special term that I am unfamiliar with.
Likewise, I read over the article What's New in Visual Studio TFS 2012, since we are using VS2012. It appears to go over the changes that have occurred since the newest release.
How do I find my shelf items, so that I can continue working on them?
your question is answered under "Unshelving" on the page you referred to (Shelve and Unshelve Pending Changes). You click on unshelve and first step you do is finding your sehlveset. However please remember it works only if you shelved your changes before you lost your PC.
I got this resolved, but I did not like the way I found to do it.
In Team Explorer, I opened my last successful shelf item, did a Right-Click and selected View Shelfset Details:
From there, I went to each file listed in the Changes to Unshelf list.
I selected Open for that file, and then physically copied the text from that file to the corresponding file on my PC.
Again, I did this for each file that had changed in my Shelfset Details.
For whatever reason, Team Foundation Server does not pull that data back into my project whenever I select the "Unshelve Changes" option.

How to undo pending changes in TFS of users that no longer exist

We have a few developers who don't work here anymore, but didn't check all theirs changes into Team Server before they left.
Now their usernames don't exists anymore, and I can't access their pending changes to undo them....
I found a way, not needing command line.
With Power Tools installed (both in 2008 and in 2010 version), Visual Studio shows a node for Team Members in each project. If you right-click on one of the members, you can choose to view all their pending changes. Till now nothing new. BUT, I suddenly saw, in the right hand upper corner of the pending change list, a link that says "Modify Query".
I opened the window, and in it was an input field that let me change the username. I changed it to the username I wanted, and I got his list of pending changes!
Here's a link to the TFS 2008 Power Tools:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=FBD14EEA-781F-45A1-8C46-9F6BA2F68BF0
and the TFS 2010 Power Tools:
http://visualstudiogallery.msdn.microsoft.com/en-us/c255a1e4-04ba-4f68-8f4e-cd473d6b971f
Edit by woppers:
I don't have enough Rep to comment so I have to make an edit. I had the same issue as the OP but I am working in TFS 2013 so the procedure is slightly different. Here's what I did.
Go to:
Source Control Explorer
right click on the collection you are working in
Find
Find Changesets...
Enter your LanID in the “By user:” field
Click search
Click find
That will show you all of your pending changes.
Highlight one of them and click “Details...” to view the info in them.
As an administrator of TFS you should have some option of global check in.
something like that in the command line: tf lock /lock:none /workspace:workspace;username $/code/foo.cs /s:http://server:8080
or better yet:
tf undo /workspace:workspace;username $/code/foo.cs /s:http://server:8080
To expand a bit on the awesome answer provided by xr280xr... I needed to undo pending changes of a former employee, and this worked for me on a TFS 2013 server, using VS2015 on my own desktop:
Right click the folder in Source Control Explorer > Find > Find
by Status and enter * as a wild card. You can reduce the results to
a specific user if you know the user name.
When the results appear, you can right-click and select Undo. The
Output window should confirm success.
Note that if the former employees' workspace is on another PC, you'll continue to see the pending changes they have, but they will no longer prevent checkout, build, etc.
I'm guessing that deleting the former employees workspace will get rid of the pending (now-undone) changes, but I haven't tried it yet.

How to revert (Roll Back) a checkin in TFS 2010

Can anyone tell me how to revert (roll back) a checkin in TFS 2010?
You have two options for rolling back (reverting) a changeset in Team Foundation Server 2010 Version Control. First option is using the User Interface (if you have the latest version of the TFS 2010 Power Tools installed).
The other option is using the TFS 2010 version control command-line application:
tf.exe rollback
I have information about both approaches on my blog post.
For Team Foundation Server 2012, 2013, or Visual Studio Online, rollback is now built-in directly to Source Control Explorer and when you are opening a changeset's details in the Team Explorer Window. You do not need to install any release of the Power Tools for this functionality when using Visual Studio 2012 or later. There is a great MSDN article discussing details about rolling back a changeset now available here: http://msdn.microsoft.com/en-us/library/ms194956(v=vs.110).aspx
For 2010, use the rollback command from the command line. There is not integrated support in the IDE for this, as of yet.
Rollback command
Basically, the way that it works is that it creates an "anti-delta" to negate the impacted changeset. You can accomplish the same thing manually by doing a Get Specific Version, adding a space to the file so it looks like it changed, and checking it in. I still go the latter route to back out a change if I need to for a single file, as I find it quicker to do.
Without using power tools or command line:
ensure Tools->Options->Source Control->Visual Studio Team Foundation Server UNCHECK Get latest version of item on check out
View the history of project folder in Source Control Explorer and right click on the changeset to roll back to and choose Get This Version
Check out for edit on the project folder in the Source Control Explorer (this should keep your local version you just got from the history)
Check in pending changes on the project folder in the Source Control Explorer
if visual studio asks you to resolve conflicts, choose keep local and attempt check in of pending changes on the project folder in Source Control Explorer again
Rolling back changes for another user
If you are attempting to rollback changes for another user, make sure you get latest on the files you are attempting to rollback; otherwise you will see the error:
"No changes to roll back."
You can rollback a changeset (in TFS2010) through command line doing:
Open CMD or Visual Studio Command Prompt
Change directory to your workspace folder. Example: cd C:\myWorkspace
Run following tf command (where 123 is changeset number)
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" rollback /changeset:123 /recursive
Go to Pending Changes window to check files marked with edit,rollback and do a Check In.
Note: you must use tf.exe full path even in Visual Studio Command Prompt to avoid "Unable to determine the workspace" error. More info here
Rollback reference (TFS 2010)
https://msdn.microsoft.com/en-us/library/dd380776(v=vs.100).aspx
right click file in Visual Studio and Source Control/View History
then select last changeset, right click and click Rollback
After rollback done, you should check in again.
There is no undo option in TFS (up untill 2008, I haven't used 2010 yet).
There are some command line power tools you can use to rollback changes that may help:
http://msdn.microsoft.com/en-us/library/ms194956%28VS.80%29.aspx
HTH

How to view code difference by changeset in TFS through a web-based interface?

Is there a way to look at code differential between previous and current versions of a changeset in TFS 2005/08 through a web-based interface?
I am aware of Changeset.aspx with a artifactMoniker parameter that retrieves the changeset and related files. But I would also like to view the code delta in a web based manner.
This can be achieved in TFS 2008 via the Visual Studio Team System Web Access.
First you need to open an individual Changeset details. This can be done for example by looking at a build (the Builds tab), and selecting one of the changesets associated with the build.
For some reason the version of Web Access I currently have at hand had a bug in that the link into a Changeset webpage is missing the changeset number. A quick manual fix of the URL helped.
This is the URL that is linked to
http://tfsappserver:8090/UI/Pages/Scc/ViewChangeset.aspx?changeseturi=vstfs:///VersionControl/Changeset/8695
Notice I needed to add the changeset parameter manually.
http://tfsappserver:8090/UI/Pages/Scc/ViewChangeset.aspx?changeseturi=vstfs:///VersionControl/Changeset/8695&changeset=8695
The page lists all the code files that has changed and for each file you can compare it with another version. The comparison option is available from dropdown menu on the file.
Here is what it looks like:

Resources