i have imported(checkout) some read-only repository on the Internet
$ svn co http://some.repo/at/somesite read-only
now i want to work on this read-only (also i have better experience with bzr than svn) ,so i want to change this repository from svn to a bzr repository for working locally how can i do that and one additional th开发者_如何转开发ing does svn support local repositories like bzr
You shouldn't use Subversion directly to checkout the code. Use Bazaar to do it. For example
bzr svn-import http://feedparser.googlecode.com/svn/ feedparser
cd feedparser
bzr branch trunk mybranch
cd mybranch
bzr checkout
# hack...
Check the documentation, the Subversion Migration page on the bzr wiki, and bzr help svn-import
for more details.
To address your second question
does svn support local repositories like bzr
Subversion is based off of a server-client model, whereas in distributed VCSes like git, bzr, and Mercurial, it's all sort of rolled into one. You can have a Subversion server running locally, however, an SVN repository should be served by one, and only one SVN server. With a distributed VCS, you clone an entire repository (or at least a branch, in bzr's case), meaning that you have all the data and metadata necessary for you to serve up your clone and have other people clone from you. Unlike distributed VCSes, you do not create an entire copy of the repository locally when you do svn checkout
; you only create local working copies of the repository, which is the files under revision control and some (but not all) of the metadata. A working local copy of a SVN repository is insufficient to act as a repository itself; you can not put that working copy on a server and let other people do checkouts from it.
Have you looked at using bzr-svn which is a tool for working with SVN repositories by checking out using bazaar?
You will want to take a look at the documentation for bzr-svn, which describes how to simply check out from SVN with bzr.
Also, for SVN, you would have to set up a local SVN server/repo on your machine, not as simple as git/mercurial/bazaar.
Bazaar can actually operate directly on Subversion working copies. While it may be preferable to checkout/clone to a Bazaar repository (using bzr checkout
or bzr clone
; there is no need to use svn-import
), most Bazaar commands should work as if you had done a "lightweight checkout". To handle this, Bazaar create a "bzr" directory in the ".svn" directory.
However, that doesn't allow local commits, and so it doesn't work in this situation. Fortunately, you can move to a Bazaar checkout by cloning the existing repository (or do this directly from the master SVN repository):
# you can clone from the old working copy directory:
bzr clone old-svn-working-copy new-bzr-branch-directory
# or from the original repository:
bzr clone http://some.repo/at/somesite new-bzr-branch-directory
then you can move over any uncommitted changes you made like this:
cd new-bzr-branch-directory
bzr merge --uncommitted ../old-svn-working-copy
精彩评论