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

Selectively removing mergeinfo from svn dump with SvnDump python library

From: Arcady Volman <arkadiy8_at_gmail.com>
Date: Sun, 30 Nov 2008 19:38:45 +0200

Hello everybody,

Please help me to understand how safe (or unsafe) is what I'm going to do to
my repository.

I have a repository that suffers from a lot redundant mergeinfo after we
were performing merges into targets with switched directories and files.
The switched items were all switched to URLs within the same branch/trunk
(e.g.: trunk/project/foo.cpp was switched to repo/trunk/shared/foo.cpp).
Now we have a lot of directories and files that has their own mergeinfo.
This causes us two problems:
1. When we merge, we are likely to produce mergeinfo that cause the error
"Mergeinfo for '...' maps to an empty revision range" (See
http://subversion.tigris.org/issues/show_bug.cgi?id=3312)
2. When we merge we get lots of irrelevant mergeinfo modifications
throughout the trunk tree.

Now since issue #3312 makes our mergeinfo unusable and since the redundant
mergeinfo will make it hard to read the logs and to review changes before
committing a merge even if we'll overcome issue #3312, I'm considering to
filter out all the irrelevant mergeinfo from the history.

Here is how I'm planning to do it:
I'm going to make sure that everything up untill now was merged into trunk
and than use SvnDump python library (see
http://svn.borg.ch/svndumptool/0.5.0/) to filter the svn dump.
I'm going to use this script:

===============================
import __init__
from __init__ import copy_dump_file
from file import SvnDumpFile
from node import SvnDumpNode

class MergeinfoFilter:
    def transform(self, dumpfile):
        for i in range(0, dumpfile.get_node_count()):
            n = dumpfile.get_node(i)
            if not n.get_path() in ['Trunk'] and n.has_properties and
n.get_action() != 'delete':
                n.del_property('svn:mergeinfo')

t = MergeinfoFilter()
copy_dump_file( 'dump.txt', 'filtereddump.txt', t )
=================================

After I'll do it I see two problems:
1. Files that had mergeinfo changes and that also have additional svn
properties, will appear in some revisions as modified without actual changes
2. Some merged revisions will appear as if they were not fully merged if the
merge was not done from the root of the branch to the root of the trunk
(I'll mark such revisions as merged with "Record Only Merge" because I
assume non of us made partial merges - people here always merge all the
modifications of each revision).

Can see more problems that I can't ?

Thank you very much,
Arcady Volman.
Received on 2008-11-30 18:39:07 CET

This is an archived mail posted to the Subversion Users mailing list.