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

Re: Completely overwrite a file.

From: Gavin Beau Baumanis <gavinb_at_thespidernet.com>
Date: Thu, 18 Nov 2010 09:35:04 +1100

Hi Stefan,

We don't use SVN in it's classic setup.
Well basically it is more a case of we don't actually do "releases".

We do all dev work locally.
A CRON job on the staging server; does an svn update - and that (staging) local working copy becomes the staging delpoyment for our web application.

After appropriate testing / user acceptance;
We do whatever takes our fancy at the tie - basically, to get a copy of the files at their current state in trunk into a branch we've named production.

We then copy from the production branch onto the production server.

In this way - if it turns out that there is an issue, we can simply reverse-merge the last change that broke production - and go back to the start and redo coding / testing etc.
We practically treat them as two separate repositories.

The process of getting the file from the trunk to the production branch is pretty hit and miss.
Sometimes we simply (OS) copy the file(s) from trunk to the production branch and then commit the branch.
Sometimes we do a changeset or revision based merge.

It just depends on who did the task at the time.

We basically don't care too much about how the file gets to the production branch - just so long as it does.
But now as a result of this development history we have a problem.

We're currently going from having a complete copy of the source code per customer, to having a single "trunk" and using configuration for customisation, instead.

So basically now is a good time to ensure that we're doing things "properly".

I suppose I just wanted confirmation that svn merge --accept="theirs-full" - will in fact do what I;m expecting - and this is to make the destination an exact copy of the source.

And a follow-up question now springs to mind too, is there a better way?
Doing a merge from 1:head (even with the new, --accept="theirs-full", option) can be a time-expensive exercise.

As always - Thanks.

Gavin "Beau" Baumanis

On 18/11/2010, at 12:09 AM, Stefan Sperling wrote:

> On Wed, Nov 17, 2010 at 11:00:25PM +1100, Gavin Beau Baumanis wrote:
>> Hi there,
>> I have a question about completely overwriting a destination file with a merge.
>> I have been doing;
>> svn merge -r1:head trunk/somefile branches/somefeature/somefile
>> As long as I continue to choose "Their File" for any / all conflicts;
>> My question is - will this actually give me a complete / accurate copy of the trunk file in the branch location?
> It will as long as you choose "theirs-full", but only for conflicting files.
> Note that you could also use the --accept="theirs-full" option to skip the
> interactive prompt.
>> Is this the correct method to achieve what I want?
> That depends. Could you describe what problem you're trying to solve, really?
> You've explained the way you're trying to solve the problem. But what got you
> into this situation in the first place?
> Merging into the file directly will create subtree mergeinfo, which you
> might want to avoid.
> Stefan
Received on 2010-11-17 23:35:59 CET

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.