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

Re: Subversion Copy (copied_from)

From: B. Smith-Mannschott <benpsm_at_gmail.com>
Date: 2007-01-23 20:42:24 CET

On Jan 23, 2007, at 19:16, Quentin Narferao wrote:

> I'm not entirely sure if this is a bug but it seems to me that it
> might be.
>
> [repos]/dir1/dir2/file.txt
>
> where dir1 is copied or moved to: /dirX
> and the resulting subdirectories are also copied/moved so that the
> new access would be:
> [repos]/dirX/dir2/file.txt
>
> In the repository dirX will return the fact that it was copied
> (even if it was moved--that's possibly another bug)

This is normal behavior. The move (aka rename) operation is
implemented as copy + delete. See also <http://subversion.tigris.org/
issues/show_bug.cgi?id=898>

> but everything below (dir2 and file.txt) will not report the fact
> that they were copied (or moved) from their original location under
> [repos]/dir1. This is according to fs.copied_from API (as seen
> through ViewVC and even the TortoiseSVN client show log feature).

That's because they have not been moved or copied. The only thing
that's happened is that dir1 has been renamed (to dirX).

> First of all, is this intended or is this a bug? I cannot see a
> reason that the files underneath the primary directory being copied/
> moved would gain a new revision number but not have the copied_from
> field present--especially given the fact that the primary directory
> that was the argument for the copy/move did receive this field.

The revision number applies to the repository as a whole. The
revision number next to the entries shown in status is the revision
of that item's last modification.

   alden:/tmp/r bsmith$ svn status --verbose
                 0 0 ? .
                 1 1 bsmith a
                 1 1 bsmith a/b
                 1 1 bsmith a/b/c

   alden:/tmp/r bsmith$ svn mv a z
   A z
   D a/b/c
   D a/b
   D a

   alden:/tmp/r bsmith$ svn ci -m '' .
   Deleting a
   Adding z

   Committed revision 2.

   alden:/tmp/r bsmith$ svn status --verbose
                 0 0 ? .
                 2 2 bsmith z
                 2 2 bsmith z/b
                 2 2 bsmith z/b/c

But, you are correct, the rename operation on appears to rewrite the
subdirectories too, which is probably a symptom of the way that
subversion works internally.

Perhaps perusing <http://svnbook.red-bean.com/nightly/en/svn.basic.in-
action.html#svn.basic.in-action.wc.dia-1> near Figure 1.7 (section
"Revisions") will shed some light.

// Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Jan 23 20:43:05 2007

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.