You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ryan Schmidt <su...@ryandesign.com> on 2014/03/31 02:51:17 UTC

Import history from a second repository

I’ve been developing a new feature of a public project in secret, in my own private Subversion repository. It’s almost entirely new code in a new directory. There’s only one file that’s based on an existing file, and it’s been heavily rewritten.

There will come a time when I will want to publish this new code to the project’s public Subversion repository. At that time, I could export the code from my private repository and import it to the public one, but this would lose my history. Is there a way to preserve the history — replay the revisions in order somehow? Other developers of this public project seem to be doing so, but I believe they are making their modifications locally in git clones of the public Subversion repository, and then using git-svn to later commit the revisions to the public Subversion repository. I have not used git-svn and am not comfortable using git which is why I did not attempt this method.

My private repository is not an svnsync’d copy of the public repository; it’s just an empty repository with my code in it. I don’t have administrative access to the public repository so I cannot “svnadmin load” anything, nor would I want to import the revisions verbatim: for example, I would not want the original commit date and commit author to be preserved; the commit date should be the date when I publish to the public repository, and the author should be my id in the public repository, as with any other of my commits.


RE: Import history from a second repository

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Daniel Shahaf [mailto:d.s@daniel.shahaf.name]
> Sent: dinsdag 1 april 2014 09:35
> To: Nico Kadel-Garcia
> Cc: Ryan Schmidt; Subversion Users
> Subject: Re: Import history from a second repository
> 
> Nico Kadel-Garcia wrote on Sun, Mar 30, 2014 at 22:23:22 -0400:
> > On Sun, Mar 30, 2014 at 8:51 PM, Ryan Schmidt
> > <su...@ryandesign.com> wrote:
> > > I've been developing a new feature of a public project in secret, in
my
> own private Subversion repository. It's almost entirely new code in a new
> directory. There's only one file that's based on an existing file, and
it's been
> heavily rewritten.
> > >
> > > There will come a time when I will want to publish this new code to
the
> project's public Subversion repository. At that time, I could export the
code
> from my private repository and import it to the public one, but this would
> lose my history. Is there a way to preserve the history -- replay the
revisions
> in order somehow? Other developers of this public project seem to be doing
> so, but I believe they are making their modifications locally in git
clones of the
> public Subversion repository, and then using git-svn to later commit the
> revisions to the public Subversion repository. I have not used git-svn and
am
> not comfortable using git which is why I did not attempt this method.
> >
> > The git-svn toolkit actually works well for this. It's vital for
> > environments where you want to record changes locally and don't have
> > write access to the shared repository. I've been hesitant to mention
> > this sort of approach to avoid irritating our core Subversion
> > developers, but it's been invaluable to some of my work.
> 
> For the record, the Subversion developers don't think that svn is the
> hammer to every nail.  Some problems are better solved by rsync or git
> or tar, and when such a problem comes around, "Subversion is not the
> right tool for the job" is a perfectly acceptable answer.

With a bit of trickery you can use a combination of svnrdump (and maybe
svndumpfilter) to replay simple changes... (I performed a similar trick
recently when I separated a project that was initiated as part of another
project). But Subversion wasn't designed to do this for you.
(+1 on the "Subversion is not the right tool for the job")

In the past I heard quite successful stories about using git (and before
that: svk) to perform independent development against a Subversion
repository... But in general I would recommend using a public (or private)
branch in the same repository.

	Bert


Re: Import history from a second repository

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Nico Kadel-Garcia wrote on Sun, Mar 30, 2014 at 22:23:22 -0400:
> On Sun, Mar 30, 2014 at 8:51 PM, Ryan Schmidt
> <su...@ryandesign.com> wrote:
> > I've been developing a new feature of a public project in secret, in my own private Subversion repository. It's almost entirely new code in a new directory. There's only one file that's based on an existing file, and it's been heavily rewritten.
> >
> > There will come a time when I will want to publish this new code to the project's public Subversion repository. At that time, I could export the code from my private repository and import it to the public one, but this would lose my history. Is there a way to preserve the history -- replay the revisions in order somehow? Other developers of this public project seem to be doing so, but I believe they are making their modifications locally in git clones of the public Subversion repository, and then using git-svn to later commit the revisions to the public Subversion repository. I have not used git-svn and am not comfortable using git which is why I did not attempt this method.
> 
> The git-svn toolkit actually works well for this. It's vital for
> environments where you want to record changes locally and don't have
> write access to the shared repository. I've been hesitant to mention
> this sort of approach to avoid irritating our core Subversion
> developers, but it's been invaluable to some of my work.

For the record, the Subversion developers don't think that svn is the
hammer to every nail.  Some problems are better solved by rsync or git
or tar, and when such a problem comes around, "Subversion is not the
right tool for the job" is a perfectly acceptable answer.

