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 Administrationthat you've made to your versioned data over time. Use the svnadmin dump command togenerate the dump data, and svnadmin load to populate a new repository <strong>with</strong> it. Thegreat thing about the human-readability aspect of the dump format is that, if you aren'tcareless about it, you can manually inspect and modify it. Of course, the downside is that ifyou have three years' worth of repository activity encapsulated in what is likely to be a verylarge dump file, it could take you a long, long time to manually inspect and modify it.That's where svndumpfilter becomes useful. This program acts as a path-based filter forrepository dump streams. Simply give it either a list of paths you wish to keep or a list ofpaths you wish to not keep, and then pipe your repository dump data through this filter. Theresult will be a modified stream of dump data that contains only the versioned paths you(explicitly or implicitly) requested.Let's look at a realistic example of how you might use this program. Earlier in this chapter(see the section called “Planning Your Repository Organization”), we discussed the processof deciding how to choose a layout for the data in your repositories—using one repositoryper project or combining them, arranging stuff <strong>with</strong>in your repository, and so on. Butsometimes after new revisions start flying in, you rethink your layout and would like tomake some changes. A common change is the decision to move multiple projects that aresharing a single repository into separate repositories for each project.Our imaginary repository contains three projects: calc, calendar, and spreadsheet.They have been living side-by-side in a layout like this:/calc/trunk/branches/tags/calendar/trunk/branches/tags/spreadsheet/trunk/branches/tags/To get these three projects into their own repositories, we first dump the whole repository:$ svnadmin dump /var/svn/repos > repos-dumpfile* Dumped revision 0.* Dumped revision 1.* Dumped revision 2.* Dumped revision 3.…$Next, run that dump file through the filter, each time including only one of our top-level directories.This results in three new dump files:$ svndumpfilter include calc < repos-dumpfile > calc-dumpfile…$ svndumpfilter include calendar < repos-dumpfile > cal-dumpfile…$ svndumpfilter include spreadsheet < repos-dumpfile > ss-dumpfile…$At this point, you have to make a decision. Each of your dump files will create a valid repository,but will preserve the paths exactly as they were in the original repository. This144

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

Saved successfully!

Ooh no, something went wrong!