TrimMergeInfo.pl - Trim Matching Subversion Merge Information |
TrimMergeInfo.pl - Trim Matching Subversion Merge Information
perl TrimMergeInfo.pl <wc_dir> <path_regex> [--revisions=<range>] [<path_regex> ...]
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.
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.
These arguments specify Perl regular expressions to look for in the merge source paths. Any entry that matches one of these will have its merged revision numbers trimmed. If merge source path ends up with no revision numbers, it is removed. If all the merge source paths are removed, the merge info property is deleted.
One or more of these arguments are required.
This optional argument specifies a revision number range to remove from the matching source paths.
Four forms of revision ranges are supported:
0:HEAD
This is the default. It indicates that all merge info for the matching source paths should be trimmed.
0:
endrev
This range indicates that any revision numbers prior to, and including, endrev should be trimmed. This is often used to remove any merge info prior to the creation of a branch.
:
endrev
This specifies an inclusive range of revisions to be trimmed.
:HEAD
This range indicates that any revisions after, and including, startrev should be trimmed.
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.
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.
$Id: TrimMergeInfo.pl 13 2009-07-06 16:48:03Z Geoffrey $
Copyright (c)2009 Geoff Rowell. All rights reserved.
TrimMergeInfo.pl - Trim Matching Subversion Merge Information |