开发者

Complex SVN Checkout Procedure?

开发者 https://www.devze.com 2022-12-17 01:15 出处:网络
I have a repository configured like this: +---CollectionA |\\---project1 |\\---trunk |\\---sourcecode |\\---tags

I have a repository configured like this:

+---CollectionA
|   \---project1
|       \---trunk
|           \---sourcecode
|       \---tags
|       开发者_运维知识库    \---rel-1
|   \---project2
|       \---trunk
|           \---sourcecode
|       \---tags
|   \---project3
|       \---trunk
|           \---sourcecode
|       \---tags
|           \---rel-1

I'd like to checkout any project tagged rel-1 as that project. In this case I'd get project1 and project3 in my workspace, but not project2.

All projectN are Eclipse Java projects.

I'm using Eclipse/Subversive, but I'm open to using Tortoise or the command line (windows) if I need to.

Edit: Currently, to do this, I'll have to go through my 30-some projects and checkout each tag individually. Is there a way to do this without going through each project individually?


I think you will need to write a command line script in order to do this. There's no way I know of to do this using Tortoise or an integrated IDE/SVN tool since this is an uncommon (in my experience) type of checkout operation.

You can ask svn on the command line as to whether a directory exists using the svn list command.

Then you could check the output (maybe it returns a non-zero value if the directory isn't found, or you could parse the output stream) to determine whether the tag exists. Add the projects that contain the tag to a list, then checkout those projects.

Something like this:

For each project in myProjects:
   exec "svn list " myRepositoryPath + "/" + myProject + "/tags/directory"


We use scripting to achieve the efficiency you're looking for. Create a generic checkout script that looks to a second manifest file that contains the tags/branches/trunk names that you want to checkout for each module.

I've toyed with the idea of creating a module that contains "project" directories with externs to the specific tags/branches/trunks of the projects' modules combination but I've never gotten around to doing it.


If you're going to do this a lot, you could create another directory in your repository, and give it the svn:externals property. List all the relevant projects as externals. Then when you check out the new directory, you'll get all the projects checked out inside it.


To complement the previous answers, you could user the scripts to create a Eclipse Team Project Set file, to directly import all the projects at once. Couldn't find a directe reference to the "psf file format", but you'll get the idea with this example and checking the eclipse help.

0

精彩评论

暂无评论...
验证码 换一张
取 消