Re: Import history from a second repository

Posted by Nico Kadel-Garcia <nk...@gmail.com>.
On Sun, Mar 30, 2014 at 8:51 PM, Ryan Schmidt
<su...@ryandesign.com> wrote:
> I've been developing a new feature of a public project in secret, in my own private Subversion repository. It's almost entirely new code in a new directory. There's only one file that's based on an existing file, and it's been heavily rewritten.
>
> There will come a time when I will want to publish this new code to the project's public Subversion repository. At that time, I could export the code from my private repository and import it to the public one, but this would lose my history. Is there a way to preserve the history -- replay the revisions in order somehow? Other developers of this public project seem to be doing so, but I believe they are making their modifications locally in git clones of the public Subversion repository, and then using git-svn to later commit the revisions to the public Subversion repository. I have not used git-svn and am not comfortable using git which is why I did not attempt this method.

The git-svn toolkit actually works well for this. It's vital for
environments where you want to record changes locally and don't have
write access to the shared repository. I've been hesitant to mention
this sort of approach to avoid irritating our core Subversion
developers, but it's been invaluable to some of my work.

> My private repository is not an svnsync'd copy of the public repository; it's just an empty repository with my code in it. I don't have administrative access to the public repository so I cannot "svnadmin load" anything, nor would I want to import the revisions verbatim: for example, I would not want the original commit date and commit author to be preserved; the commit date should be the date when I publish to the public repository, and the author should be my id in the public repository, as with any other of my commits.

Well, I think your merge difficulty started right there. Can you
refactor the  changes of your current file against the master
repository file, and isolate them to a set of well organized changes?
Then manually import those changes into a git-svn based repository?

RE: Import history from a second repository

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Daniel Shahaf [mailto:d.s@daniel.shahaf.name]
> Sent: dinsdag 1 april 2014 09:43
> To: Ryan Schmidt
> Cc: Subversion Users
> Subject: Re: Import history from a second repository
> 
> Ryan Schmidt wrote on Sun, Mar 30, 2014 at 19:51:17 -0500:
> > I’ve been developing a new feature of a public project in secret, in
> > my own private Subversion repository. It’s almost entirely new code in
> > a new directory. There’s only one file that’s based on an existing
> > file, and it’s been heavily rewritten.
> >
> 
> You might be interested in reading on how Mike Pilato prefixed a few
> thousand revisions to an existing repository:
> https://svn.apache.org/repos/asf/subversion/README
> 
> You might be able to do something similar by dumping your repository,
> tweaking the paths, and using 'svnrdump load'.  (Not sure how that
> handles svn:date --- whether it tries to set them, and what to; in your
> case you'd want it to let the server set it to the current time, as it
> does for ordinary commits.)

It tries to set svn:date and svn:author...
(Note that I just added a function to support dropping these properties for 1.9... See other mail)

	Bert


Re: Import history from a second repository

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Ryan Schmidt wrote on Sun, Mar 30, 2014 at 19:51:17 -0500:
> I’ve been developing a new feature of a public project in secret, in
> my own private Subversion repository. It’s almost entirely new code in
> a new directory. There’s only one file that’s based on an existing
> file, and it’s been heavily rewritten.
> 

You might be interested in reading on how Mike Pilato prefixed a few
thousand revisions to an existing repository:
https://svn.apache.org/repos/asf/subversion/README

You might be able to do something similar by dumping your repository,
tweaking the paths, and using 'svnrdump load'.  (Not sure how that
handles svn:date --- whether it tries to set them, and what to; in your
case you'd want it to let the server set it to the current time, as it
does for ordinary commits.)

Compared to git-svn, each approach has its pros and cons.  For example,
git-svn doesn't support property changes, but svnrdump doesn't give you
a local preview.

Daniel

> There will come a time when I will want to publish this new code to
> the project’s public Subversion repository. At that time, I could
> export the code from my private repository and import it to the public
> one, but this would lose my history. Is there a way to preserve the
> history — replay the revisions in order somehow? Other developers of
> this public project seem to be doing so, but I believe they are making
> their modifications locally in git clones of the public Subversion
> repository, and then using git-svn to later commit the revisions to
> the public Subversion repository. I have not used git-svn and am not
> comfortable using git which is why I did not attempt this method.
> 
> My private repository is not an svnsync’d copy of the public
> repository; it’s just an empty repository with my code in it. I don’t
> have administrative access to the public repository so I cannot
> “svnadmin load” anything, nor would I want to import the revisions
> verbatim: for example, I would not want the original commit date and
> commit author to be preserved; the commit date should be the date when
> I publish to the public repository, and the author should be my id in
> the public repository, as with any other of my commits.
>