Mike is currently… getting whipped at Halo |
|||||||||||||||||||||||||||||||||||||||||||||||||||
[ subversion book ] obligatory book plug [ syndicate ] rss 2.0 feed for boy meets world [ contact ] drop me a line [ about ] this is mike mason's weblog [ eskimoman.net ] original web pages |
Wed, 19 Oct 2005This is an archived blog post. I've switched to using WordPress as my blogging software and have not migrated all my old posts. I believe strongly in not letting an old link die, so this page continues to work. Please do visit mikemason.ca/blog to read newer posts. Splitting, Merging, and Organizing a Subversion RepositoryWhen setting up Subversion within an organization, folks will often ask “How many repositories should I create?”—my advice is to just create one repository until you have a concrete need for more. I take this approach because it’s easy to split an existing repository into two. I also remind people it’s not the end of the world if they create multiple repositories and then they need to merge them, because Subversion has good support for splitting, merging, and reorganizing repositories. I’ve never really gone into any detail on how you actually do this stuff, but since I recently needed to merge two repositories I thought I’d share the technique I used. Splitting a repositoryFirst off make sure you tell everyone you’re going to split the repository. The ideal situation is where everyone can check in, go home for the night, leave you to organize stuff, and then come in the next day and start on something fresh. If people can’t commit all their changes you may need to help them relocate their working copy. Once everyone’s committed their changes, close down network access to your repository to be sure no-one’s committing further changes. This might be overkill depending on your situation, but it’s nice to be safe. Next, back up your repository using svnadmin dump to create a dump file. A dump file is a portable representation of a Subversion repository and something you might be using for backups already. We’re going to load the dump file into a new repository, using svndumpfilter to select just the directories we wish to move to the new repository. A typical transcript might look like this: [mgm@penguin temp]$ svnadmin dump /home/svnroot/log4rss > log4rss.dump * Dumped revision 0. * Dumped revision 1. : : : * Dumped revision 37. * Dumped revision 38. [mgm@penguin temp]$ mkdir tools-repos [mgm@penguin temp]$ svnadmin create tools-repos [mgm@penguin temp]$ cat log4rss.dump | svndumpfilter include log4rss/trunk/tools | svnadmin load tools-repos Including prefixes: '/log4rss/trunk/tools' Revision 0 committed as 0. Revision 1 committed as 1. Revision 2 committed as 2. : : : <<< Started new transaction, based on original revision 38 ------- Committed revision 38 >>> In the above sample, I dumped the Log4rss repository into a file called At this point, I can make the new repository available and tell developers where to find it. It’s probably also wise to delete the Merging two repositoriesMy current project recently moved from Chicago to Calgary. For a while we had two teams running, using separate Subversion repositories. When everything moved to Calgary, we needed to merge the Chicago team’s code into our repository. We didn’t want to just import the files, we wanted to include historical information too. We created a dump file of the Chicago team’s repository and loaded it straight into our repository using Organizing a repositoryOnce we’d loaded the Chicago code into our repository we used TortoiseSVN’s graphical repository browser to move the new stuff into our existing directory tree. Here’s a screenshot of the repo browser—it’s a great tool for this kind of thing and made reorganization very simple. We just used the “rename” command to move everything around in the repository, and once done we all checked out the newly organized directory tree and continued working. Posted 16:08, 19 Oct 2005. [ permalink ] |
[ tim bacon ] musings of an xp coach [ ian bourke ] enhancing core competencies since 1976 [ martin fowler ] a cross between a blog and a wiki [ alan francis ] agile != good [ paul hammant ] part of the problem… [ darren hobbs ] the blog formerly known as pushing the envelope [ mike roberts ] on life and technology [ chris stevenson ] skizz-biz [ joe walnes ] joe's new jelly [ rob baillie ] oracle |
|||||||||||||||||||||||||||||||||||||||||||||||||
Registered plugins: SmartyPants, antispam, bloglinks (v0.2), calendar (v0+6i), pluginfo (v1.0), and userstatus (v0.1) |