Command line tool to consolidate
svn:mergeinfo properties to the root branch node (
/branches/X.Y/) and clean safely properties set on sub-folders in a working copy tree.
svn-clean-mergeinfo.pl [--debug] [--verbose] [--nowrite] [path ...]
svn:mergeinfoproperties in a Subversion working copy to the root node.
If the option
--nowriteis enabled, consolidated properties are not written to the working copy but only reported as a summary. If one or more path are given as parameters, only consolidate this subset.
When the option
--nowriteis not set,
svn:mergeinfoproperties are persist in the current working copy every 500 checked revisions. This threshold can be tuned with
--checkpointoption. A value of 0 means no intermediate write will occur.
svn-clean-mergeinfo.pl --status [path ...]
prints a summary of
svn:mergeinfoproperties content as numbers of merged revisions for each branch. If one or more path are given as parameters, reports only information for this subset.
This script must be invoked from a Subversion working copy directory, usually a checkout of /trunk or of a branch.
First it parses
svn:mergeinfo and scans for branch/revisions on non-root folders, eventually limited to paths given as arguments.
If a revision is already included at the root node level, it is discarded from sub-folders.
If a revision only modifies files included in the scan sub-folder, it is discarded from the sub-folder and appended at root level.
In some cases, a branch name is non consistent with the current node name, so it is left as-is for a manual check if the revision content was partially merged or not.
--nowrite option, every 500 revisions (defined by checkpoint) and after operation is completed, the working copy
svn:mergeinfo are modified so that you can inspect the result before a commit. If the
svn:mergeinfo property is empty, it is planned for removal.
In addition, the
--prunebranches option discards non-live branches from
svn:mergeinfo properties to keep them compact after long history.
This script does not trigger a Subversion commit to the repository. That operation is under your responsability after manual checks and validations.
It finally reports a summary of
svn:mergeinfo properties content as numbers of merged revisions for each branch.
- -h, --help
prints a brief help message and exit status is -2.
- -m, --man
prints the manual page and exit status is -2.
prints usual "no warranty" message and license information.
prints progress messages to the standard output.
prints debug messages to the standard output.
- --prunebranches, -p
discards no longer live branches from
svn:mergeinfo. A test for paths on repository HEAD is done.
- --nowrite, -n
svn propsetoperations of consolidated
- --checkpoint, -c afterRevisions
change write threshold which defaults to 500 analyzed revisions. 0 means the script no longer partially update working copy as checkpoint.
- --status, -s
only reports a summary of the current working copy
BUGS AND KNOWN LIMITATIONS
Does not support any file name in working copy containing " - ".
Does not support non-inheritable merged revision, marked with a star.
Test with non-standard repository structure.
Prompt for removal of a non-existing origin branch path.
Copyright (C) 2012 Yves Martin This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions