You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Brad Heide <Br...@trapezegroup.com> on 2010/03/04 21:27:16 UTC

SVN Bug? mergeinfo being stamped on wrong files

Hi.

This is my first attempt at making a bug report to this group. Hopefully 
I'll get it right.

SVN server version: 1.6.5. Build: Tigris.org, Apache 2.2 compatible, 
maintained by D.J. Heap, Branko Čibej and Troy Simpson)
SVN client version: 1.6.9. Build: Collabnet, Windows version.
Client OS: Windows XP SP3, 32-bit
Server OS: Windows 2003 SP2, 32-bit
Apache version: 2.2.13

Ever since our company upgraded to Subversion 1.6 we have occassionally 
experience a problem with merging where files that should not have been 
touched by the merge end up showing up in the diffs afterward with the 
merged revision number stamped in their properties. In all cases the files 
in question have not actually been modifed by the merge, just had their 
mergeinfo property updated with the revision number used in the merge.

It seems to happen only in some branches. Where it does happen the same 
files keep getting touched by any other revisions we merge to the branch 
even when those files are not related to the revision being merged.

Sorry, I don't have a reproducable but here is a log of an example: I am 
merging revision 38300 from trunk [_Core3-trunk\Modules\Core] to branch [
Core3-3.15.x\Modules\Core].


C:\Dev\ModuleTests\Core3-3.15.x\Modules\Core>svn --version --quiet
1.6.9

C:\Dev\ModuleTests\Core3-3.15.x\Modules\Core>svn diff

(no differences currently in branch)


C:\Dev\ModuleTests\Core3-3.15.x\Modules\Core>svn log -v -c 38300 
..\..\..\_Core3-trunk\Modules\Core
------------------------------------------------------------------------
r38300 | brad.heide | 2010-02-19 18:04:17 -0500 (Fri, 19 Feb 2010) | 1 
line
Changed paths:
   M /modules/Core3/trunk/Lib/CoreLib/TCF_Json.cpp

DEVCORE3-929 Debug Assertion Error in JSON Value::asCString (When 
converting to a Rowset attribute string)
------------------------------------------------------------------------

(Only one file, TCF_Json.cpp, is part of revision 38300. Next we do the 
actual merge...)


C:\Dev\ModuleTests\Core3-3.15.x\Modules\Core>svn merge -c 38300 
..\..\..\_Core3-trunk\Modules\Core

(It just so happens that revision 38300 has already been merged to this 
branch so we expect the result of this merge operation to be no changes in 
the working copy, but lets check for diffs anyhow...)


C:\Dev\ModuleTests\Core3-3.15.x\Modules\Core>svn diff

Property changes on: .
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /modules/Core3/trunk:r38300


Property changes on: Test\WebTester
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /modules/Core3/trunk/Test/WebTester:r38300


Property changes on: Exe\CliShell
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /modules/Core3/trunk/Exe/CliShell:r38300


Property changes on: Exe\CliShell\CliShell.cpp
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /modules/Core3/trunk/Exe/CliShell/CliShell.cpp:r38300


Property changes on: Exe\ProfileEditor
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /modules/Core3/trunk/Exe/ProfileEditor:r38300


Property changes on: Include
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /modules/Core3/trunk/Include:r38300


Property changes on: Include\TCG_Sdd.h
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /modules/Core3/trunk/Include/TCG_Sdd.h:r38300


Property changes on: UserAgent\W3C\Behavior\Editors
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /modules/Core3/trunk/UserAgent/W3C/Behavior/Editors:r38300


Property changes on: Lib\CoreLib\CoreLib4.dsp
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /modules/Core3/trunk/Lib/CoreLib/CoreLib4.dsp:r38300


Property changes on: Lib\CoreLibHelp\CoreLibHelp4.dsp
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /modules/Core3/trunk/Lib/CoreLibHelp/CoreLibHelp4.dsp:r38300


Property changes on: Lib\UTestLib
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /modules/Core3/trunk/Lib/UTestLib:r38300


Property changes on: Cli
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /modules/Core3/trunk/Cli:r38300


Property changes on: Cli\TpxTest
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /modules/Core3/trunk/Cli/TpxTest:r38300


Property changes on: Srv\CoreSrvApp
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /modules/Core3/trunk/Srv/CoreSrvApp:r38300


C:\Dev\ModuleTests\Core3-3.15.x\Modules\Core>

A whole bunch of files have had their mergeinfo property stamped with 
revsion 38300 even though they had nothing to do with revision 38300.

Brad Heide
Senior Systems Architect
Trapeze
brad.heide@trapezegroup.com
www.trapezegroup.com

Re: SVN Bug? mergeinfo being stamped on wrong files

Posted by Stein Somers <ss...@opnet.com>.
One way to get mergeinfo on non-mergeinfo nodes is when you copy a 
directory.

