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 AdministrationEarlier in this chapter (in the section called “Strategies for Repository Deployment”), welooked at some of the important decisions that should be made before creating and configuringyour <strong>Subversion</strong> repository. Now, we finally get to get our hands dirty! In this section,we'll see how to actually create a <strong>Subversion</strong> repository and configure it to perform customactions when special repository events occur.Creating the Repository<strong>Subversion</strong> repository creation is an incredibly simple task. The svnadmin utility thatcomes <strong>with</strong> <strong>Subversion</strong> provides a subcommand (svnadmin create) for doing just that.$ # Create a repository$ svnadmin create /var/svn/repos$This creates a new repository in the directory /var/svn/repos, and <strong>with</strong> the defaultfilesystem data store. Prior to <strong>Subversion</strong> 1.2, the default was to use Berkeley DB; the defaultis now FSFS. You can explicitly choose the filesystem type using the --fs-type argument,which accepts as a parameter either fsfs or bdb.$ # Create an FSFS-backed repository$ svnadmin create --fs-type fsfs /var/svn/repos$# Create a Berkeley-DB-backed repository$ svnadmin create --fs-type bdb /var/svn/repos$After running this simple command, you have a <strong>Subversion</strong> repository.The path argument to svnadmin is just a regular filesystem path and not aURL like the svn client program uses when referring to repositories. Both svnadminand svnlook are considered server-side utilities—they are used on themachine where the repository resides to examine or modify aspects of the repository,and are in fact unable to perform tasks across a network. A commonmistake made by <strong>Subversion</strong> newcomers is trying to pass URLs (even “local”file:// ones) to these two programs.Present in the db/ subdirectory of your repository is the implementation of the versionedfilesystem. Your new repository's versioned filesystem begins life at revision 0, which isdefined to consist of nothing but the top-level root (/) directory. Initially, revision 0 also hasa single revision property, svn:date, set to the time at which the repository was created.Now that you have a repository, it's time to customize it.While some parts of a <strong>Subversion</strong> repository—such as the configuration filesand hook scripts—are meant to be examined and modified manually, youshouldn't (and shouldn't need to) tamper <strong>with</strong> the other parts of the repository“by hand.” The svnadmin tool should be sufficient for any changes necessaryto your repository, or you can look to third-party tools (such as Berkeley DB'stool suite) for tweaking relevant subsections of the repository. Do not attemptmanual manipulation of your version control history by poking and proddingaround in your repository's data store files!129

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

Saved successfully!

Ooh no, something went wrong!