Filtering Subversion paths

The default behavior is not to exclude any path in Subversion; however for large repositories with many tags/ folders or situations where only part of a Subversion repository is to be converted you may wish to exclude certain Subversion paths. Subversion path exclusion is possible using two map files exclude.map and include.map.

The filtering is based on matching the Subversion path to a regular expression in the map files. The exclude.map file is processed first and if the pattern matches part of the path then that path is skipped. The include.map file can be used to overlay the exclude.map file re-adding paths that were skipped. Before a conversion can start the filters must be verified against the Dump file (typically this is fairly quick and a displays a progress indicator).

The verification step is to prevent the situation where an excluded path is relied on at a later point in the history for a branch, copy or merge action. If such a situation is found the paths are logged and the excluded source path is added to the issue.map file. To resolve the issue the exclusion should be removed from the exclude.map file or a regular expression, based on the issue.map file, added to the include.map file.

For example; to exclude all Subversion tags in the folder 'tags/', create an exclusion map file exclude.map:

# exclude Subversion tags:
^tags/.*

Then start the conversion to verify the map:

pallen-mac:main$ java -jar dist/p4convert.jar --config=Config/foo.cfg 
loading ChangeMap: 	changeMap.txt
loading TypeMap: 	types.map
importing revisions: 	1 to 20635 out of 20635
exclude.map: ^tags/.*
Verifying exclusion map...
issue: tags/rel-1.0.14/api
issue: tags/rel-1.0.14/sys
issue: tags/rel-2.0.3
Issues found, saving issue map...
Caught EXIT shutting down ...

Looking at the reported issues the tags 'rel-1.0.14' and 'rel-2.0.3' have some actions that conflict with our exclusion, to resolve this simply add the exclusions to the 'include.map' file:

# issues reported for tags/ folder
^tags/rel-1.0.14/.*
^tags/rel-2.0.3/.*