Hi everyone, is there a way to perform a SVN checkout (or export), which would fetch only the directory structure, i.e. no files?
Thanks in a advance.
Hi everyone, is there a way to perform a SVN checkout (or export), which would fetch only the directory structure, i.e. no files?
Thanks in a advance.
I can't see that there is a way to do it from a brief look at svn help co
. Something I've done before for updating a repository from a new version of a downloaded library (i.e. a vendor branch) is to delete everything which isn't an .svn folder:
#!/bin/sh
find ./ -type f | grep -v .svn | xargs rm -f
It's not particularly efficient if you were trying to avoid having to check those files out in the first place, but it should have the same result.
SVN can't do that per se, but if you just want to export directory structure, try svn ls -R --xml
to get XML listing of the directory structure and then recreate it by hand.
There's no way to do this, and in fact it's a slightly odd thing to want to do, so now I'm curious!
This may not be relevant, but you can prevent the files being comitted in the first place by adding an svn:ignore property on the relevant directories. This is particularly useful to prevent generated artifacts such as documentation or cache files being comitted.
There is a python script in the contrib tools of subversion (http://svn.collab.net/repos/svn/trunk/contrib/client-side/svn_export_empty_files.py), which creates the directory structure with empty files. With a little bit of python knowledge, it should not be to hard to skip creating the files at all.
svn ls -R {svnrepo} | grep "/$" | xargs -n 1 mkdir -p
Export, not a checkout.
[Updated]
With Export:
env REPO={repo} sh -c 'svn ls -R $REPO | grep "/\$" | xargs -n 1 svn co --depth=empty $REPO'
This will be pretty slow for anything too large.
Hi,
I ve got the same problem I want to replicate the repository directory structure too. requisites: i don't want to execute a svn export because i don't want the whole of the repository structure. (I have the paths of the files that i want to extract.)
Did you get an easy way to do it ?
I am going to make a tcl script.
Any suggestions ? Thanks in advance.
Julia