11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Advanced TopicsNow, let's check out the same tree again, but this time we'll ask <strong>Subversion</strong> to give us onlythe topmost directory <strong>with</strong> none of its children at all:$ svn checkout file:///var/svn/repos mom-empty --depth emptyChecked out revision 1$Notice that we added to our original svn checkout command line a new --depth option.This option is present on many of <strong>Subversion</strong>'s subcommands and is similar to the --non-recursive (-N) and --recursive (-R) options. In fact, it combines, improvesupon, supercedes, and ultimately obsoletes these two older options. For starters, it expandsthe supported degrees of depth specification available to users, adding some previouslyunsupported (or inconsistently supported) depths. Here are the depth values that youcan request for a given <strong>Subversion</strong> operation:--depth emptyInclude only the immediate target of the operation, not any of its file or directory children.--depth filesInclude the immediate target of the operation and any of its immediate file children.--depth immediatesInclude the immediate target of the operation and any of its immediate file or directorychildren. The directory children will themselves be empty.--depth infinityInclude the immediate target, its file and directory children, its children's children, andso on to full recursion.Of course, merely combining two existing options into one hardly constitutes a new featureworthy of a whole section in our book. Fortunately, there is more to this story. This idea ofdepth extends not just to the operations you perform <strong>with</strong> your <strong>Subversion</strong> client, but alsoas a description of a working copy citizen's ambient depth, which is the depth persistentlyrecorded by the working copy for that item. Its key strength is this very persistence—thefact that it is sticky. The working copy remembers the depth you've selected for each itemin it until you later change that depth selection; by default, <strong>Subversion</strong> commands operateon the working copy citizens present, regardless of their selected depth settings.You can check the recorded ambient depth of a working copy using the svninfo command. If the ambient depth is anything other than infinite recursion,svn info will display a line describing that depth value:$ svn info mom-immediates | grep '^Depth:'Depth: immediates$Our previous examples demonstrated checkouts of infinite depth (the default for svncheckout) and empty depth. Let's look now at examples of the other depth values:$ svn checkout file:///var/svn/repos mom-files --depth filesA mom-files/kitty1.txtA mom-files/doggie1.txtChecked out revision 1.$ svn checkout file:///var/svn/repos mom-immediates --depth immediates60

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

Saved successfully!

Ooh no, something went wrong!