E.g. the repository has /trunk/dirA, without mergeinfo anywhere below 
/trunk. In a working copy on /trunk do:

	svn copy ^/trunk/dirA dirB

Now dirB has mergeinfo that is not helping in any way.

If you do instead:
	svn copy dirA dirB

dirB gets no mergeinfo. But that is probably related with the note about 
WC -> WC copies explained by "svn help copy".

-- 
Stein

Re: SVN Bug? mergeinfo being stamped on wrong files

Posted by Stefan Sperling <st...@elego.de>.
On Fri, Mar 05, 2010 at 01:40:24PM -0500, Brad Heide wrote:
> For example, when I look at the history of revision 31673 in branch 
> /modules/Core3/branches/3.12.x this is the only change in the log:
> 
> /modules/Core3/branches/3.12.x/Res/Std/En_US/str/Global.string
> 
> So revision 31673 had nothing to do with CliShell.cpp. How this revision 
> got stamped on the mergeinfo of CliShell.cpp in the 3.15.x branch I have 
> no idea.

It's perfectly valid to record mergeinfo on a path for a revision
which did not affect the path itself. Subversion cannot know if a
revision affected a particular path without looking at the revision,
which might mean contacting the repository for information.

Recording the revision as merged even though it did not affect the
path saves Subversion from having to ask itself "did the revision affect
this particular path and do I still need to merge it into this path?"
again in the future, i.e. avoid contacting the repository again to
get this information.

Consider how this logic applies to entire revision ranges being marked
as merged. E.g. mergeinfo like "/trunk:30-244" on your branch root
does *not* imply that any of the revisions 30 through 244 affected trunk.

It's possible that trunk was last modified in revision 29, you created
the branch in revision 30, then did a sync merge to trunk in revision 245
(which was a no-op except for mergeinfo changes) and then trunk is modified
again, for the first time since revision 29, in revision 246.
In this example, commits in the range 30-244 were either affecting
your own branch or other branches. But Subversion can record the entire
range as "merged", meaning "I've looked at all of this and any changes
made to /trunk from r30 to r244 (there were none) are included in this
branch -- I don't need to ask myself this question ever again".

> Figuring that the merginfo was all messed up on the affected files and 
> folders, I removed the mergeinfo property from just the affected files and 
> folders and committed the change. I then re-ran my test of re-merging 
> something that was already merged and this time no differences showed up 
> in the working folder (good!) So my problem appears to be fixed for now. 
> How the bad mergeinfo got on these particular files I still don't know but 
> I will keep an eye out to see if it happens again.

OK. Glad to hear you could fix the problem!

Stefan

Re: SVN Bug? mergeinfo being stamped on wrong files

Posted by Brad Heide <Br...@trapezegroup.com>.
Thanks Stefan.

You are correct that the example I chose (r38300) had not originally been 
applied at the root of the branch however I don't believe that was the 
cause of the problem. I tried re-merging another revision that had been 
originally applied to the root of the same branch and I got the same list 
files and folders that should not have been touched minus the root folder. 
So in the example I sent you it was correct that the root folder of the 
branch should have been updated with the revision number but not the other 
diffs that showed up.

I took a closer look at the mergeinfo revision numbers stamped on the 
affected files and many of them appeared to point to revisions that had 
nothing to do with that file. Here is an example for file CliShell.cpp 
(the root of the working folder is 
C:\Dev\ModuleTests\Core3-3.15.x\Modules\Core)

C:\Dev\ModuleTests\Core3-3.15.x\Modules\Core\Exe\CliShell\CliShell.cpp

/modules/Core3/branches/3.12.x/Exe/CliShell/CliShell.cpp:31673
/modules/Core3/branches/3.14.x/Exe/CliShell/CliShell.cpp:33671,33721-33777,33781,33788,33795-33815,33832,33834,33843,33860,33904-33915,33921,33928,33945,34136,34292,34317,34394,34419,34968,35879,35947,36082-36093,36247,36253
/modules/Core3/branches/3.15.x/Exe/CliShell/CliShell.cpp:33601,33864
/modules/Core3/trunk/Exe/CliShell/CliShell.cpp:37590,37594,37693,37705,37719,37804,37822

For example, when I look at the history of revision 31673 in branch 
/modules/Core3/branches/3.12.x this is the only change in the log:

/modules/Core3/branches/3.12.x/Res/Std/En_US/str/Global.string

So revision 31673 had nothing to do with CliShell.cpp. How this revision 
got stamped on the mergeinfo of CliShell.cpp in the 3.15.x branch I have 
no idea.

Figuring that the merginfo was all messed up on the affected files and 
folders, I removed the mergeinfo property from just the affected files and 
folders and committed the change. I then re-ran my test of re-merging 
something that was already merged and this time no differences showed up 
in the working folder (good!) So my problem appears to be fixed for now. 
How the bad mergeinfo got on these particular files I still don't know but 
I will keep an eye out to see if it happens again.

