Get content diff with previous vesrion

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear

Post Reply
Scott Du
Posts: 1
Joined: Mon Dec 01, 2014 5:20 am

Get content diff with previous vesrion

Post by Scott Du » Mon Dec 01, 2014 5:37 am

Hello all, my company was using Vault to manage our source code, and recently my manager wanted to analysis our code quality, and asked me to develop a tool with Vault Api to count changed classes and functions during certain period.
For example, from 2014/6/1 to 2014/10/1, get all the changed files, classes and functions.
Now I am able to get changed file list by ServerOperations.ProcessCommandHistory() method, but next step compare files with previous version to get changed classes and functions, which I don't know how to get it. I am very new to Vault api, can anyone show me a way out? which command or class shall I used, if have any example would be great!

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

Re: Get content diff with previous vesrion

Post by Beth » Mon Dec 01, 2014 5:35 pm

One thing you can do is get the last historical version, pull both versions down to a disk location, and then perform a Diff on those two files.

I think you can also have DiffMerge output the results to a different file, and then you can use your preferred language to look through the file to identify if classes or functions changed.

Nothing in Vault or our Diff tool can identify classes and functions.
Beth Kieler
SourceGear Technical Support

Post Reply