You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Guilherme de S. Pastore" <gu...@terra.com.br> on 2005/09/09 00:26:03 UTC

copy between repos works and doesn't work

Hi there,

I've just got this bug through the Debian Bug Tracking System, confirmed
it and am, hence, forwarding it here =)

The issue is pretty simple: copying files between two checkouts of
different repositories apparently works at first, and only fails at
commit time. For example:

$ svn cp bar-co/version.py foo-co/
A         foo-co/version.py

$ svn commit
Adding         version.py
svn: Commit failed (details follow):
svn: Source url 'file:///home/gpastore/svn/bar/version.py' is from
different repository
svn: Your commit message was left in a temporary file:
svn:    '/home/gpastore/svn/foo-co/svn-commit.tmp'

It would be really great if copying files from one repository to another
were supported, but in case you don't agree, it should at least throw an
error at the user's face, perhaps even "Sorry, copying between different
repositories is not supported", or whatever.

Please, let me know what you think about it =) And please, if possible,
keep 327281-forwarded@bugs.debian.org in the Cc:, so replies are
archived in the Debian BTS.

Regards,

-- 
Guilherme de S. Pastore (fatalerror)
<gu...@terra.com.br>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: copy between repos works and doesn't work

Posted by "Daniel L. Rall" <dl...@finemaltcoding.com>.
On Thu, 15 Sep 2005, Guilherme de S. Pastore wrote:

> package subversion
> forwarded 327281 http://subversion.tigris.org/issues/show_bug.cgi?id=2404
> quit
> 
> Em Qui, 2005-09-15 às 09:51 -0700, Daniel Rall escreveu:
> > http://subversion.tigris.org/issues/show_bug.cgi?id=2404
> 
> Thanks a lot! =D

I've committed an implementation of Peter's suggested input check (r16141)
to disallow cross repository copy before copying of the resource can occur
on the file system.  For the downstream bug tracker:  This fix ought to be
available no later than Subversion 1.3.0.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: copy between repos works and doesn't work

Posted by "Guilherme de S. Pastore" <gu...@terra.com.br>.
package subversion
forwarded 327281 http://subversion.tigris.org/issues/show_bug.cgi?id=2404
quit

Em Qui, 2005-09-15 às 09:51 -0700, Daniel Rall escreveu:
> http://subversion.tigris.org/issues/show_bug.cgi?id=2404

Thanks a lot! =D

-- 
Guilherme de S. Pastore (fatalerror)
<gu...@terra.com.br>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: copy between repos works and doesn't work

Posted by Daniel Rall <dl...@finemaltcoding.com>.
On Wed, 14 Sep 2005, Guilherme de S. Pastore wrote:

