Re: False conflict with interleaved merge commits

2020-02-07 Thread Daniel Dickison
On Feb 7, 2020, at 02:44, Stefan Sperling  wrote:
> 
> On Thu, Feb 06, 2020 at 03:37:10PM -0500, Daniel Dickison wrote:
>> Strangely, the conflict goes away if you flip the order of steps 2 and 3,
>> or commit the merge from step 4 first.
> 
> I would say it is working as designed, but the design has its flaws.
> 
> As you have found out, the basic problem is that unlike when developers
> work on the same branch, SVN does not enforce an 'svn update' style
> operation when merges and commits interleave.
> 
> This is indeed a problem but it is not easy to fix in SVN itself.
> If this happens to your team a lot you might want to let your developers
> know about the issue and show them how to work around it.

Thanks for the detailed info and quick response. This is good to know that it’s 
a fundamental design issue that’s unlikely to be fixed in SVN itself.

As far as I know, it has only happened for us with a single developer merging 
between trunk and a branch, and accidentally interleaving the commits. We’ve 
already put in tooling to block that particular scenario in our wrapper 
scripts, so hopefully that mostly prevents this from occurring in the wild.


> An easy way to work around it is the following, which essentially
> simulates the missing 'svn update' style step. After a merge, and
> before committing this merge, if the other branch has new changes
> which were not yet merged, merge those changes as follows to "catch up":
> 
>   svn merge -r0:HEAD ^/the/other/branch

I did not know about this method to force a sync merge. I have a feeling this 
will come in handy!



Re: False conflict with interleaved merge commits

2020-02-07 Thread Daniel Shahaf
Stefan Sperling wrote on Fri, 07 Feb 2020 08:44 +0100:
> Which is why I see no way to fix this in SVN itself.
> If we made SVN record r5 during the original merge (before r5 existed),
> that would be wrong.
> And if we made SVN skip A/mu edits from r5 during the conflicting merge,
> that would be wrong, too.
> 
> So to me it looks like this needs to be handled by synchronizing
> your developers. Sorry :-/

Quick question.  I commented out the last merge in Daniel's script (line 121),
ran the script, then ran the following by hand:

[[[
% cd wcb
% svn mergeinfo --show-revs=eligible ../wc
r5
r7
% svn merge -c 5 ../wc
--- Recording mergeinfo for merge of r5 into '.':
 U   .
% svn merge -c 7 ../wc
--- Merging r7 into '.':
UA/mu
--- Recording mergeinfo for merge of r7 into '.':
 G   .
% svn di
Index: A/mu
===
--- A/mu(revision 7)
+++ A/mu(working copy)
@@ -1 +1 @@
-Edit 1 of A/mu in trunk
+Edit 2 of A/mu in trunk
Index: .
===
--- .   (revision 7)
+++ .   (working copy)

Property changes on: .
___
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r5,7
%
]]]

That's the desired result, isn't it?  If so, is there an underlying rule
here that we could teach Subversion to follow automatically?

Cheers,

Daniel