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

Re: how to predict copy behavior?!

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2005-09-05 18:29:43 CEST

On Sep 5, 2005, at 11:22 AM, A.T.Hofkamp wrote:

> Ben Collins-Sussman wrote:
>
>> On Sep 5, 2005, at 8:43 AM, A.T.Hofkamp wrote:
>>
>>>
>>> This kind of things happens often with me, for some reason
>>> copying and moving files/dirs at the file system is easy (I
>>> almost never make mistakes there), while with svn I often end up
>>> with a result I don't intended/wanted.
>>>
>> Both 'svn cp' and 'cp' follow the same basic rule when you run
>> 'copy A B':
>> if B exists:
>> create B/basename(A)
>> else:
>> create B, where B == basename(A)
>>
>
> I don't understand what you mean by "where B == basename(A)", does
> that imply that you throw away the name B in the latter case?
>

Sure, if I run 'svn cp foo/bar/ baz/bop/', and 'baz' is an empty
directory, then the 'bop' subdir will be created, and it will be an
identical copy of 'bar'.

> cp at least doesn't do this, 'cp -r A B' for non-existing B does
>
> 1. create B
> 2. 'cp -r A/* B' (with * also including the hidden files/dirs).
> (copy all files in A to B/.)

I think we're describing the same thing here.

>
>
>
>> There are two differences, however, that I'm aware of:
>> 1. subversion always canonicalizes "/foo/bar/baz/." into "/
>> foo/ bar/baz",
>> for every command, I think.
>>
>
> This prevents me from copying contents of a directory in one command.
> While this can be worked around, being able to refer to "all files
> in directory X" seems a useful concept for svn.
>
> Are there other ways to express this concept?
>

Not at the moment.

>
>> 2. 'svn cp' only takes two arguments, instead of N arguments.
>>
>
> so I found out :-)
> Not a major problem imho.
>

Sure it's a major problem. If it worked, you could run 'svn cp A/*
B' and get what you want. :-)

-- 
www.collab.net  <>  CollabNet  |  Distributed Development On Demand
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Sep 5 18:31:35 2005

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