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.

Repository Administrationare using server configuration to determine which users are permitted to commit changesto your repository, you don't need to do this sort of access control via the hook system.There is no shortage of <strong>Subversion</strong> hook programs and scripts that are freely availableeither from the <strong>Subversion</strong> community itself or elsewhere. These scripts cover a widerange of utility—basic access control, policy adherence checking, issue tracker integration,email- or syndication-based commit notification, and beyond. Or, if you wish to write yourown, see Chapter 8, Embedding <strong>Subversion</strong>.While hook scripts can do almost anything, there is one dimension in whichhook script authors should show restraint: do not modify a commit transactionusing hook scripts. While it might be tempting to use hook scripts to automaticallycorrect errors, shortcomings, or policy violations present in the files beingcommitted, doing so can cause problems. <strong>Subversion</strong> keeps client-side cachesof certain bits of repository data, and if you change a commit transaction in thisway, those caches become indetectably stale. This inconsistency can lead tosurprising and unexpected behavior. Instead of modifying the transaction, youshould simply validate the transaction in the pre-commit hook and reject thecommit if it does not meet the desired requirements. As a bonus, your userswill learn the value of careful, compliance-minded work habits.Berkeley DB ConfigurationA Berkeley DB environment is an encapsulation of one or more databases, logfiles, regionfiles, and configuration files. The Berkeley DB environment has its own set of default configurationvalues for things such as the number of database locks allowed to be taken outat any given time, the maximum size of the journaling logfiles, and so on. <strong>Subversion</strong>'sfilesystem logic additionally chooses default values for some of the Berkeley DB configurationoptions. However, sometimes your particular repository, <strong>with</strong> its unique collection ofdata and access patterns, might require a different set of configuration option values.The producers of Berkeley DB understand that different applications and database environmentshave different requirements, so they have provided a mechanism for overriding atruntime many of the configuration values for the Berkeley DB environment. BDB checks forthe presence of a file named DB_CONFIG in the environment directory (namely, the repository'sdb subdirectory), and parses the options found in that file. <strong>Subversion</strong> itself createsthis file when it creates the rest of the repository. The file initially contains some default options,as well as pointers to the Berkeley DB online documentation so that you can readabout what those options do. Of course, you are free to add any of the supported BerkeleyDB options to your DB_CONFIG file. Just be aware that while <strong>Subversion</strong> never attempts toread or interpret the contents of the file and makes no direct use of the option settings in it,you'll want to avoid any configuration changes that may cause Berkeley DB to behave in afashion that is at odds <strong>with</strong> what <strong>Subversion</strong> might expect. Also, changes made toDB_CONFIG won't take effect until you recover the database environment (using svnadminrecover).Repository MaintenanceMaintaining a <strong>Subversion</strong> repository can be daunting, mostly due to the complexities inherentin systems that have a database backend. Doing the task well is all about knowing thetools—what they are, when to use them, and how. This section will introduce you to the repositoryadministration tools provided by <strong>Subversion</strong> and discuss how to wield them to accomplishtasks such as repository data migration, upgrades, backups, and cleanups.An Administrator's Toolkit<strong>Subversion</strong> provides a handful of utilities useful for creating, inspecting, modifying, and repairingyour repository. Let's look more closely at each of those tools. Afterward, we'll131

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

Saved successfully!

Ooh no, something went wrong!