I want to be able to diff all my app.config files that resides in folders called MessagingService. I have read the documentation on the tf.exe about 50 times now, and I can't understand that the syntax should be different than:
tf.exe treediff $/myproject/main $/myproject/prod /filter:"app.config;MessagingService\" /r
but this leaves no results. As far as I can understand the folder inclusion mask does not behave as expected, because the following line works fine:
tf.exe treediff $/myproject/main $/myproject/prod /filter:"app.config;!MessagingService\" /r
but of course it displays only the app.configs I'm not interested in :)
Any enlightening comments are highly appreciated.
try this one ...
tf.exe treediff $/myproject/main $/myproject/prod /filter:"app.config;*MessagingService*\" /r
I believe stars are needed after and before MessagingService word because "app.config" IS the entire filename but MessagingService word IS NOT the entire path value, it is just a part of the actual file path.
Related
I'd like to compare two files at particular changesets to see if they are identical or not.
Something like:
>> cm diff rev:Folder\MyFile.py#cs:5 rev:Folder\MyFile.py#cs:10
<< True
I'm getting an error (can't find revision of file I specify) and I think I might not be using diff as it's intended. I've worked around my confusion by using getfile on the particular file and changesets I'm comparing and using a python library file compare.
Thanks.
The Plastic SCM default diff tool will open a GUI showing you the file differences.
But you can manually configure a different one (eg. diff.exe) manually editing the "/home/user/.plastic/client.conf" or using the Plastic SCM GUI:
<DiffToolData>
<FileType>enTextFile</FileType>
<FileExtensions>*</FileExtensions>
<Tools>
<string>diff.exe #sourcefile #destinationfile</string>
</Tools>
</DiffToolData>
This way, you can run diffs through the command line and based on the output, determine if the files are identical or not.
You can use cm patch command
reference : https://blog.plasticscm.com/2018/11/unified-diff-of-branch.html
I am looking for a file comparison tool (like WinMerge) that will compare the text of the files AND on the lines that were changed let me append a comment to the end of the line such as "//changed by bob".
The file would then be saved with the changes the developer made and with the added comment on every line changed.
I have found ways to log changes to a file but not a way to append the file that is being committed.
We are using ClearCase as source control so we have access to cleartool.
I am not aware of such a tool.
The closest you might consider would be cleartool annotate (see "How to use ClearCase Annotate").
You could process the output of this command in order to regenerate the file content with the right information added to each line.
Background: I am writing a batch files to create and check in some contract files (language agnostic representations of API files) whenever we check into an API project. I am checking in the files with the following command:
tf checkin /flags myContractFiles
Frequently the contract files do not change so I often get this error:
There are no remaining changes to check in.
As a result the build fails.
Question: Is there a way to avoid this particular error?
What I have tried: I am aware of the /force flag for tf checkin (as suggested here), but would rather not use it because I would prefer to only check in when there actually is a change (I do not want to pollute the branch history with changesets with no changes). I have also seen the tf diff and tf folderdiff commands, but it looks like they output their result to the command line, and I am unable to do something like this:
if tf folderdiff ... (
tf checkin ...
)
You will either have to parse the folderdiff result to do what you want or create a custom activity to detect the changes through the API.
I am trying to understand how to solve the following situation.
I have a TFS 2012 server with three collections, say;
- http://tfs2012:8080/tfs/DefaultCollection/
- http://tfs2012:8080/tfs/CollectionOne/
- http://tfs2012:8080/tfs/CollectionTwo/
In CollectionOne and CollectionTwo I have a workspace of the same name, lets call it "TestWorkspace".
When I run a map command for that workspace on CollectionOne it works perfectly (can get, delete, update, etc). The issue comes when I try to unmap the workspace as I am done using it (think build machine), the following call fails.
tf.exe workfold /unmap /workspace:TestWorkspace E:\Temp
It fails with;
Multiple workspaces exist with the name TestWorkspace.
Please specify the Team Foundation Server or qualify the name with the owner.
Therefore I try the following;
tf.exe workfold /unmap /workspace:TestWorkspace E:\Temp /collection:http://tfs2012:8080/tfs/CollectionOne/
Which fails with the following;
The option collection is not allowed.
Also specifying the owner of the workpsace doesn't help as they are owned by the same user.
How do I unmap a workspace which exists in two or more collections?
This has been reported as a bug here: https://connect.microsoft.com/VisualStudio/feedback/details/574162/tf-workfold-unmap-not-accepting-collection-option
See here for a workaround: http://wiert.me/2012/08/29/vs2010-workfold-command-allows-moving-a-local-working-folder-for-a-workspace-but-not-unmapping-it-when-you-have-multiple-workspaces-with-the-same-name/
This is indeed an annoying defect. Here's a simple workaround I've used successfully.
# Rename existing workspace to something unique
tf workspace /collection:http://yourserver:8080/tfs/DefaultCollection /newname:TEMPORARY /noprompt DEVBOX-SGY
# Unmap based on new (unique) name
tf workfold /unmap /workspace:TEMPORARY C:\Code\Tools
# Rename workspace back to original name to avoid side-effects
tf workspace /newname:DEVBOXSGY /noprompt TEMPORARY
Personally I was not able to use the workaround mentioned by sparkplug, because I needed something automation friendly.
Assume there is a TFS project Project with the subfolders trunk and 1.0. trunk contains the latest version of the application code for this project and 1.0 contains the code for the same application for the released version of the same name.
There are labels for both sub-folders and all of the labels include files in only one of the sub-folders. [You could also assume that the labels are recursive on a specific (maximum) changeset for all of the files in the entire sub-folder too if that simplifies your answer.]
How can I create a list of labels for one of these sub-folders, using Visual Studio, the TFS tf.exe command line tool, or any other tool or code that is publicly (and freely) available.
Note – I've written T-SQL code that queries the TFS version control database directly to generate this info, but I'm curious whether there are 'better' ways to do so.
In Visual Studio, in the Source Control Explorer window, right-click the sub-folder for which you want to list the relevant labels and pick View History from the context menu. In the History window that should appear, there should be a sub-tab Labels (as highlighted below) that lists labels applied to that sub-folder (but not specific items in that sub-folder).
To find labels in Visual Studio
Open Source Control Explorer.
In Source Control Explorer, open the shortcut menu for the collection, team project, branch, folder, or file that you are looking for.
Select View History. You will see a new window with all the Changesets.
Select Labels in the tab menu as highlighted in the below image.
I needed to do this on the command line today so here is a batch file that hopefully does the same thing (we've only just started using TFS and have limited labels on folders to test the OP's requirements).
You'll need to edit the collection parameter to tf to whatever your setup is, and possibly provide the login details depending on how your authentication is done.
#ECHO OFF
SETLOCAL EnableDelayedExpansion
#REM Check required parameters
IF [%1]==[] GOTO :usage
tf labels /owner:* /format:detailed %2 /collection:http://server:8080/tfs/collection > labels.txt 2> nul
SET CURRENT_LABEL=
FOR /F "tokens=1,2,3" %%G IN (labels.txt) DO (
IF [%%G]==[Label] (
SET CURRENT_LABEL=%%I
) ELSE (
IF /I [%%H]==[%1] (
ECHO !CURRENT_LABEL!
)
)
)
DEL labels.txt
GOTO :eof
#REM Subroutines
:usage
echo tfs_labelsforfolder - Display all labels that are applied to a folder.
echo.
echo tfs_labelsforfolder ^<folder^> ^[label_filter^]
echo.
echo folder - The folder to show the labels for, e.g. $/Project/folder
echo label_filter - Search pattern to use in tf labels command.
echo.
GOTO :eof