> Em Qua, 2005-09-14 às 14:55 -0700, Daniel Rall escreveu:
> > Guilherme, did you have a chance to open a SVN issue for this yet?
> 
> Not yet. =( If you can, you're more than welcome to do it =)

http://subversion.tigris.org/issues/show_bug.cgi?id=2404

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: copy between repos works and doesn't work

Posted by "Guilherme de S. Pastore" <gu...@terra.com.br>.
Em Qua, 2005-09-14 às 14:55 -0700, Daniel Rall escreveu:
> Guilherme, did you have a chance to open a SVN issue for this yet?

Not yet. =( If you can, you're more than welcome to do it =)

Regards,

-- 
Guilherme de S. Pastore (fatalerror)
<gu...@terra.com.br>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: copy between repos works and doesn't work

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Mon, 19 Sep 2005, Daniel Rall wrote:

> On Mon, 19 Sep 2005, Peter N. Lundblad wrote:
>
> I don't think the semantic would be worth preserving.  When someone runs
> 'svn cp wcA/foo wcB/bar', they want the full history.  The fact that the
> convenience implementation didn't copy the entire history would be more
> of an annoyance than a desired behavior, but possibly less annoying than
> the error message they're going get with 1.3.0.  I look at it more as a
> step in the right direction.  That said, I'd rather have the full "copy
> with history" than the incremental step, but it's significantly more effort,
> unless implemented in some cheesy fashion like a series of commits of every
> revision of a resource (which would not preserve as much meta data as might
> otherwise be possible).
>
Since we don't know a priori what exactly will be the semantics of
inter-repository copying, we don't know what semantics we will have to
make backwards compatible in the future.  I don't think the minor user
convenience (as I see it) this would add is worth it.

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: copy between repos works and doesn't work

Posted by "Dale R. Worley" <dw...@pingtel.com>.
On Mon, 2005-09-19 at 13:53 -0700, Daniel Rall wrote:
> I don't think the semantic would be worth preserving.  When someone runs
> 'svn cp wcA/foo wcB/bar', they want the full history.

The problem with checking for cross-repository copies isn't in regard to
"svn copy", it is in regard to "svn merge" -- the latter *will* make
copies.  Since our project's current working style depends on cross-
repository "svn merge" working (with a post-processing step to remove
history), I hope the Subversion developers enlarge Subversion's behavior
rather than contracting it.

Dale



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: copy between repos works and doesn't work

Posted by Daniel Rall <dl...@finemaltcoding.com>.
On Mon, 19 Sep 2005, Peter N. Lundblad wrote:

> On Mon, 19 Sep 2005, Daniel Rall wrote:
...
> > Sure, this wouldn't be a deep copy (with history), but a convenience for
> > shallow copies which avoids a 'svn add' after shell-level 'cp'.
> >
> And if we someday want to implement true copies between repositories,
> don't we have "painted ourselves into a corner" then? We would have to
> preserve this semantic, just to avoid the user typing a command now.

I don't think the semantic would be worth preserving.  When someone runs
'svn cp wcA/foo wcB/bar', they want the full history.  The fact that the
convenience implementation didn't copy the entire history would be more
of an annoyance than a desired behavior, but possibly less annoying than
the error message they're going get with 1.3.0.  I look at it more as a
step in the right direction.  That said, I'd rather have the full "copy
with history" than the incremental step, but it's significantly more effort,
unless implemented in some cheesy fashion like a series of commits of every
revision of a resource (which would not preserve as much meta data as might
otherwise be possible).

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: copy between repos works and doesn't work

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Mon, 19 Sep 2005, Daniel Rall wrote:

> On Mon, 19 Sep 2005, Peter N. Lundblad wrote:
>
> > On Mon, 19 Sep 2005, Daniel L. Rall wrote:
> >
> > > On Thu, 15 Sep 2005, Dale R. Worley wrote:
> > > ...
> > > > It is an annoyance that cross-repository copies do not work, but once
> > > > you have done a cross-repository copy (or merge!), you can fix your WC
> > > > so that it can be checked in using the attached script.  What it does is
> > > > edit the .svn/entries files so that all copies forget that they are
> > > > copies and think that they're new additions.  It's not productized, but
> > > > it has been reliable for me.
> > >
> > > I was wondering if this shouldn't be the default behavior for WC to WC
> > > copy operations across different repositories.  This would be a big change
> > > from the current trunk behavior of completely disallowing this type of
> > > operation.
> >
> > Since copy is "add with history", I don't believe so.
>
> Sure, this wouldn't be a deep copy (with history), but a convenience for
> shallow copies which avoids a 'svn add' after shell-level 'cp'.
>
And if we someday want to implement true copies between repositories,
don't we have "painted ourselves into a corner" then? We would have to
preserve this semantic, just to avoid the user typing a command now.

Best,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: copy between repos works and doesn't work

Posted by Daniel Rall <dl...@finemaltcoding.com>.
On Mon, 19 Sep 2005, Peter N. Lundblad wrote:

> On Mon, 19 Sep 2005, Daniel L. Rall wrote:
> 
> > On Thu, 15 Sep 2005, Dale R. Worley wrote:
> > ...
> > > It is an annoyance that cross-repository copies do not work, but once
> > > you have done a cross-repository copy (or merge!), you can fix your WC
> > > so that it can be checked in using the attached script.  What it does is
> > > edit the .svn/entries files so that all copies forget that they are
> > > copies and think that they're new additions.  It's not productized, but
> > > it has been reliable for me.
> >
> > I was wondering if this shouldn't be the default behavior for WC to WC
> > copy operations across different repositories.  This would be a big change
> > from the current trunk behavior of completely disallowing this type of
> > operation.
>
> Since copy is "add with history", I don't believe so.

Sure, this wouldn't be a deep copy (with history), but a convenience for
shallow copies which avoids a 'svn add' after shell-level 'cp'.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: copy between repos works and doesn't work

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Mon, 19 Sep 2005, Daniel L. Rall wrote:

> On Thu, 15 Sep 2005, Dale R. Worley wrote:
> ...
> > It is an annoyance that cross-repository copies do not work, but once
> > you have done a cross-repository copy (or merge!), you can fix your WC
> > so that it can be checked in using the attached script.  What it does is
> > edit the .svn/entries files so that all copies forget that they are
> > copies and think that they're new additions.  It's not productized, but
> > it has been reliable for me.
>
> I was wondering if this shouldn't be the default behavior for WC to WC
> copy operations across different repositories.  This would be a big change
> from the current trunk behavior of completely disallowing this type of
> operation.
>
Since copy is "add with history", I don't believe so.

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: copy between repos works and doesn't work

Posted by "Daniel L. Rall" <dl...@finemaltcoding.com>.
On Thu, 15 Sep 2005, Dale R. Worley wrote:
...
> It is an annoyance that cross-repository copies do not work, but once
> you have done a cross-repository copy (or merge!), you can fix your WC
> so that it can be checked in using the attached script.  What it does is
> edit the .svn/entries files so that all copies forget that they are
> copies and think that they're new additions.  It's not productized, but
> it has been reliable for me.

I was wondering if this shouldn't be the default behavior for WC to WC
copy operations across different repositories.  This would be a big change
from the current trunk behavior of completely disallowing this type of
operation.


> #! /usr/bin/perl
> 
> # Remove indications that added files were copied in subversion
> # working copies.
> 
> # Default to operating on '.'.
> if ($#ARGV == -1) {
>     @ARGV = (".");
> }
> 
> # Find all the .svn directories.
> $command = "find " . join(' ', @ARGV) . " -name .svn |";
> open(FIND, $command) ||
>     die "Error executing '$command': $!\n";
> 
> while (<FIND>) {
>     chomp;
>     $entries_file = $_ . '/entries';
>     # Get the contents of the entries file.
>     open(ENTRIES, $entries_file) || die;
>     @entries = <ENTRIES>;
>     close ENTRIES;
>     # If the entries file mentions a copied file, process it.
>     if (grep(/copied="true"/, @entries) > 0)
>     {
> 	$new_file = $entries_file . ".tmp";
> 	$backup_file = $entries_file . "~";
> 	open(NEW, ">$new_file") || die;
> 	foreach $l (@entries) {
> 	    $l =~ s/copied="true"//;
> 	    $l =~ s/copyfrom-rev="\d+"//;
> 	    $l =~ s/copyfrom-url="[^"]+"//;
>             print NEW $l;
>         }
>         ($x, $x, $mode) = stat($entries_file);
>         chmod($mode, $new_file) || die;
>         rename($entries_file, $backup_file) || die;
>         rename($new_file, $entries_file) || die;
>         print "$entries_file updated.\n";
>     }
> }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: copy between repos works and doesn't work

Posted by "Dale R. Worley" <dw...@pingtel.com>.
> > > It would be really great if copying files from one repository to another
> > > were supported, but in case you don't agree, it should at least throw an
> > 

It is an annoyance that cross-repository copies do not work, but once
you have done a cross-repository copy (or merge!), you can fix your WC
so that it can be checked in using the attached script.  What it does is
edit the .svn/entries files so that all copies forget that they are
copies and think that they're new additions.  It's not productized, but
it has been reliable for me.

Dale


Re: copy between repos works and doesn't work

Posted by Daniel Rall <dl...@finemaltcoding.com>.
On Fri, 09 Sep 2005, Peter N. Lundblad wrote:

> 
> 
> On Thu, 8 Sep 2005, Guilherme de S. Pastore wrote:
> 
> > I've just got this bug through the Debian Bug Tracking System, confirmed
> > it and am, hence, forwarding it here =)
> >
> > The issue is pretty simple: copying files between two checkouts of
> > different repositories apparently works at first, and only fails at
> > commit time. For example:
> >
> > $ svn cp bar-co/version.py foo-co/
> > A         foo-co/version.py
> >
> > $ svn commit
> > Adding         version.py
> > svn: Commit failed (details follow):
> > svn: Source url 'file:///home/gpastore/svn/bar/version.py' is from
> > different repository
> > svn: Your commit message was left in a temporary file:
> > svn:    '/home/gpastore/svn/foo-co/svn-commit.tmp'
> >
> > It would be really great if copying files from one repository to another
> > were supported, but in case you don't agree, it should at least throw an
> 
> It would be great! :-)
 
