TrimMergeInfo.pl - Trim Matching Subversion Merge Information


NAME

TrimMergeInfo.pl - Trim Matching Subversion Merge Information


SYNOPSIS

    perl TrimMergeInfo.pl <wcdir> <regex> [<regex> ...]


DESCRIPTION

Recursively trim matching "svn:mergeinfo" entries from the indicated working copy directory. This script can be run multiple times on the same working copy in order to apply different sets of regular expressions.

This script does not commit any changes. If you make a mistake, you can use "svn revert" to restore the trimmed information.

Merge information is recorded for both folders and files.

NOTE: This will NOT trim merge information contained within "svn:externals" folders. To trim their merge information, you must explicitly run this on the corresponding directories in the working copy.

This script uses the Subversion command line tools.

Arguments

<wcdir>

This argument specifies the pathname of the working copy directory. The merge information for this directory, and all contained files and subdirectories, will be trimmed.

Only one working copy directory may be specified.

<regex>

These arguments specify Perl regular expressions to look for in the merge information property. Any entry that matches one of these will be dropped from the updated property. If dropping the entry would result in an empty property, the property is deleted.

One or more of these arguments are required.

Listing Merge Info

The following Subversion command will give you a full listing of the merge information in a working copy.

    svn propget svn:mergeinfo D:\my\working\copy --depth=infinity

Please note that this won't contain information from external folders.

Merge Info Data Format

The "svn:mergeinfo" property of files and folders consists of a multi-line value. Each line represents merge information for a merge source in the common repository.

Example value for file "branches/15.5/foo.c":

    /project/bar/trunk/foo.c:127-201,212
    /project/bar/branches/alt_a/foo.c:208,210,218-220

This script can be used to trim any or all of these lines. This is particularly useful when one of the referenced branches has been deleted from the HEAD of the repository.


VERSION

    $Id: TrimMergeInfo.pl 3 2009-06-01 14:13:36Z Geoffrey $


COPYRIGHT

Copyright (c)2009 Geoff Rowell. All rights reserved.

 TrimMergeInfo.pl - Trim Matching Subversion Merge Information