I've a "problem" with svn I can't understand why sometimes when I merge two branches it reports modify on mergeinfo property on files with no changes on the text.
Is it a normal behavior?
If not, what can be the problem?
Well, you did merge those two branches. Right? Works as expected.
What you did was do a merge. Even though the merge didn't result in any code changes, and that's not uncommon with merges, Subversion still marks that a merge was done. If nothing else, marking that you did a merge -- even though it resulted in no changes, is still a good idea. Imagine a release going out, and someone saying "Wait, no one merged that branch back into the trunk! We'll have to delay the release until we get that done" because they didn't see the merge in the svn:merge-info
record.
So, yes what you saw can be normal behavior.
Now, if your question is "Why didn't my changes get merged", that's a different issue. Subversion usually does a good job with merges, but you have to make sure you do a few things:
- Merge from the root of your project only, and not individual branches and files. There are exceptions, but most of the time you should be merging the branches of a project. Otherwise, you'll end up with
svn:merge-info
all over the place. - Know when to use the
--reintegrate
flag. You have a branch "A" (which could include trunk in this example). You make a branch "B" from branch "A".- When you merge from "A" to "B", you don't use
--reintegrate
- When you merge from "B" to "A", remember to use
--reintegrate
. It changes the way Subversion handled the merge.
- When you merge from "A" to "B", you don't use
- Subversion doesn't handle highly complex merge situations very well. If you make a branch a whole slew of branches, and do merges back and forth between them, Subversion will mess up. This is one of the reasons I tell people not to do the branch per feature business. It makes tracking the various merges hard to do, and can cause Subversion to have merge problems. Maybe this is a feature: Since Subversion doesn't handle these highly complex merge situations very well, you have to avoid them. I've been able to talk many managers out of highly complex anti-pattern branching schemes by simply stating Subversion can't handle it.
- If you manually merge your files (and many developers prefer to do this: Apply changes in the branch back to the trunk manually), use the
svn merge --record-only
, so that Subversion knows you've done the merge. Hilarity ensues when developers do some merges manually while others allow Subversion to do the merge.
So, if Subversion didn't merge in changes it should have, make sure that you're using the --reintegrate
correctly, and that you're not having the other issues mentioned above.
svn:mergeinfo
. The configuration.xml
gets changed because someone did an svn merge
on just that one file, and now it has to track merges too. Thus, it's svn:mergeinfo
gets updated too. That's why I said to always merge from the root from the project. Otherwise, you'll end up with thousands of files -- each with its own svn:mergeinfo
. –
Longtin configuration.xml
, that's the problem, also if there isn't any modify on it, SVN set the mergeinfo
property... –
Childs svn:mergeinfo
attribute on it, it means someone did a merge on that file, and only that file in the distant past. svn:mergeinfo
is set on the root of the merge (which is why I stated my first point). Once svn:mergeinfo
is set on a file or directory, it will be updated on every merge even though it's not on the root of the tree. See Mergeinfo Inheritance. You can delete the svn:mergeinfo
property on configuration.xml
to get merge tracking to stop. Then, it wont' update it. –
Longtin configuration.xml
file has an svn:mergeinfo
property on it. –
Longtin svn:mergeinfo
property is used to track information about merges which have been performed in your repository.
See the SVNBook for details: "Mergeinfo and Previews".
© 2022 - 2024 — McMap. All rights reserved.