On Tue, Jul 14, 2009 at 01:58:16PM +0100, James French wrote:
>
>
> > -----Original Message-----
> > From: Stefan Sperling [mailto:stsp_at_elego.de]
> > Sent: 14 July 2009 13:41
> > To: James French
> > Cc: users_at_subversion.tigris.org
> > Subject: Re: resolving tree conflicts
> >
> > On Tue, Jul 14, 2009 at 01:31:07PM +0100, James French wrote:
> > > Thanks Stefan. That is very clear. However, unfortunately I wasn't
> > > very clear! I really want, if possible, to do this in a single commit
> > > so I don't break it for everyone else while I do the merge, and for
> > > the sheer principle of the thing. Is this possible somehow?
> >
> > You can merge into a working copy with local modifactions.
> > So yes, it should be possible. Move all files and directories
> > around first, then do the merge. Then check if the end result
> > is what you wanted, then commit.
>
> I tried this on a small sample of files. It didn't work. Files were
> not moved into newly added directories, and the files I moved locally
> did not get any changes merged into them.
Can you describe what commands you were running exactly?
It helps to understand what you are doing.
I realised now that with local modifications in the working copy,
you will most likely get tree conflicts flagged even if the tree
structures don't differ. You will get conflicts like "local add,
incoming add upon merge" or "local delete, incoming delete upon merge".
But even if this happens, it's only a warning. If you know there's
no problem, just tell Subversion that there is no problem.
For example:
[/tmp/svn-sandbox/branch] $ ls
alpha beta epsilon/ gamma/
[/tmp/svn-sandbox/branch] $ svn mv epsilon epsilon.moved
A epsilon.moved
D epsilon/zeta
D epsilon
[/tmp/svn-sandbox/branch] $ svn ci -mm
Deleting epsilon
Adding epsilon.moved
Committed revision 3.
[/tmp/svn-sandbox/branch] $ cd ../trunk
[/tmp/svn-sandbox/trunk] $ cat epsilon/zeta
zeta
[/tmp/svn-sandbox/trunk] $ echo blah > epsilon/zeta
[/tmp/svn-sandbox/trunk] $ svn ci -mm
Sending epsilon/zeta
Transmitting file data .
Committed revision 4.
[/tmp/svn-sandbox/trunk] $ svn mv epsilon epsilon.moved
A epsilon.moved
D epsilon/zeta
D epsilon
[/tmp/svn-sandbox/trunk] $ svn merge -c3 ^/branch .
--- Merging r3 into '.':
C epsilon.moved
--- Merging r3 into 'epsilon':
C epsilon
Summary of conflicts:
Tree conflicts: 2
[/tmp/svn-sandbox/trunk] $ svn st
M .
A + C epsilon.moved
> local add, incoming add upon merge
D C epsilon
> local delete, incoming delete upon merge
D epsilon/zeta
[/tmp/svn-sandbox/trunk] $ cat epsilon.moved/zeta
blah
[/tmp/svn-sandbox/trunk] $ svn resolve --accept=working epsilon.moved epsilon
Resolved conflicted state of 'epsilon.moved'
Resolved conflicted state of 'epsilon'
[/tmp/svn-sandbox/trunk] $ svn st
M .
A + epsilon.moved
D epsilon
D epsilon/zeta
[/tmp/svn-sandbox/trunk] $
So in this merge, both textual changes and structural changes
were merged as desired. We just had to tell Subversion that it
was seeing tree conflicts were there were none.
Stefan
Received on 2009-07-14 15:33:23 CEST