Branch only selected folders?

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
DanielSchaffer
Posts: 14
Joined: Wed Nov 22, 2006 9:19 am

Branch only selected folders?

Post by DanielSchaffer » Fri Mar 14, 2008 12:18 pm

Our repository is set up such that we have an entire codebase within a single repository.

We're primarily a web development shop, so we have web site projects as well as their supporting libraries in the repository. Different projects will use a different combination of the supporting libraries.

We currently aren't using a branching scheme, and I'm trying to figure out the best way to do this. What I've come up with so far is something that looks like this:

Code: Select all


$
- Branches
- - A
- - - v1.0
- - - - Project A
- - - - Library I
- - - - Library II
- - - v1.2
- - - - Project A
- - - - Library I
- - - - Library II
- - B
- - - v1.0
- - - - Project B
- - - - Library I
- - - - Library III
- - C
- - - v1.0
- - - - Project C
- - - - Library II
- - - - Library III
(and so-on)

- Trunk
- - Project A
- - Project B
- - Library I
- - Library II
- - Library III
In total, we have somewhere around 60 different project and library folders in our trunk. So, creating an entire branch for each version seems like it would be overkill.

Is there a way to only branch a portion of the trunk, or is there a better way to do this?

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Post by Beth » Mon Mar 17, 2008 7:53 am

Will any of those branches have code that gets merged back into the trunk?
Will the branches all be just slightly different or all the same?

The way you showed above looks good to me; I'm just trying to determine if a branch is the best way to go here.

DanielSchaffer
Posts: 14
Joined: Wed Nov 22, 2006 9:19 am

Post by DanielSchaffer » Tue Mar 18, 2008 1:11 pm

What I'd like to do is when work begins on a new release, a branch off of trunk will be created for the release, and all work will be done there. That way, changes that are made to any of the shared libraries that are checked in won't have any unexpected consequences for other developers that are also using them in their projects. When the release has been deployed, the branch will be merged with the trunk. If there are any fixes that need to be made after the deployment, the production source code is still in the branch.

The release branches for a given project will all be mostly the same. However, the branches will all be very different between projects. The example I used in my OP is a very tame example of what our repository actually looks like.

My only problem with this approach is basically what I said in the OP - branching copies EVERYTHING, and I don't need or want everything in the branches.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Post by Beth » Wed Mar 19, 2008 12:47 pm

Ok, makes sense. I see nothing wrong with the solution you laid out.

DanielSchaffer
Posts: 14
Joined: Wed Nov 22, 2006 9:19 am

Post by DanielSchaffer » Wed Mar 19, 2008 2:34 pm

Well my problem is that the branch function copies everything in trunk... so for example, each version branch for the "A" project would have Projects A, B and C and Libraries I, II and III when all that needs to be there are Project A and libraries I and II. And like I said, that is a very tame example of our actual usage - I don't want to have around 60-70 folders worth of code in each branch when all I need, on average, are 5. Any suggestions on how to to this?

GregM
Posts: 485
Joined: Sat Mar 13, 2004 9:00 am

Post by GregM » Wed Mar 19, 2008 3:28 pm

So you need to do 3 branch operations. Create a new folder to hold the branches, and then branch Project A and libraries I and II into it.

DanielSchaffer
Posts: 14
Joined: Wed Nov 22, 2006 9:19 am

Post by DanielSchaffer » Wed Mar 19, 2008 3:51 pm

Oy. Alright, sounds like something that will need to be automated. Thanks guys!

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Post by Beth » Thu Mar 20, 2008 10:05 am

You got it. You could write a batch file using our command line client for that.

DanielSchaffer
Posts: 14
Joined: Wed Nov 22, 2006 9:19 am

Post by DanielSchaffer » Thu Mar 20, 2008 10:11 am

Yeah, we've already got Sharepoint lists of all our projects and their dependencies, so I'll probably write up a little web based utility to do it all in a few clicks :D Or I could get really slick and have it actually open up the solution file. This'll be fun :D

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Post by Beth » Wed Mar 26, 2008 2:09 pm

Sounds good.

Post Reply