Show Differences
Show Differences
Can anyone explain to me (or just point me in the right direction for documentation) on how I would show differences between 2 older versions of the same file (i.e. maybe there is 5 versions, but user wants to compare versions 2 and 4). I have a history window working fine, now I want the user to select 2 versions and open the differences window so they can quickly review the changes.
I have been trying to use the ProcessCommandDiff but I don't understand how it works. Any help would be greatly appreciated.
Thanks.
I have been trying to use the ProcessCommandDiff but I don't understand how it works. Any help would be greatly appreciated.
Thanks.
Re: Show Differences
If you are trying to show differences in the Vault GUI client, then perform a Show History on a file. Then in the history, select the two versions to diff, right click, and select Diff.
If you're instead trying to use the Vault API, then let me know.
If you're instead trying to use the Vault API, then let me know.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Show Differences
Sorry, yes the API, using VB.NET or C#, doesn't matter.
Re: Show Differences
Try the suggestion in this post in the API section: http://support.sourcegear.com/viewtopic ... iff#p49918.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Show Differences
Okay, but how? THAT is my question.
Re: Show Differences
In the Client API that you downloaded, look for the command-line client code. There is a file called VaultCmdLineClient.cs. Look for "case Command.DIFF." That should be an example you can use.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: Show Differences
So let me make sure I have this straight. To compare 2 non-current versions of the same file (or any files for that matter) I have to do that following:
1. Get Version A into a "temporary" folder.
2. Set the "temporary" folder to the current working folder.
3. Do a diff compare use Version B as the -compareTo option.
4. Set the current working folder back to the original working folder.
I just want to make sure I understand. I am obviously pretty new to this API. I figured there would be a Diff call that could compare to repository items based on their version numbers and not limited to the current working file. If that is not the case, then I want to ensure the steps I listed above are the proper steps before doing all this work.
Thanks!
1. Get Version A into a "temporary" folder.
2. Set the "temporary" folder to the current working folder.
3. Do a diff compare use Version B as the -compareTo option.
4. Set the current working folder back to the original working folder.
I just want to make sure I understand. I am obviously pretty new to this API. I figured there would be a Diff call that could compare to repository items based on their version numbers and not limited to the current working file. If that is not the case, then I want to ensure the steps I listed above are the proper steps before doing all this work.
Thanks!
Re: Show Differences
The code library in our VaultClientIntegrationLib API was primarily designed for diffing files in the working folder.
If you are strictly diffing historical versions there are some different options you could use, found in the lower levels of our API
These steps may help:
a) Download version X and version Y to a temp location. This can be done by using
GetOperations.ProcessCommandGetToLocationOutsideWorkingFolder()
b) Read HKCU\Software\SourceGear\Vault (or VaultPro)\Client\Settings\CustomDiff. For %VAULT_EXE_DIR%, this can be found at HKLM\Software\(Wow6432Node - if on 64-bit system)\SourceGear\Vault (or VaultPro) Client\InstallDir
c) Launch the diff program from step b using the two files from step a.
Note: you can also configure the diff tool of your choice for the diff.
If you are strictly diffing historical versions there are some different options you could use, found in the lower levels of our API
These steps may help:
a) Download version X and version Y to a temp location. This can be done by using
GetOperations.ProcessCommandGetToLocationOutsideWorkingFolder()
b) Read HKCU\Software\SourceGear\Vault (or VaultPro)\Client\Settings\CustomDiff. For %VAULT_EXE_DIR%, this can be found at HKLM\Software\(Wow6432Node - if on 64-bit system)\SourceGear\Vault (or VaultPro) Client\InstallDir
c) Launch the diff program from step b using the two files from step a.
Note: you can also configure the diff tool of your choice for the diff.
Linda Bauer
SourceGear
Technical Support Manager
SourceGear
Technical Support Manager