RE: Stats for a file.
From: Reedick, Andrew <jr9445_at_ATT.COM>
Date: Wed, 12 Mar 2008 11:43:01 -0500
Funny you should ask for that. I wrote a script yesterday to do that
It will walk each file in each revision for a range of revisions and get
The general algorithm was
1) Get the revisions to search
cmd = 'svn log --xml -v --stop-on-copy
2) Parse the xml to get the filename entries for each revision.
3) Xml: for each logentry in /log
a. Xml: For each path in logentry/paths
i.
ii.
iii. If
iv. Get
1. svn_path = url_root + path.text + '@' + str(revision) # Peg
2. svn diff -c$Revision -x "-u -w -ignore-eol-style" svn_path
3. If diff is successful
a. Ignore the first pair of '-' and '++' lines
b. Count the '^-' as deletes
c. Count the '^+' as adds
4. Else diff had an error, which might be ok
a. If the stderr starts with 'svn: Unable to find repository
b. Else
c. For each line in 'svn cat -r $revision' svn _path'
d. If 'svn cat... ' threw an error, then
e. Else
5. Save statistics
4) Print statistics
5) Exit(exit_code)
'svn diff' won't report on binary files, so no worries there ('svn
From: Gavin 'Beau' Baumanis [mailto:gavin_at_thespidernet.com]
Hi Everyone,
i would a report of some description that will display how many lines
And of course, if it is all possible what might be the required syntax
As always, thanks in advance for any assistance.
- Gavin
*****
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. GA623
|
This is an archived mail posted to the Subversion Users mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.