I agree that this would be nice!  FWIW though, this is somewhat tricky to
implement with mod_dav and libsvn_ra_dav, which demand that not only the
destination scheme, host name, and port match, but that the path to the
repository also match.

I came across these issues recently while implementing a Subversion proxy
using Apache httpd.

> > error at the user's face, perhaps even "Sorry, copying between different
> > repositories is not supported", or whatever.
>
> This has changed on trunk as part of the addition of repository root URL
> to the .svn/entries file. Now the copy fails, but after the file was
> copied on the disk. A simple check could probably make it fail even before
> that happens. Would you mind opening an isue for this, and linking to this
> thread? (You could add your Debian issue address as a CC.)

Guilherme, did you have a chance to open a SVN issue for this yet?

- Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: copy between repos works and doesn't work

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.

On Thu, 8 Sep 2005, Guilherme de S. Pastore wrote:

> I've just got this bug through the Debian Bug Tracking System, confirmed
> it and am, hence, forwarding it here =)
>
> The issue is pretty simple: copying files between two checkouts of
> different repositories apparently works at first, and only fails at
> commit time. For example:
>
> $ svn cp bar-co/version.py foo-co/
> A         foo-co/version.py
>
> $ svn commit
> Adding         version.py
> svn: Commit failed (details follow):
> svn: Source url 'file:///home/gpastore/svn/bar/version.py' is from
> different repository
> svn: Your commit message was left in a temporary file:
> svn:    '/home/gpastore/svn/foo-co/svn-commit.tmp'
>
> It would be really great if copying files from one repository to another
> were supported, but in case you don't agree, it should at least throw an

It would be great! :-)

> error at the user's face, perhaps even "Sorry, copying between different
> repositories is not supported", or whatever.
>
This has changed on trunk as part of the addition of repository root URL
to the .svn/entries file. Now the copy fails, but after the file was
copied on the disk. A simple check could probably make it fail even before
that happens. Would you mind opening an isue for this, and linking to this
thread? (You could add your Debian issue address as a CC.)

Thanks,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org