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.

Repository Administrationchanged under that source repository subdirectory. There are some limitations to this support,though. First, you can't mirror multiple disjoint subdirectories of the source repositoryinto a single mirror repository—you'd need to instead mirror some parent directory that iscommon to both. Second, the filtering logic is entirely path-based, so if the subdirectoryyou are mirroring was renamed at some point in the past, your mirror would contain onlythe revisions since the directory appeared at the URL you specified. And likewise, if thesource subdirectory is renamed in the future, your synchronization processes will stop mirroringdata at the point that the source URL you specified is no longer valid.As far as user interaction <strong>with</strong> repositories and mirrors goes, it is possible to have a singleworking copy that interacts <strong>with</strong> both, but you'll have to jump through some hoops to makeit happen. First, you need to ensure that both the primary and mirror repositories have thesame repository UUID (which is not the case by default). See the section called “ManagingRepository UUIDs” later in this chapter for more about this.Once the two repositories have the same UUID, you can use svn switch <strong>with</strong> the --relocate option to point your working copy to whichever of the repositories you wish tooperate against, a process that is described in svn switch. There is a possible danger here,though, in that if the primary and mirror repositories aren't in close synchronization, a workingcopy up to date <strong>with</strong>, and pointing to, the primary repository will, if relocated to point toan out-of-date mirror, become confused about the apparent sudden loss of revisions it fullyexpects to be present, and it will throw errors to that effect. If this occurs, you can relocateyour working copy back to the primary repository and then either wait until the mirror repositoryis up to date, or backdate your working copy to a revision you know is present in thesync repository, and then retry the relocation.Finally, be aware that the revision-based replication provided by svnsync is onlythat—replication of revisions. Only information carried by the <strong>Subversion</strong> repository dumpfile format is available for replication. As such, svnsync has the same sorts of limitationsthat the repository dump stream has, and does not include such things as the hook implementations,repository or server configuration data, uncommitted transactions, or informationabout user locks on repository paths.Repository BackupDespite numerous advances in technology since the birth of the modern computer, onething unfortunately rings true <strong>with</strong> crystalline clarity—sometimes things go very, very awry.Power outages, network connectivity dropouts, corrupt RAM, and crashed hard drives arebut a taste of the evil that Fate is poised to unleash on even the most conscientious administrator.And so we arrive at a very important topic—how to make backup copies of your repositorydata.There are two types of backup methods available for <strong>Subversion</strong> repository administrators—fulland incremental. A full backup of the repository involves squirreling away in onesweeping action all the information required to fully reconstruct that repository in the eventof a catastrophe. Usually, it means, quite literally, the duplication of the entire repositorydirectory (which includes either a Berkeley DB or FSFS environment). Incremental backupsare lesser things: backups of only the portion of the repository data that has changed sincethe previous backup.As far as full backups go, the naïve approach might seem like a sane one, but unless youtemporarily disable all other access to your repository, simply doing a recursive directorycopy runs the risk of generating a faulty backup. In the case of Berkeley DB, the documentationdescribes a certain order in which database files can be copied that will guarantee avalid backup copy. A similar ordering exists for FSFS data. But you don't have to implementthese algorithms yourself, because the <strong>Subversion</strong> development team has alreadydone so. The svnadmin hotcopy command takes care of the minutia involved in making ahot backup of your repository. And its invocation is as trivial as the Unix cp or Windowscopy operations:$ svnadmin hotcopy /var/svn/repos /var/svn/repos-backup152

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

Saved successfully!

Ooh no, something went wrong!