[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: copy between repos works and doesn't work

From: Daniel L. Rall <dlr_at_finemaltcoding.com>
Date: 2005-09-19 09:14:06 CEST

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
Received on Mon Sep 19 09:15:04 2005

This is an archived mail posted to the Subversion Dev mailing list.