Show Differences

If you are having a problem using Vault, post a message here.
Post Reply
jkinder
Posts: 5
Joined: Tue Mar 06, 2012 10:24 am

Show Differences

Post by jkinder » Tue Mar 06, 2012 10:32 am

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.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Show Differences

Post by Beth » Tue Mar 06, 2012 11:40 am

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.
Beth Kieler
SourceGear Technical Support

jkinder
Posts: 5
Joined: Tue Mar 06, 2012 10:24 am

Re: Show Differences

Post by jkinder » Tue Mar 06, 2012 12:21 pm

Sorry, yes the API, using VB.NET or C#, doesn't matter.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Show Differences

Post by Beth » Tue Mar 06, 2012 1:59 pm

Try the suggestion in this post in the API section: http://support.sourcegear.com/viewtopic ... iff#p49918.
Beth Kieler
SourceGear Technical Support

jkinder
Posts: 5
Joined: Tue Mar 06, 2012 10:24 am

Re: Show Differences

Post by jkinder » Tue Mar 06, 2012 3:01 pm

Okay, but how? THAT is my question.

jkinder
Posts: 5
Joined: Tue Mar 06, 2012 10:24 am

Re: Show Differences

Post by jkinder » Wed Mar 07, 2012 11:17 am

Any help?

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Show Differences

Post by Beth » Wed Mar 07, 2012 2:59 pm

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

jkinder
Posts: 5
Joined: Tue Mar 06, 2012 10:24 am

Re: Show Differences

Post by jkinder » Thu Mar 08, 2012 10:07 am

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!

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Show Differences

Post by lbauer » Fri Mar 09, 2012 2:00 pm

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.
Linda Bauer
SourceGear
Technical Support Manager

Post Reply