Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore branches in SVN working copy

Recently we made the first branch of our project's trunk. The trunk is rather large (severals GB's) which doesn't matter for the server, because the branch is made via efficient linking there. In the client working copies however, the project now really does take twice the amount of space (all our WC's are from the repository root).

Since only a few people really need the branch, how can the others ignore (i.e. not download) all the branches using TortoiseSVN?

Users only checking out trunk, as suggested below, is not the solution here. Our structure is as such:

/
 projects
  project-x
   assets
    blabla.psd
   code
    trunk
    branches
     branch1
     branch2
  project-y
   ...
like image 966
Bart van Heukelom Avatar asked Dec 10 '22 12:12

Bart van Heukelom


2 Answers

Short solution - switch to /trunk. All who don't need anything else but trunk can just checkout from /root/trunk instead from /root. Anyone who wants a branch should just checkout the branch in another directory.

More elaborate solution - checkout only what you need but maintain tree structure. If you want both the freedom to have it all, and use only those you want then follow these steps:

  1. checkout from root with option "immediate children only"
  2. checkout from root/trunk with option "full recursive"

If someone wants some special branch checked out then after previous two steps:

  • checkout from root/branches with option "immediate children only"
  • checkout from that special branch with option "full recursive"

You can find more on the subject in SVN good book, chapter "Sparse Directories".

There is no shortcut to this procedure to cherry-pick branches. Except for batch file and TortoiseProc.

EDIT: If you already have the whole repository checked out, and now you want to exclude something to save space, use command "Update item to revison" on folder you want excluded with checkout dept "Exclude". According to the manual this option is only available in the Update to revision dialog. I guess it is meant for just this purpose.

Try this first on temporary working copy. I've never done this personally.

UPDATE: From TortoiseSVN 1.7 Checkout dialog has a button "Choose items" that enables you to select only the wanted folders and fetch them in single step. Same button is also available in "Update item to revision" dialog.

like image 100
Dialecticus Avatar answered Dec 23 '22 12:12

Dialecticus


(from the root of your working copy)

find . -name branches -exec svn update --set-depth empty {} \;

This will remove all branches from your working copy, and future updates will not download them. Developers who want to see a branch can subsequently:

svn update --set-depth infinity branches\my-feature-branch
like image 36
Brett McBride Avatar answered Dec 23 '22 14:12

Brett McBride