13.07.2015 Views

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 1 ■ SAVING YOURSELF EFFORT1-12. Subversion: Dividing RepositoriesYou can keep going for a long time with the basic stuff with version control—as long as you’reremembering to commit all your changes, you’re fine. However, eventually you may need to messaround a bit with your repositories. Dividing, branching, and merging repositories are all things thatmay be necessary at some point and are straightforward with Subversion.So, you’ve decided that your single repository would be better off as two repositories. Maybe youwant to divide the config files from your scripts or from your notes. Before you start, make sure allworking changes are committed (or you’ll lose them when tidying up afterward) and that no one else isgoing to commit to the repository while you’re moving things around.To get a list of the directories in the repository and decide what to move, type the following:svn list file:///path/to/repositoryThen use this to get a dump of the repository (which may take a little while if you have a largerepository):svnadmin dump /path/to/repos > repos.dump■ Note Although svn will use http:// or file:// repositories, svnadmin takes only a plain path. So, you can’tuse it on a repository that you have only remote access to. You have to be logged in on the machine where therepository actually lives.Next, create the directory for your new repository:svnadmin create /path/to/newreposThe tool svndumpfilter allows you to choose a particular directory or directories. The command youwant is as follows:cat repos.dump | svndumpfilter include testdir | svnadmin load newreposThis pipes the old repository through svndumpfilter, tells the filter to include only the testdirdirectory, and then loads it into the new repository. (You can specify multiple directories if required.)All that’s left to do after this is to tidy up. If /local/checkout/testdir is where your existing workingcopy of testdir is living, use this:rm repos.dumpcd /local/checkout/svn delete testdirsvn commit -m "Deleting testdir from repository"svn checkout /path/to/newrepos/testdir testdirThis deletes the dumpfile, deletes the migrated directory from the old repository, and checks aworking copy out from the new repository.14Download at WoweBook.Com

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

Saved successfully!

Ooh no, something went wrong!