Thank you for your help and prompt response in this matter.

Brad.

brad.heide@trapezegroup.com




Stefan Sperling <st...@elego.de> 
2010-03-05 05:33 AM

To
Brad Heide <Br...@trapezegroup.com>
cc
users@subversion.apache.org
Subject
Re: SVN Bug? mergeinfo being stamped on wrong files






On Thu, Mar 04, 2010 at 04:27:16PM -0500, Brad Heide wrote:
> C:\Dev\ModuleTests\Core3-3.15.x\Modules\Core>svn merge -c 38300 
> ..\..\..\_Core3-trunk\Modules\Core
> 
> (It just so happens that revision 38300 has already been merged to this 
> branch so we expect the result of this merge operation to be no changes 
in 
> the working copy, but lets check for diffs anyhow...)

This merge was however never recorded in the mergeinfo at branch's
root. Else you would not see this bit show up in the diff:
 
> Property changes on: .
> ___________________________________________________________________
> Modified: svn:mergeinfo
>    Merged /modules/Core3/trunk:r38300

You should check with your developers how they are doing merges.

Mergeinfo is always recorded at the merge target. If people merge
into individual files directly, those files will get mergeinfo set
on them. This makes Subversion's mergetracking very flexible,
but the mergeinfo will spread across branches and can end up
being a nuisance if people using the repository don't have a common
idea of merging guidelines, or if some users don't follow guidelines
and end up polluting the repository with mergeinfo excessively.

I usually recommend to define a set of paths in the repository
where mergeinfo is allowed to be set -- let's call these paths
"mergeinfo nodes". The set of mergeinfo nodes normally contains
just the root folders of branches. But it can be larger in case you
have special requirements such as a separate team merging into
some subdirectory of a branch, because that subdirectory is the
scope of their activities in the repository.

Merging is then done only into targets within the mergeinfo node set.
No other merge targets should be used.
(Except if direct merges from one file to another need to be done
as part of conflict resolution, for instance, if files were renamed
on one branch but not the other. In this case, you can remove the
mergeinfo created on the files, since conflict resolution is part
of the larger merge you are doing.)

As soon as mergeinfo enters the repository which is not on
one of the mergeinfo nodes, the alarm bells should ring and
mergeinfo needs to be cleaned up.

If the above makes sense to you, what would be your set of
"mergeinfo nodes", and are your users really only merging into
those paths?
Can you try to figure out when the mergeinfo on the affected
files first entered the repository, and what kind of merge was
done at that time?

Stefan


Re: SVN Bug? mergeinfo being stamped on wrong files

Posted by Stefan Sperling <st...@elego.de>.
On Thu, Mar 04, 2010 at 04:27:16PM -0500, Brad Heide wrote:
> C:\Dev\ModuleTests\Core3-3.15.x\Modules\Core>svn merge -c 38300 
> ..\..\..\_Core3-trunk\Modules\Core
> 
> (It just so happens that revision 38300 has already been merged to this 
> branch so we expect the result of this merge operation to be no changes in 
> the working copy, but lets check for diffs anyhow...)

This merge was however never recorded in the mergeinfo at branch's
root. Else you would not see this bit show up in the diff:
 
> Property changes on: .
> ___________________________________________________________________
> Modified: svn:mergeinfo
>    Merged /modules/Core3/trunk:r38300

You should check with your developers how they are doing merges.

Mergeinfo is always recorded at the merge target. If people merge
into individual files directly, those files will get mergeinfo set
on them. This makes Subversion's mergetracking very flexible,
but the mergeinfo will spread across branches and can end up
being a nuisance if people using the repository don't have a common
idea of merging guidelines, or if some users don't follow guidelines
and end up polluting the repository with mergeinfo excessively.

I usually recommend to define a set of paths in the repository
where mergeinfo is allowed to be set -- let's call these paths
"mergeinfo nodes". The set of mergeinfo nodes normally contains
just the root folders of branches. But it can be larger in case you
have special requirements such as a separate team merging into
some subdirectory of a branch, because that subdirectory is the
scope of their activities in the repository.

Merging is then done only into targets within the mergeinfo node set.
No other merge targets should be used.
(Except if direct merges from one file to another need to be done
as part of conflict resolution, for instance, if files were renamed
on one branch but not the other. In this case, you can remove the
mergeinfo created on the files, since conflict resolution is part
of the larger merge you are doing.)

As soon as mergeinfo enters the repository which is not on
one of the mergeinfo nodes, the alarm bells should ring and
mergeinfo needs to be cleaned up.

If the above makes sense to you, what would be your set of
"mergeinfo nodes", and are your users really only merging into
those paths?
Can you try to figure out when the mergeinfo on the affected
files first entered the repository, and what kind of merge was
done at that time?

Stefan