With VS 2019, I checked in some changes that I made to a dtsx package. The changeset history looks like below; my changeset is 4021:
Changeset Change User Date Path
4021 Edit Joe Smith 2/8/23 $/dev/ReadFile.dtsx
3816 Edit Harry Joe 9/2/22 $/dev/ReadFile.dtsx
I want to rollback to changeset 3816, but I also want to remove changeset 4021 from the History.
Is this possible? I understand that the rollback will revert ReadFile.dtsx to the changeset that I selected, but it seems that I have to check-in again, which will add another changeset.
No, you cannot delete a changeset from history*. The rollback command will reverse the change as a new checkin and History will be preserved.
'*' you might be able to if you go poking around in the TFS database, but this is dangerous and should not be attempted.
Related
Recently, one of the junior developers made a check-in to a large MVC SOA C# application, to both the client and service side, which makes the project unbuildable. Their check-in added spurious dependencies as well as removed required files, with something like 900 files in the project affected.
In order to keep the project moving forward, I was instructed by management to simply obtain the project from the changeset prior to this check-in in TFS and and then apply all changesets after the bad check-in going forward, since we though a release would be urgently needed.
As the weeks have passed, however, this approach is getting untenable. Is there a way to do one of these two things in TFS?
Either
remove a changeset from TFS without removing the changesets that come after it?
or
Automatically get all of the changesets in TFS for a solution except for one specific changeset.
remove a changeset from TFS without removing the changesets that come after it?
According to the document Roll back changesets:
A changeset is a permanent part of the history of your
version-controlled items and cannot be undone or removed. However,
you can roll back the effects of one or more changesets.
So, we could not remove one specify changeset. Just like James said, we could roll back the bad changeset. But it will also remove the changesets that come after it. As workaround, you can check the Changeset details for that specify changeset. Then ask that the junior developers remove his code, then check in the delete changeset.
Automatically get all of the changesets in TFS for a solution except
for one specific changeset.
There is way to find and view a TFS changeset by comment text:
tf history $/ -r | ? { $_.comment -like '*findme*' }
Check the this thread for some more details.
But there is no such out of box method to exclude one specific changeset in the text, we need to write our scripts like, batch, powershell to except it from the text.
Hope this helps.
Suppose you realized that you forgot to checkin just one file during a tfs checkin.
Is there a way to rollback the checkin, have the changes that were part of it show up as pending changes and just add the incremental file change. And then just check everything back in.
The reason for my weird request is as follows.
Suppose you do two separate checkins. But those checkins are not successive checkins in the folder/solutions history.
Then when i need to merge just my changes to parent branches, I need to do separate merges for each checkin in the child branch.
Annoyingly tfs doesnt allow non-contiguous checkin. And if the parents branches are gated ie they build each time after checkin, it can mean a wait time of 10 minutes per changeset/checkin. Aarghhhhhhhhhh
Rollback the original changeset
Checkin
Rollback the rollback
Add in the change you forgot the first time
Checkin
I have installed the TFS integration tool and tried to migrate source code from one collection to another on same server. It is working and it copied the code with history to new collection however the history which it is showing is check-in by single user which is mine as I have migrated:
This was the history of one file before migration
This is the history after migration, in this the changeset numbers are changed and the date is also changed. Old Changeset information of number, date and checkin is given in brackets.
If we right click on any changeset and select changeset details than it shows the complete information as shown:
As this migration gives a new changeset number all over previous linking of workitems with changesets will be lost.
Am I doing it right or there is any other way to do it? Can I get the same history as that was in previous collection.
The TFS migration tool is great, but still has some limitations. For example, it is not possible to keep the date of the original checkin and the changesetnumber will not be the same. It is possible to keep the changeset number the same. To achieve this, activate the user mapping feature as described in http://www.felinesoft.com/blog/index.php/2010/11/tfs-to-tfs-migration-between-two-domains/
I accidentally rolled back an entire changeset. How can I undo that operation, and restore the changeset?
If you select "Rollback Entire Changeset" in TFS, it changes the local files so that the changes made in the changeset are reversed.
Since this is a local change and does not take effect until you check the changes in, you can "undo" the rollback by using "Undo pending changes" on your project. Note this will also mean any other uncommitted changes would also be lost, so use with care.
You can always "View History" and retrieve a particular Changeset...
Get the Latest version and Rollback the earlier roll-backed change set and now they get checked out and now check in the changes after required modifications.
Alternatively you can use the following command in visual studio command window:
tf rollback /changeset:changeset_number
If I have a TFS changeset ID, can I find out which other branches that changeset has been merged into? (using VS2008)
I'm not familiar with 2008 since we're only using 2010 here.
To do this in 2010, you can find the changeset in the branch it was created in (history view etc), right click and select Track Changeset, you can then select all the branches you want to see such as dev, prod, release etc. This should then show where the changeset was merged from and to (personally I find it easier to go to the Timeline Tracking to visualise it better).
Shows the original changeset, and any changeset that it has been merged as part of.
Hope this helps, sorry I can't check against 2008!