[ statsvn-Feature Requests-1897165 ] Support for MultiDir/svn:externals

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[ statsvn-Feature Requests-1897165 ] Support for MultiDir/svn:externals

Feature Requests item #1897165, was opened at 2008-02-19 20:58
Message generated for change (Comment added) made by aleksas
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Input Layer: SVN
Group: Next Release (example)
Status: Open
Priority: 5
Private: No
Submitted By: Allard (allarddijk)
Assigned to: Nobody/Anonymous (nobody)
Summary: Support for MultiDir/svn:externals

Initial Comment:
Projects with linked in directories are not supported at this moment. It just skips this dirs. The information is normally not included with the normal svn commandline.

to gather this information one should make a batch in this form:

del x:\svn.log
svn log --incremental --xml directoryA >> x:\svn.log
svn log --incremental --xml directoryB >> x:\svn.log
svn log --incremental --xml directoryC >> x:\svn.log

Now one should supply this directories to the stat software. In the current situation you can only supply 1 directory.

When this is ready you have this features:

*support for multiple projects
*support for projects using svn:external


Comment By: Aleksas Pielikis (aleksas)
Date: 2010-05-25 18:22

Wrote a powershell script to make a full log including externals set on the
project directory. But this doesn't solve the issue. I guess stats do not
show info for directories outside project directory in repository. Any way
here is the script:

$path = $args[0];
$logOutput = $args[1];
$statOuputDir = $args[2];
$statSvnJarPath = $args[3];

$svn = "svn"
$getExternalsParameters = "propget svn:externals '$path'"
$getLogParameters = "log --incremental --xml -v '$path'"

$externals = Invoke-Expression -Command ("$svn $getExternalsParameters");

'<?xml version="1.0"?>' | Out-File $logOutput;
'<log>' | Out-File $logOutput  -append;

"Resolving changes for '$path'"
Invoke-Expression -Command ("$svn $getLogParameters") | Out-File
$logOutput  -append;

foreach($external in $externals)
    if($external -ne "")
        $dir = Join-Path $path $external.Split(" ")[1]
        $getExternalsLogParameters = "log --incremental --xml -v '$dir'"
        "Resolving changes for '$dir'"
        Invoke-Expression -Command ("$svn $getExternalsLogParameters") |
Out-File $logOutput -append;
'</log>' | Out-File $logOutput -append;
if ((Test-Path -path $statOuputDir) -ne $True)
    New-Item $statOuputDir -type directory;

$currentLocation = Get-Location

Set-Location $statOuputDir

Invoke-Expression -Command ("java -jar  '$statSvnJarPath' '$logOutput'
'$path'") | ;

Set-Location $currentLocation


Comment By: Heiko Stoermer (stoermer)
Date: 2009-09-08 15:47

My layout is roughly the following: I have 4 projects A, B, C, D.

A has the layout

where /src/ has A's source, and /components/* are the projects B,C,D
pulled in via svn:externals.
So after a checkout including the externals I get something like

 /A/components/X/src/ (from B)
 /A/components/Y/src/ (from C)
 /A/components/Z/src/ (from D)

I can create the complete log of everything following Allard's proposal
and fixing the resulting non-well-formed XML file that svn produces by

When I run statsvn on the resulting log file giving /A/ as path, i get
tons of "problems getting diff" messages and "no such revision". All
subfolders in the resulting report do appear, but e.g. LOC calculations
seem very much off.


Comment By: Jason Kealey (jkealey)
Date: 2009-09-08 15:24

What is StatSVN's current behavior concerning svn:externals?

What does the svn log show when you point to an external folder? A
modification to the directory (to add the svn:externals metadata)?
Afterwards, no modifications are shown in the directories that include it,
even when the files are modified (as these changes are elsewhere in the

What would you do if you had a repository that had an svn:externals to
itself. If you checked out the trunk, would you expect the change to the
included directory to be seen as a modification in all the places that use


Comment By: Heiko Stoermer (stoermer)
Date: 2009-09-08 11:05

Btw, Allard's example has the flaw that seemingly in svn the combination of
"--xml" and "--incremental" does NOT result in a well-formed XML document
(at least on the machine with svn 1.4 I have available here right now, see
[1]), so you'll have to do some fixing first.



Comment By: Heiko Stoermer (stoermer)
Date: 2009-09-08 10:40

Would be great to have support for the analysis of projects that include
sub-projects via svn:externals.


You can respond by visiting:


Statsvn-developers mailing list
[hidden email]