How to check only source files?

I would like to use Subversion and checkout only the source files (for example: checking only .c , .cpp and .h files). Is it possible? If so, how can I do this?

I am trying to get the source code of a website:

 http://svn.webkit.org/repository/webkit/releases/WebKitGTK/ 

I really don't want to change the code and check or create it again. I just need the source files because downloading the entire release is about 3 GB per version.

PARTIAL SOLUTION:

Now I'm going to download the directories I want. But I could go through directories recursively and then upload files that follow the template I want.

This is the pseudo python code I'll call

 GetAllSourceFiles('http://svn.webkit.org/repository/webkit/releases/WebKitGTK/') def GetAllSourceFiles(directoryName): list = svn ls directoryName for name in list: if name is a file of type c,cpp or h: do svn export directoryName + name else if name is directory: do GetAllSourceFiles(name) 
+4
source share
2 answers

If you know the structure of the repository, you can check specific folders. I have never tried it with files. But you need to check each folder separately. You need to write it as described in a typical svn repository

for outside line

 svn co repository_url/trunk/path_to_folder checkout_destination/ 

for the branch

 svn co repository_url/branches/name_of_branch/path_to_folder checkout_destination/ 

for release

 svn co repository_url/releases/name_of_releases/path_to_folder checkout_destination/ 

change

You can try to write a duty cycle script

Using

 svn ls repository_url/releases/name_of_releases/path_to_folder 

check if the folder contains source files.

if the folder contains the source files, then download it using

 svn co repository_url/releases/name_of_releases/path_to_folder --non-recursive 

Check next folder

+3
source

Just a small correction, I know this is a detail, but it can also be at the same wavelength. When you say that the download is 3 GB per version, this is not the right way to see it. The first check will be a big load. Subsequent updates to source codes or even returning versions will be approximately equal to the difference between the two versions.

Now suppose you can be low on disk or want to reduce bandwidth a bit. I was thinking about your question, and the only thing I can come up with is to use “External Definitions” to check the external repository in your own repository. This is the only way I can think of where you can cherry-pick the files you need without the help of third-party developers. But this is a lot of handmade, not so good.

Another solution is to get these tools, work a little more, but allow a little more flexibility for any project, if everything is done correctly. I see you from your profile, which seems like Java to you, there are client libraries there that allow you to get svn ls, you parse the result only to get these .c and .ccp files. But it will be very slow, since it will check the files individually. Although, as soon as you do this, you can also generate your external definitions in a file and thus have the best of both worlds. You have svn speed, flexibility in choosing cherry options and best of all .

Svn can be very flexible, but for some specialized needs you need to tickle the tool together and, fortunately, most languages ​​have pretty decent client libraries.

Good luck :)

UPDATE

According to this post :

If you are fortunate enough to use subversion 1.6, you can have external links for directories and files

+1
source

All Articles