11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Advanced TopicsA mom-immediates/sonA mom-immediates/daughterA mom-immediates/kitty1.txtA mom-immediates/doggie1.txtChecked out revision 1.$As described, each of these depths is something more than only the target, but somethingless than full recursion.We've used svn checkout as an example here, but you'll find the --depth option presenton many other <strong>Subversion</strong> commands, too. In those other commands, depth specificationis a way to limit the scope of an operation to some depth, much like the way the older --non-recursive (-N) and --recursive (-R) options behave. This means that whenoperating on a working copy of some depth, while requesting an operation of a shallowerdepth, the operation is limited to that shallower depth. In fact, we can make an even moregeneral statement: given a working copy of any arbitrary—even mixed—ambient depth,and a <strong>Subversion</strong> command <strong>with</strong> some requested operational depth, the command willmaintain the ambient depth of the working copy members while still limiting the scope ofthe operation to the requested (or default) operational depth.In addition to the --depth option, the svn update and svn switch subcommands also accepta second depth-related option: --set-depth. It is <strong>with</strong> this option that you canchange the sticky depth of a working copy item. Watch what happens as we take ourempty-depth checkout and gradually telescope it deeper using svn update --set-depth NEW-DEPTH TARGET:$ svn update --set-depth files mom-emptyA mom-empty/kittie1.txtA mom-empty/doggie1.txtUpdated to revision 1.$ svn update --set-depth immediates mom-emptyA mom-empty/sonA mom-empty/daughterUpdated to revision 1.$ svn update --set-depth infinity mom-emptyA mom-empty/son/grandsonA mom-empty/daughter/granddaughter1A mom-empty/daughter/granddaughter1/bunny1.txtA mom-empty/daughter/granddaughter1/bunny2.txtA mom-empty/daughter/granddaughter2A mom-empty/daughter/fishie1.txtUpdated to revision 1.$As we gradually increased our depth selection, the repository gave us more pieces of ourtree.In our example, we operated only on the root of our working copy, changing its ambientdepth value. But we can independently change the ambient depth value of any subdirectoryinside the working copy, too. Careful use of this ability allows us to flesh out only certainportions of the working copy tree, leaving other portions absent altogether (hence the“sparse” bit of the feature's name). Here's an example of how we might build out a portionof one branch of our family's tree, enable full recursion on another branch, and keep stillother pieces pruned (absent from disk).$ rm -rf mom-empty$ svn checkout file:///var/svn/repos mom-empty --depth emptyChecked out revision 1.$ svn update --set-depth empty mom-empty/sonA mom-empty/son61

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!