Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN: Can I copy a subset of files to a new tag?

In my repo trunk I have a directory unit-tests that I want to keep out of my release tags. What I've been doing is copying trunk to a new tag, then deleting unit-tests. Is this OK? It feels wrong because it takes two revisions to tag every release. Is there a way to exclude a directory from the svn copy?

E.g. I have:

/trunk/unit-tests
/trunk/dir1
/trunk/file1
/trunk/file2

And I want to create:

/tags/release_123/dir1
/tags/release_123/file1
/tags/release_123/file2

I generally use Tortoise/Eclipse clients, but I could cli it if need be.

like image 494
Steve Clay Avatar asked Jul 02 '09 02:07

Steve Clay


1 Answers

You can do this by using the svnmucc program provided by subversion (included in windows builds since SVN1.5) This small tool will collect multiple svnactions into a single commit. however you need to create the destination folder before. It is not possible to create a folder and copy content inside in a single transaction: here a sample:

svn mkdir -m "creating a tag" http://your.serv.er/svn/repo/tags/release_123
svnmucc cp HEAD http://your.serv.er/svn/repo/trunk/dir1 http://your.serv.er/svn/repo/tags/release_123 \
cp HEAD http://your.serv.er/svn/repo/trunk/file1 http://your.serv.er/svn/repo/tags/release_123 \
cp HEAD http://your.serv.er/svn/repo/trunk/file2 http://your.serv.er/svn/repo/tags/release_123 -m "creating tag Part II" 

You can also use the perl/python/ruby bindings or svnkit(java) to accomplish this task, but I cannot provide sourcecode for this..

like image 196
Peter Parker Avatar answered Sep 25 '22 06:09

Peter Parker