Re: Importing from a working copy ... bad idea?
From: Ryan Schmidt <subversion-2019_at_ryandesign.com>
Date: Thu, 18 Apr 2019 16:07:58 -0500
On Apr 18, 2019, at 15:40, Mun Johl wrote:
> On Thu, Apr 18, 2019 at 01:30 PM PDT, Ryan Schmidt wrote:
>>> Since many files will be renamed
Oh. Yes, certainly, in that case, you have disconnected the history, by using a non-Subversion command to copy the file out of the working copy in the first place. But if you use svnmucc to copy a file from one URL in a repository to another URL in that same repository, its history will be preserved. If you're only using svnmucc to "put" a bunch of individual files, that's no better than (and much more complicated than) just using "svn import".
In this whole thread we are presuming that you have a single repository containing multiple projects. In that case, you can preserve history. But another approach is to use a separate repository for each project, and if you're going to do that, you won't be preserving any history. While Subversion users freely use both approaches, it's worth seriously considering the single-project-per-repository approach, since that's what's used in git. Subversion allows you the freedom to decide where to put your trunk/branches/tags directories -- either at the top level, or underneath directories for each project, or any other arbitrary layout you want. Git does not allow you that freedom. You may not want to use git today, but maybe you will want to convert your repository to git eventually, and if so, it will be easier to convert single-project Subversion repositories than it will be to write a complicated set of svn2git rules to split multiple-project repositories. (We did it successfully with the MacPorts Subversion >>> I was thinking I would do all of the manipulation via linux commands and
The only difficult part would be getting a single working copy that contains all of the files that you want to copy. If your repository is arranged like this:
/projectA
and you want to make a new project trunk and copy files from projectA's trunk and projectB's trunk into it, you probably don't want to also check out all of the branches and tags of each project. You could start by checking out only the top-level directories:
svn checkout https://url/to/repository --depth immediates wc
Then you could update the trunks of the projects you want to copy files from:
svn update projectA/trunk projectB/trunk
Make a directory for your new project:
svn mkdir --parents newproject/trunk
You can "svn mkdir" any other directories you need in your new project's trunk, and you can "svn cp" files into it from the other projects as needed, and finally "svn commit" the whole thing.
|
This is an archived mail posted to the Subversion Users mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.