File History --> Calculating count of changed lines

This forum is now locked, since Gold Support is no longer offered.

Moderator: SourceGear

Locked
aluetjen
Posts: 40
Joined: Wed May 19, 2004 1:00 am
Location: Germany, Karlsruhe
Contact:

File History --> Calculating count of changed lines

Post by aluetjen » Sun May 30, 2004 2:49 pm

Before testing a new build we would like to calculate some kind of matrix showing which parts of the code changed by whom. The matrix will than be used to plan testing. Is there a possibility to query for the count of lines that changed between two file versions? Can I query this information directly using SQL?

Regards, Alex
update4u Software AG

ericsink
Posts: 346
Joined: Mon Dec 15, 2003 1:52 pm
Location: SourceGear
Contact:

Re: File History --> Calculating count of changed lines

Post by ericsink » Sun May 30, 2004 3:47 pm

aluetjen wrote:Before testing a new build we would like to calculate some kind of matrix showing which parts of the code changed by whom. The matrix will than be used to plan testing. Is there a possibility to query for the count of lines that changed between two file versions? Can I query this information directly using SQL?

Regards, Alex
Sorry -- this information actually does not exist in the database.

The database does store most versions of a file as a "delta", a set of differences against another version. However, for performance and other reasons, this delta is a binary delta, not a line-based text delta.

In other words, the only way to calculate the number of lines changed between two versions of a file is to retrieve both versions and run a line-based textual diff.
Eric Sink
Software Craftsman
SourceGear

aluetjen
Posts: 40
Joined: Wed May 19, 2004 1:00 am
Location: Germany, Karlsruhe
Contact:

Re: File History --> Calculating count of changed lines

Post by aluetjen » Sun May 30, 2004 3:58 pm

ericsink wrote:
aluetjen wrote:In other words, the only way to calculate the number of lines changed between two versions of a file is to retrieve both versions and run a line-based textual diff.
It would be great if we could tell sdmg.exe to write the detected diffs to a XML file instead of interactivly showing them... :wink:
update4u Software AG

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Post by jeremy_sg » Sun May 30, 2004 7:59 pm

If you're willing to get into the ClientAPI, you can use the Blame feature to generate a list of changed lines from one version of a file to the next. Eric is right, in that the files will be fetched and compared, but the server will doing the fetching and comparing, and only the list of who changed what line will be sent to the client. Experiment with the Show Blame menu item to see if it has the kind of information that you want.

If you're interested, I could help you out with that.

-Jeremy

aluetjen
Posts: 40
Joined: Wed May 19, 2004 1:00 am
Location: Germany, Karlsruhe
Contact:

Post by aluetjen » Mon May 31, 2004 4:44 am

Excellent that's great. I'll check this out. I'll extend the cmdline client to do some modified blame command according to my first look on it that should perfectly fit.

Best regards, Alex
update4u Software AG

Locked