You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Gavin Baumanis <ga...@thespidernet.com> on 2009/05/27 09:46:47 UTC

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.

I thought that svn copy would be my friend..
svn copy trunk/ branches/vendor1/
but it won't work because the target already exists, and it doesn't  
have a --force option either.

Previously I have used;
svn export trunk/ branches/vendor1 --force

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

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!

So I hand it over to you, to point me in the right direction, please!


Thanks in advance,
Gavin.

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

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Overwriting files.

Posted by Gavin Baumanis <ga...@thespidernet.com>.
Hi Geir,

Thanks... that's pretty much what I do do now - though slightly  
semantically different.

I suppose my question  should have been along the lines;

Is this appropriate?
Is there a better way?
Does my "current" method impact anything?
I.e. - since it wasn't merged, it will now surely look like I have  
just re-edited all the files in my vendor branch as opposed to having  
replaced them with code from the trunk.
And if the above assumption is correct - then is there a better way to  
do what I need - that achieves the outcome I want AND better "tracks"  
the steps followed to get to HEAD from (previous) Rxxxxx.

Gavin.


On 27/05/2009, at 11:59 PM, Engebakken Geir wrote:

> Just remove vendor1, then copy!
>
>
> Geir
>
> -----Original Message-----
> From: Gavin Baumanis [mailto:gavinb@thespidernet.com]
> Sent: 27. mai 2009 11:47
> To: users@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.
>
> I thought that svn copy would be my friend..
> svn copy trunk/ branches/vendor1/
> but it won't work because the target already exists, and it doesn't
> have a --force option either.
>
> Previously I have used;
> svn export trunk/ branches/vendor1 --force
>
> and I have also simply copied the files with the OS and then later
> committed.
>
> 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!
>
> So I hand it over to you, to point me in the right direction, please!
>
>
> Thanks in advance,
> Gavin.
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2355698
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org 
> ].

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

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

RE: Overwriting files.

Posted by Geir Engebakken <ge...@edb.com>.
Just remove vendor1, then copy!


Geir

-----Original Message-----
From: Gavin Baumanis [mailto:gavinb@thespidernet.com] 
Sent: 27. mai 2009 11:47
To: users@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.

I thought that svn copy would be my friend..
svn copy trunk/ branches/vendor1/
but it won't work because the target already exists, and it doesn't  
have a --force option either.

Previously I have used;
svn export trunk/ branches/vendor1 --force

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

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!

So I hand it over to you, to point me in the right direction, please!


Thanks in advance,
Gavin.

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

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

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

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: Overwriting files.

Posted by Gavin Baumanis <ga...@thespidernet.com>.
Hi Andrew,


On 28/05/2009, at 12:02 AM, Reedick, Andrew wrote:

> <snip>
>
>> 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.
>

To me it just seemed like a lot of tree-walking for something that  
should be (in my mind) a pretty simple task.
I would love a "--force" option for svn copy - that would seem to  
simply provide what I need in this use-case.

Anyway,

> 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...
>

Nice... being new to the Mac (*nix) -  I'm still coming to terms with  
scripting and piping one command into another....
I quite like your solution here.

Again - it does seem like a relative expensive svn operation to do a  
merge from r1 to head..

But it would certainly provide the correct outcome.
The vendor branch would indeed match the trunk and it would  
appropriately "track" the history of how the vendor branch came to be  
the way it is, now.

Thanks very much.

Gavin.

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

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

RE: Overwriting files.

Posted by "Reedick, Andrew" <jr...@ATT.COM>.
> -----Original Message-----
> From: Gavin Baumanis [mailto:gavinb@thespidernet.com]
> Sent: Wednesday, May 27, 2009 5:47 AM
> To: users@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@subversion.tigris.org].


Re: Overwriting files.

Posted by Talden <ta...@gmail.com>.
> 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.
>
> I thought that svn copy would be my friend..
> svn copy trunk/ branches/vendor1/
> but it won't work because the target already exists, and it doesn't
> have a --force option either.

svnmucc is your friend.  You can do this operation in a single step.

something like

CMD> svnmucc -U svn://myserver/myrepo -m "Replacing the vendor1 branch
with trunk" rm /projectX/branches/vendor1 cp HEAD /projectX/trunk
/projectX/branches/vendor1

Or something like that... Test it/check the docs, I'm not certain of
that commandlines correctness.

You'll need a binaries bundle with svnmucc built, or build it
yourself.  On Windows I use SlikSvn.

--
Talden

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

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].