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

RE: Overwriting files.

From: Reedick, Andrew <jr9445_at_ATT.COM>
Date: Wed, 27 May 2009 09:02:08 -0500

> -----Original Message-----
> From: Gavin Baumanis [mailto:gavinb_at_thespidernet.com]
> Sent: Wednesday, May 27, 2009 5:47 AM
> To: users_at_subversion.tigris.org
> Subject: Overwriting files.
>
> This is going to be one of those "stupid" questions...
> Where I end up feeling like a bit of an idiot for having to ask....
> but far better to ask and feel foolish and get some appropriate
> instructions - than not to ask and simply be foolish!
>
> Anyway,
>
> I have the folloiwng paths in the repo already.
> trunk/
> branches/vendor1/
>
> What I need to do is completely overwrite vendor1 with the current
> state of the trunk.

By overwrite, do you mean replace? Ex:
        svn rm branches/vendor1
        svn cp trunk branches/vendor1

> and I have also simply copied the files with the OS and then later
> committed.

Or by overwrite, do you mean overlay? Ex:
        svn co branches/vendor1
        svn export trunk
        cp -pr trunk/* vendor1/.
        <do something about deleting files & dirs that exist in vendor1
but no longer exist in trunk>
        svn ci vendor1

> And I have also used;
> svn merge -r1:head trunk/ branches/vendor1/ - but that just seems like
> a bit of overkill - particularly if the trunk has seen a lot of
action!
>

Why is it overkill? Run the merge. If there are any merge conflicts,
always take the trunk version of the file (cp foo.java.right foo.java;
svn resolve foo.java). Then check-in.

Something like:
1. svn merge...

2. Resolve the conflicts (I've always called this a copy-merge):
svn status | grep '^C' | sed 's/^.......//' |
while read i
do
    cp "$i.right" "$i"
    svn resolve "$i"
done

3. Then svn status to verify the workspace is clean

4. svn ci...

*****

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. GA623

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2355786

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-05-27 16:03:14 CEST

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.