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 Administrationby renaming it to something like repos.BROKEN) and then restore your latest backup of it.Then, send an email to the <strong>Subversion</strong> users mailing list (at) describing your problem in detail. Data integrity isan extremely high priority to the <strong>Subversion</strong> developers.Migrating Repository Data ElsewhereA <strong>Subversion</strong> filesystem has its data spread throughout files in the repository, in a fashiongenerally understood by (and of interest to) only the <strong>Subversion</strong> developers themselves.However, circumstances may arise that call for all, or some subset, of that data to becopied or moved into another repository.<strong>Subversion</strong> provides such functionality by way of repository dump streams. A repositorydump stream (often referred to as a “dump file” when stored as a file on disk) is a portable,flat file format that describes the various revisions in your repository—what was changed,by whom, when, and so on. This dump stream is the primary mechanism used to marshalversioned history—in whole or in part, <strong>with</strong> or <strong>with</strong>out modification—between repositories.And <strong>Subversion</strong> provides the tools necessary for creating and loading these dumpstreams: the svnadmin dump and svnadmin load subcommands, respectively.While the <strong>Subversion</strong> repository dump format contains human-readable portionsand a familiar structure (it resembles an RFC 822 format, the same typeof format used for most email), it is not a plain-text file format. It is a binary fileformat, highly sensitive to meddling. For example, many text editors will corruptthe file by automatically converting line endings.There are many reasons for dumping and loading <strong>Subversion</strong> repository data. Early in<strong>Subversion</strong>'s life, the most common reason was due to the evolution of <strong>Subversion</strong> itself.As <strong>Subversion</strong> matured, there were times when changes made to the backend databaseschema caused compatibility issues <strong>with</strong> previous versions of the repository, so users hadto dump their repository data using the previous version of <strong>Subversion</strong> and load it into afreshly created repository <strong>with</strong> the new version of <strong>Subversion</strong>. Now, these types of schemachanges haven't occurred since <strong>Subversion</strong>'s 1.0 release, and the <strong>Subversion</strong> developerspromise not to force users to dump and load their repositories when upgrading betweenminor versions (such as from 1.3 to 1.4) of <strong>Subversion</strong>. But there are still other reasons fordumping and loading, including re-deploying a Berkeley DB repository on a new OS orCPU architecture, switching between the Berkeley DB and FSFS backends, or (as we'llcover later in this chapter in the section called “Filtering Repository History”) purging versioneddata from repository history.The <strong>Subversion</strong> repository dump format describes versioned repositorychanges only. It will not carry any information about uncommitted transactions,user locks on filesystem paths, repository or server configuration customizations(including hook scripts), and so on.Whatever your reason for migrating repository history, using the svnadmin dump andsvnadmin load subcommands is straightforward. svnadmin dump will output a range ofrepository revisions that are formatted using <strong>Subversion</strong>'s custom filesystem dump format.The dump format is printed to the standard output stream, while informative messages areprinted to the standard error stream. This allows you to redirect the output stream to a filewhile watching the status output in your terminal window. For example:$ svnlook youngest myrepos26$ svnadmin dump myrepos > dumpfile* Dumped revision 0.* Dumped revision 1.140

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

Saved successfully!

Ooh no, something went wrong!