2

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 thing does svn support local repositories like bzr

CharlesB
  • 86,532
  • 28
  • 194
  • 218
jspeshu
  • 1,211
  • 3
  • 12
  • 20

3 Answers3

4

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.

gotgenes
  • 38,661
  • 28
  • 100
  • 128
  • i have it already imported to my machine and changed a lot of things here – jspeshu Dec 17 '10 at 06:40
  • 2
    You should not have made the changes to files in your SVN checkout; those changes will not be seen by bzr. However, you can just copy the modified files (using `cp` or the file manager) into your bzr branch, *after* you do the `bzr svn-import` command. And make sure to do the import in a new directory; *do not use `bzr svn-import` within the directory of your SVN checkout*! – gotgenes Dec 17 '10 at 06:52
3

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.

wkl
  • 77,184
  • 16
  • 165
  • 176
  • but i have the already imported the repository using svn and changed to much (i don't want o loose my changes) so i changed it locally – jspeshu Dec 17 '10 at 06:47
  • I was using bzr-svn for some time. Eventually all the work I did was migrated to bzr the whole way, so that we're not running any Subversion servers anymore, thankfully. – Michael Trausch Dec 17 '10 at 06:59
0

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
Sam Hartsfield
  • 1,441
  • 10
  • 15