I need to have several changesets rolled-up into a single list of changed files, so that I can code-review the collective differences (from an initial changeset, up through an arbitrary ending changeset), rather than reviewing all changes through the individual intervening changesets.
I'm using VS 2k8. What is the easiest way to accomplish this?
The answer is to open a Visual Studio explorer window, and type this:
tf folderdiff "$/MyStuffInSource;C88986~C91716" /recursive
That causes a window to open that shows the added, removed, changed files - and allows diffs to be launched on the individual files. Superb!!
Related
On one of our builds we are kicking off some automated process which is checking out and checking in some files automatically.
This all works rather well, but at this time we are running the checkin command which looks like the following
tf.exe checkin /force /comment:"foo" /noprompt /bypass /override:"bar"
All of the files with a Pending status will get checked in.
I'd like to make this script a bit more specific and only checkin the files (2 in total) which we actually change during the build, so we know for sure no files will get checked in 'by accident'.
I've already seen we can specify a single filename with the checkin command, but doing so we will get 2 different changesets in TFS, instead of 1. We would really like to have 1 changeset, containing both changed files as the changes belong to eachother.
Any ideas on how to approach this?
Minor addition / Short term solution
For the moment I've solved our 'problem' by specifying the folder where our modified files are located, which kind of looks like this
tf.exe checkin "/my/folder/location/" /recurse /force /comment:"foo" /noprompt /bypass /override:"bar"
Note the folder location and the /recurse parameter added.
You simply separate the files by spaces:
tf.exe checkin file1.ext file2.ext /force /Comment:"foo" /noprompt /bypass /override:"bar"
The documentation is not clear about this point but it might be a general specification of an itemspec that it can be multiple items.
See similar question about checkout: Is there a way to check-out multiple files from various folders in TFS in a single operation
As mentioned by others you might run into problems with the command line being longer than the system supports, in which case you might need to look at other solutions.
cmd.exe has a limit on how long a command can be. Using the version control API, or simply 'tf checkin /i' (no arguments) is likely to be a better choice than passing lots of long filenames.
It's normal if a file becomes automatically checked out due to a change, and if ultimately the contents of the file are changed back to it's original state. At that point you would see the message about identical contents upon comparison. You could also use tfpt uu /noget /r * command to ignore Files which are identical to the originals. You'll need to have TFS Power Tools installed for this to work. Note: there is no TFS Power tool 2017.
For more details please refer below two links:
Visual Studio TFS shows unchanged files in the list of pending changes
Can TFS Pending Changes show files that are truly changed like SourceGear Vault?
I want to use TF.EXE to get a list of the pending changes in my source branch. I want the same list I see in Visual Studio's "Pending Changes" window.
For instance, I current have 167 pending changes shown in the Pending Changes window, about 50/50 edits and adds. Under Excluded Changes, there is a button titled "Detected: 49998 add(s)". These are literally tens of thousands of intermediate/output files in my solution directory that are not under source control, which I don't want under source control, and which are not "Pending Change" by any definition of that term.
However, when I do tf status in my solution directory, it shows me all these files as adds. How do I get just the list of Pending Changes shown in Visual Studio (i.e the files that will actually be checked-in when I submit changes)?
Alternatively, some way to copy the list from the Visual Studio UI. I just want to put this list in an email, but the UI is horrible (won't expand to use available vertical space, can't copy text, etc.) and the command line gives me garbage.
(EDIT) Solution: tf checkin /recursive, select items in list and hit CTRL+C to get list on clipboard.
You are looking for the check in window such as this question: VS2012 return to a normal TFS checkin window?
You could use tf check in command with the prompt window, should be able to copy the list in the E-Mail then. Another method is using TFS api to do this.
Some years later but might still be useful for someone:
tf status -nodetect
I have couple of projects in which one or more files have been updated. These updates need not change the *.proj file but the overall project dll is changed.
Each project can have multiple folders and each folder can have multiple files.
Is there a way in TFS to know which file was when updated last?
If you want to simply see a list of changesets, then you can by going to:
View -> Source Control Explorer
Ctrl-G
Find
All Changesets and select $/Team project
That will give you a list of all changes.
You can get a more fine grained control of this using the:
tf history
Command; something like this:
tf history /recursive $/Project
I believe that if you wanted to list each file then you would have to go to the API.
Is it possible to view history and compare with shelvesets? We are investigating the possibility of using shelvesets instead of check-ins. From our initial investigation it seems we cannot view history like we do for check-ins.
We are using Visual Studio 2010/TFS 2010.
From http://msdn.microsoft.com/en-us/library/ms181403(v=vs.90).aspx
Section: The Difference Between Changesets and Shelvesets:
Unlike a changeset, a shelveset is a non-versioned entity. If you or another user unshelve the items of which a shelveset consists, edit several files, and reshelve the shelveset, Team Foundation does not create a new version of the items for future comparison and maintains no record of who revised the items, when, or in what manner. The original shelveset is completely replaced.
So, no, you can't review history. I am unsure on methods of comparing shelvesets. You should also read that entire section (The Difference Between Changesets and Shelvesets) as each item in it is a strong argument to not use shelvesets in the place of changesets.
I also cannot think of any reason why using shelvesets instead of changesets would be desirable, maybe you can list the reasons why you all were exploring this path. Just think about not being able to track changes, that alone should be a deal breaker (of course, shelvesets not even being versioned should just about do it)..
Like it says on the link posted by dugas, shelvesets are built more for...well, shelving things. For example, on the project I am working on right now, I did a shelveset for some refactoring changes I was in the middle of because something unrelated broke and I needed the code back to the original non error-filled version. I also use it for when I'm in the middle of attempting something and want to have a backup but I don't want to check in code just yet.
There's no versioning on shelvesets, but it is possible to compare code in a workspace, to the code in a shelveset, without pulling the shelveset files.
Pull the versions of files you want to compare the shelveset contents to, into a workspace
open the solution in that workspace
File >> Source Control >> Unshelve Pending Changes...
find the desired shelveset and bring up its details
On each file in the Shelveset Details window, you can right-click and select Compare >> With Workspace Version...
TFS will pull the shelveset file to a temporary location, show the diff, and then (?) clean up the temp file after you're done.
You'll be comparing the shelveset file contents, to the contents of the files on the local disk in this workspace. If changes were made to both files, the compare won't be able to tell and will indicate all those changes. However, you can compare the selveset version to its original (Compare >> With Unmodified Version..), to see all the changes that were made just to the shelveset file. You can also find out the changeset that was the base for the shelveset file (Properties..), and see what changes were added to the workspace version since that common base changeset.
There's no tree compare though, and this may require the TFS power tools to work.
P.S> I don't recomment trying to use shelvesets in place of checkins like this. If there's one thing I've learned over the years, it's not to fight Microsoft's designed-in workflows -- you do things their way, or you find a different tool. Microsoft doesn't intend you to use shelvesets this way (they want you to use changesets and a branch), and if you try, you'll constantly be fighting Microsoft's designed-in workflow.
You can use shelvesets for peer code-review before committing them to the repository ... and also for parking commits before going through a gated build process.
They are not suitable for anything other than "quick shelving" of work - use branching if you want to have multiple parallel work streams.
I'm wondering how I search history in TFS 2005 for any changeset that contains a change (diff) between the file and it's previous version with the word "foobar" in it.
In other words, and more specifically, I want to find the changeset that removed a subscription to an event. Clearly the change won't be in the class raising the event, and because the event subscription is now gone, I don't know where it used to be.
I can probably narrow this down to a few hundred files, but viewing their individual history and then performing a difference on each seems excessive. The TF history command, even in detailed view, only shows me file names.
tf history /format:detailed *.* /noprompt /stopafter:1
Is there an undocumented uber-detailed output that shows a diff of each file with it's previous version?
You can't do this in TFS 2005. You would have to write a program that retrieved the history for the chosen file and for each changeset in the history of the file, it would have to retrieve the version in the changeset and the previous version, and diff the two to determine the changes made and compare them with the text change sought.